openapi: 3.0.0
info:
  title: Housecall v1 API
  version: '1.0'
  description: Housecall version 1 public API
  contact:
    name: Housecall Engineering
    email: apideveloper@housecallpro.com
servers:
  - url: 'https://api.housecallpro.com'
tags:
  - name: Checklists
  - name: Customers
  - name: Employees
  - name: Estimates
  - name: Jobs
  - name: Job Appointments
  - name: Job Invoices
  - name: Job Types
  - name: Leads
  - name: Lead Sources
  - name: Application
  - name: Webhooks
  - name: Materials
  - name: Material Categories
  - name: Price Forms
  - name: Price Book Services
  - name: Service Zones
  - name: Pipeline
  - name: Routes
  - name: Company
  - name: Schedule
  - name: Events
  - name: Tags
  - name: Lead Line Items
  - name: Invoices
paths:
  /application:
    get:
      summary: Get Application
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Application'
      operationId: get-applications
      description: Get the application for a company.
      tags:
        - Application
      security:
        - Application API Key: []
        - Housecall User OAuth Token: []
    parameters: []
  /application/enable:
    post:
      summary: Enable Application
      operationId: post-application-enable
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Application'
      security:
        - Application API Key: []
        - Housecall User OAuth Token: []
      tags:
        - Application
      description: Enable the application for a company.
  /application/disable:
    post:
      summary: Disable Application
      operationId: post-application-disable
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Application'
      security:
        - Application API Key: []
        - Housecall User OAuth Token: []
      tags:
        - Application
      description: Disable the application for a company.
  /checklists:
    get:
      summary: Get Checklists
      tags:
        - Checklists
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  checklists:
                    type: array
                    items:
                      $ref: '#/components/schemas/Checklist'
      operationId: get-checklists
      description: Get a list of checklists that belong to a job or estimate. Most provide at least one job_uuid or estimate_uuid
      security:
        - Application API Key: []
        - Housecall User OAuth Token: []
      parameters:
        - schema:
            type: number
            default: 1
          in: query
          name: page
          description: Current Page
        - schema:
            type: number
            default: 10
          in: query
          name: per_page
          description: Number of checklists per page
        - schema:
            type: array
            items:
              type: string
          in: query
          name: job_uuids
          description: Id of jobs you want to pull checklists from
          required: true
        - schema:
            type: array
            items:
              type: string
          in: query
          name: estimate_uuids
          description: Id of estimates you want to pull checklists from
          required: true
  /customers:
    get:
      summary: Get Customers
      tags:
        - Customers
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedList'
                  - type: object
                    properties:
                      customers:
                        type: array
                        items:
                          $ref: '#/components/schemas/Customer'
              examples:
                example-1:
                  value:
                    page: 0
                    page_size: 0
                    total_pages: 0
                    total_items: 0
                    customers:
                      - first_name: string
                        last_name: string
                        email: string
                        company: string
                        notifications_enabled: true
                        mobile_number: string
                        home_number: string
                        work_number: string
                        tags:
                          - string
                        lead_source: string
                        addresses:
                          - id: string
                            street: string
                            street_line_2: string
                            city: string
                            state: string
                            zip: string
                            country: string
      operationId: get-v1-customers
      parameters:
        - schema:
            type: string
          in: query
          name: q
          description: 'A query that can be used to search for a customer by name, email, mobile number and address.'
        - schema:
            type: number
            default: 1
          in: query
          name: page
          description: Current Page
        - schema:
            type: number
            default: 10
          in: query
          name: page_size
          description: Number of customers per page
        - schema:
            type: string
            default: created_at
          in: query
          name: sort_by
          description: Customer attribute to sort by
        - schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
          in: query
          name: sort_direction
          description: Ascending or descending
        - schema:
            type: array
            items:
              type: string
          in: query
          name: location_ids
          description: 'Id of locations you want to pull from. * If X-Company-Id header is set, location_ids will be ignored'
        - schema:
            type: array
            enum:
              - attachments
              - do_not_service
          in: query
          name: expand
          description: Array of strings to expand response body
      description: Get a list of customers.
      security:
        - Company API Key: []
        - Application API Key: []
        - Housecall User OAuth Token: []
    parameters: []
    post:
      summary: Create Customer
      operationId: post-customers
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
      description: Create a new Customer.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerCreate'
        description: 'One of first_name, last_name, email, mobile_number, home_number, work_number are required.'
      tags:
        - Customers
      security:
        - Company API Key: []
        - Application API Key: []
        - Housecall User OAuth Token: []
  '/customers/{customer_id}':
    parameters:
      - schema:
          type: string
        name: customer_id
        in: path
        required: true
    get:
      summary: Get Customer
      tags:
        - Customers
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
      operationId: get-customers-customerId
      description: Get the customer via ID.
      security:
        - Company API Key: []
        - Application API Key: []
        - Housecall User OAuth Token: []
      parameters:
        - schema:
            type: array
            enum:
              - attachments
              - do_not_service
          in: query
          name: expand
          description: Array of strings to expand response body
    put:
      summary: Update Customer
      tags:
        - Customers
      operationId: put-customers-customer_id
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
      description: Update customer attributes
      security:
        - Company API Key: []
        - Application API Key: []
        - Housecall User OAuth Token: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerUpdate'
  '/customers/{customer_id}/addresses':
    parameters:
      - schema:
          type: string
        name: customer_id
        in: path
        required: true
    get:
      summary: Get All of a Customer's Addresses
      tags:
        - Customers
      responses:
        '200':
          description: OK
      operationId: get-customer-customer_id-addresses
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/PaginatedList'
                - type: object
                  properties:
                    addresses:
                      type: array
                      items:
                        $ref: '#/components/schemas/Address'
      description: Get all of a customer's addresses
      parameters:
        - schema:
            type: number
          in: query
          name: page
          description: Paginated page number.
        - schema:
            type: number
          in: query
          description: Number of addresses returned per page.
          name: page_size
        - schema:
            type: string
            enum:
              - created_at
              - updated_at
            default: created_at
          in: query
          name: sort_by
          description: Address attribute to sort by
        - schema:
            type: string
            enum:
              - desc
              - asc
            default: desc
          in: query
          name: sort_direction
          description: Ascending or descending
    post:
      summary: Create an Address on a Customer
      operationId: post-customer-customer_id-addresses
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Address'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddressCreate'
      tags:
        - Customers
      description: Create an address on a customer
  '/customers/{customer_id}/addresses/{address_id}':
    parameters:
      - schema:
          type: string
        name: customer_id
        in: path
        required: true
      - schema:
          type: string
        name: address_id
        in: path
        required: true
    get:
      summary: Get a Customer's Address
      tags:
        - Customers
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Address'
      operationId: get-customers-customer_id-addresses-address_id
      description: Get a customer's address via customer ID and address ID.
      security:
        - Company API Key: []
        - Application API Key: []
        - Housecall User OAuth Token: []
  /employees:
    get:
      summary: Get Employees
      responses:
        '200':
          description: OK
          headers: {}
          content:
            application/json:
              schema:
                type: object
                properties:
                  page:
                    type: number
                  page_size:
                    type: number
                  total_pages:
                    type: number
                  total_items:
                    type: number
                  employees:
                    type: array
                    items:
                      $ref: '#/components/schemas/Employee'
              examples:
                example-1:
                  value:
                    page: 0
                    page_size: 0
                    total_pages: 0
                    total_items: 0
                    employees:
                      - id: string
                        avatar_url: string
                        color_hex: string
                        first_name: string
                        last_name: string
                        email: string
                        mobile_number: string
                        role: string
                        created_at: string
                        tags:
                          - string
                        permissions:
                          can_add_and_edit_job: true
                          can_be_booked_online: true
                          can_call_and_text_with_customers: true
                          can_chat_with_customers: true
                          can_delete_and_cancel_job: true
                          can_edit_message_on_invoice: true
                          can_see_street_view_data: true
                          can_share_job: true
                          can_take_payment_see_prices: true
                          can_see_customers: true
                          can_see_full_schedule: true
                          can_see_future_jobs: true
                          can_see_marketing_campaigns: true
                          can_see_reporting: true
                          can_edit_settings: true
                          is_point_of_contact: true
                          is_admin: true
      operationId: get-employees
      parameters:
        - schema:
            type: number
            default: 1
          in: query
          name: page
          description: Current page
        - schema:
            type: number
            default: 10
          in: query
          name: page_size
          description: Number of employees per page
        - schema:
            type: string
            default: created_at
          in: query
          name: sort_by
          description: employee attribute to sort_by
        - schema:
            type: string
            default: desc
          in: query
          name: sort_direction
          description: Ascending or descending
        - schema:
            type: array
            items:
              type: string
          in: query
          name: location_ids
          description: 'Id of locations you want to pull from. * If X-Company-Id header is set, location_ids will be ignored'
      description: 'Get all of the active employees in an organiztion. '
      tags:
        - Employees
      security:
        - Company API Key: []
        - Application API Key: []
        - Housecall User OAuth Token: []
  /jobs:
    get:
      summary: Get Jobs
      tags:
        - Jobs
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedList'
                  - type: object
                    properties:
                      jobs:
                        type: array
                        items:
                          $ref: '#/components/schemas/Job'
      operationId: get-jobs
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - {}
              type: object
            examples: {}
          application/xml:
            schema:
              type: object
      description: Get a list of jobs
      parameters:
        - schema:
            type: string
          in: query
          name: scheduled_start_min
          description: Filters jobs with a starting time greater than or equal to the date sent.
        - schema:
            type: string
          in: query
          name: scheduled_start_max
          description: Filters jobs with a starting time less than or equal to the date sent.
        - schema:
            type: string
          in: query
          name: scheduled_end_min
          description: |-
            Filters jobs with an end time greater than or equal to the date
             sent.
        - schema:
            type: string
          in: query
          name: scheduled_end_max
          description: Filters jobs with an end time less than or equal to the date sent.
        - schema:
            type: array
          in: query
          name: employee_ids
        - schema:
            type: string
          in: query
          name: customer_id
          description: Filters jobs by a single customer ID (string)
        - schema:
            type: string
            default: '1'
          in: query
          name: page
          description: Paginated page number.
        - schema:
            type: array
            items:
              type: string
              enum:
                - unscheduled
                - scheduled
                - in_progress
                - completed
                - canceled
          in: query
          name: work_status
          description: Work status filter. Returns jobs from all statuses if empty.
        - schema:
            type: number
            default: 10
          in: query
          name: page_size
          description: Number of jobs returned per page.
        - schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
          in: query
          name: sort_direction
        - schema:
            type: array
            items:
              type: string
          in: query
          name: location_ids
          description: 'Id of locations you want to pull from. * If X-Company-Id header is set, location_ids will be ignored'
        - schema:
            type: array
            enum:
              - attachments
              - appointments
          in: query
          name: expand
          description: Array of strings to expand response body
        - schema:
            type: string
            enum:
              - created_at
              - updated_at
              - invoice_number
              - id
              - description
              - work_status
            default: created_at
          in: query
          name: sort_by
          description: Attribute to sort by
    parameters: []
    post:
      summary: Create a Job
      operationId: post-jobs
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Job'
      description: |
        Create a job with the ID for an already existing address and customer.  If you decide to use the price form to generate the line item, fill in its fields and options (if applicable) here using the UUIDs you retrieved from the GET price form endpoint. When using pricing forms, the unit_price is automatically calculated based on the fields and options selected.
      tags:
        - Jobs
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JobCreate'
  '/jobs/{id}':
    parameters:
      - schema:
          type: string
        name: id
        in: path
        required: true
        description: |
          The ID of the job
    get:
      summary: Get a Job
      tags:
        - Jobs
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Job'
            application/xml:
              schema:
                $ref: '#/components/schemas/Job'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties: {}
            application/xml:
              schema:
                type: object
                properties:
                  '':
                    type: string
      operationId: get-jobs-id
      description: Get a job by ID.
      parameters:
        - schema:
            type: array
            enum:
              - attachments
              - appointments
          in: query
          name: expand
          description: Array of strings to expand response body
  '/jobs/{job_id}/attachments':
    parameters:
      - schema:
          type: string
        name: job_id
        in: path
        required: true
    post:
      summary: Add an Attachment to a Job
      operationId: post-jobs-job_id-attachments
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                type: object
                properties:
                  job_url:
                    type: string
                    x-stoplight:
                      id: aw85jjtybxzl4
      description: Add an attachment to a job.
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: A binary file from your local machine
              required:
                - file
        description: Attachments can be uploaded to a job via a file.
      tags:
        - Jobs
  '/jobs/{job_id}/line_items':
    parameters:
      - schema:
          type: string
        name: job_id
        in: path
        required: true
    get:
      summary: Lists all line items for a job
      operationId: get-jobs-job_id-line-items
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/LineItemResponse'
      description: Lists all line items for a job
      tags:
        - Jobs
    post:
      summary: Add a line item to a Job
      operationId: post-jobs-job_id-line-items
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LineItemResponse'
      description: Add a line item to a job. This is a rate limited request. If you intend to create multiple line items for the same job use Bulk update a job's line items request.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JobLineItemCreate'
      tags:
        - Jobs
  '/jobs/{job_id}/line_items/bulk_update':
    parameters:
      - schema:
          type: string
        name: job_id
        in: path
        required: true
    put:
      summary: Bulk update a job's line items
      operationId: put-jobs-job_id-line-items
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/LineItemResponse'
      description: Bulk update a job's line items. If uuid not define for a line item it will be consider as a new line item for the job.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                line_items:
                  type: array
                  items:
                    $ref: '#/components/schemas/BulkLineItemUpdate'
                append_line_items:
                  type: boolean
                  description: 'Append line item to the job, if true existing line items not defined in the request body will not be deleted.'
                  default: false
      tags:
        - Jobs
  '/jobs/{job_id}/line_items/{id}':
    parameters:
      - schema:
          type: string
        name: job_id
        in: path
        required: true
      - schema:
          type: string
        name: id
        in: path
        required: true
    put:
      summary: Update a single line item for a job
      operationId: update-job-line-item
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LineItemResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: All errors formatted in a sentence
                  attr1:
                    type: string
                    description: 'Error message for field attr1, where attr1 would be one of the attributes for line item'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
                properties: {}
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LineItem'
      tags:
        - Jobs
    delete:
      summary: Delete a single line item for a job
      operationId: delete-job-line-item
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LineItemDeletedResponse'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
                properties: {}
      tags:
        - Jobs
  '/jobs/{job_id}/appointments':
    parameters:
      - schema:
          type: string
        name: job_id
        in: path
        required: true
    get:
      summary: Get Appointments
      tags:
        - Job Appointments
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  appointments:
                    type: array
                    items:
                      $ref: '#/components/schemas/Appointment'
      operationId: get-jobs-job_id-appointments
      description: Get all of the appointments for a job
      security:
        - Company API Key: []
        - Housecall User OAuth Token: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
    post:
      summary: Create appointment
      operationId: post-jobs-job_id-appointments
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Appointment'
      description: Add an appointment to a job.
      security:
        - Company API Key: []
        - Housecall User OAuth Token: []
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/CreateAppointment'
      tags:
        - Job Appointments
  '/jobs/{job_id}/appointments/{appointment_id}':
    parameters:
      - schema:
          type: string
        name: job_id
        in: path
        required: true
      - schema:
          type: string
        name: appointment_id
        in: path
        required: true
    put:
      summary: Update Appointment
      tags:
        - Job Appointments
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Appointment'
      operationId: update-jobs-job_id-appointments
      description: Update job appointment
      security:
        - Company API Key: []
        - Housecall User OAuth Token: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAppointment'
    delete:
      summary: Delete appointment
      operationId: delete-jobs-job_id-appointments
      responses:
        '200':
          description: OK
      description: Delete a job appointment.
      security:
        - Company API Key: []
        - Housecall User OAuth Token: []
      requestBody:
        content:
          application/json:
            schema:
              allOf: []
      tags:
        - Job Appointments
  '/jobs/{job_id}/schedule':
    parameters:
      - schema:
          type: string
        name: job_id
        in: path
        required: true
    put:
      summary: Update job schedule
      operationId: update-job-schedule
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                x-examples:
                  example-1:
                    start_time: '2019-03-27T15:08:08Z'
                    end_time: '2019-03-27T15:08:08Z'
                    arrival_window_minutes: 60
                    assigned_employees:
                      - id: string
                        avatar_url: string
                        color_hex: string
                        first_name: string
                        last_name: string
                        email: string
                        mobile_number: string
                        role: field tech
                        permissions:
                          can_add_and_edit_job: boolean
                          can_be_booked_online: boolean
                          can_call_and_text_with_customers: boolean
                          can_chat_with_customers: boolean
                          can_delete_and_cancel_job: boolean
                          can_edit_message_on_invoice: boolean
                          can_see_street_view_data: boolean
                          can_share_job: boolean
                          can_take_payment_see_prices: boolean
                          can_see_customers: boolean
                          can_see_full_schedule: boolean
                          can_see_future_jobs: boolean
                          can_see_marketing_campaigns: boolean
                          can_see_reporting: boolean
                          can_edit_settings: boolean
                          is_point_of_contact: boolean
                          is_admin: boolean
                properties:
                  start_time:
                    type: string
                    minLength: 1
                  end_time:
                    type: string
                    minLength: 1
                  arrival_window_minutes:
                    type: number
                  assigned_employees:
                    type: array
                    items:
                      $ref: '#/components/schemas/Employee'
                  appointments:
                    type: array
                    items:
                      $ref: '#/components/schemas/Appointment'
                required:
                  - start_time
                  - end_time
                  - arrival_window_minutes
              examples:
                example:
                  value:
                    start_time: '2021-01-10T20:45:00'
                    end_time: '2021-01-10T21:45:00'
                    arrival_window_minutes: 60
                    assigned_employees:
                      - id: string
                        avatar_url: string
                        color_hex: string
                        first_name: string
                        last_name: string
                        email: string
                        mobile_number: string
                        role: field tech
                        permissions:
                          can_add_and_edit_job: boolean
                          can_be_booked_online: boolean
                          can_call_and_text_with_customers: boolean
                          can_chat_with_customers: boolean
                          can_delete_and_cancel_job: boolean
                          can_edit_message_on_invoice: boolean
                          can_see_street_view_data: boolean
                          can_share_job: boolean
                          can_take_payment_see_prices: boolean
                          can_see_customers: boolean
                          can_see_full_schedule: boolean
                          can_see_future_jobs: boolean
                          can_see_marketing_campaigns: boolean
                          can_see_reporting: boolean
                          can_edit_settings: boolean
                          is_point_of_contact: boolean
                          is_admin: boolean
      requestBody:
        content:
          application/json:
            schema:
              type: object
              x-examples:
                example-1:
                  start_time: '2021-06-10T19:43:05'
                  end_time: '2021-06-10T20:43:05'
                  arrival_window_in_minutes: 60
                  notify: true
                  notify_pro: true
                  expand:
                    - assigned_employees
                  dispatched_employees:
                    - employee_id: string
              properties:
                start_time:
                  type: string
                  minLength: 1
                  format: date-time
                  example: '2021-01-10T10:45:00'
                  description: Start time of job in iso8601
                end_time:
                  type: string
                  minLength: 1
                  format: date-time
                  example: '2021-01-10T11:45:00'
                  description: End time of job in iso8601
                arrival_window_in_minutes:
                  type: number
                  description: Integer value in minutes of arrival window
                notify:
                  type: boolean
                  description: Notify the customer of the update schedule
                notify_pro:
                  type: boolean
                  description: Notify the employee of the update schedule
                expand:
                  type: array
                  items:
                    type: string
                dispatched_employees:
                  type: array
                  minLength: 0
                  items:
                    $ref: '#/components/schemas/DispatchedEmployee'
              required:
                - start_time
            examples:
              example:
                value:
                  start_time: '2021-01-10T20:45:00'
                  end_time: '2021-01-10T21:45:00'
                  arrival_window_in_minutes: 60
                  notify: true
                  notify_pro: true
                  expand:
                    - assigned_employees
                  dispatched_employees:
                    - employee_id: string
      description: 'Update a jobs schedule. Jobs with multi days feature containing more than 1 appointment can''t be updated through this endpoint, must use appointments endpoints.'
      parameters: []
      security:
        - Application API Key: []
        - Housecall User OAuth Token: []
      tags:
        - Jobs
    delete:
      summary: Delete job schedule
      operationId: delete-job-schedule
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                description: ''
                type: object
                x-examples:
                  example-1:
                    object: schedule
                    deleted: true
                properties:
                  object:
                    type: string
                    minLength: 1
                  deleted:
                    type: boolean
                required:
                  - object
                  - deleted
              examples:
                example:
                  value:
                    object: schedule
                    deleted: true
      description: Erase schedule on a job
      security:
        - Application API Key: []
        - Housecall User OAuth Token: []
      tags:
        - Jobs
  '/jobs/{job_id}/dispatch':
    parameters:
      - schema:
          type: string
        name: job_id
        in: path
        required: true
    put:
      summary: Dispatch job to employees
      operationId: update-job-dispatch
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                description: ''
                type: object
                x-examples:
                  example-1:
                    assigned_employees:
                      - id: string
                        avatar_url: string
                        color_hex: string
                        first_name: string
                        last_name: string
                        email: string
                        mobile_number: string
                        role: field tech
                        permissions:
                          can_add_and_edit_job: boolean
                          can_be_booked_online: boolean
                          can_call_and_text_with_customers: boolean
                          can_chat_with_customers: boolean
                          can_delete_and_cancel_job: boolean
                          can_edit_message_on_invoice: boolean
                          can_see_street_view_data: boolean
                          can_share_job: boolean
                          can_take_payment_see_prices: boolean
                          can_see_customers: boolean
                          can_see_full_schedule: boolean
                          can_see_future_jobs: boolean
                          can_see_marketing_campaigns: boolean
                          can_see_reporting: boolean
                          can_edit_settings: boolean
                          is_point_of_contact: boolean
                          is_admin: boolean
                properties:
                  assigned_employees:
                    type: array
                    items:
                      $ref: '#/components/schemas/Employee'
              examples:
                example:
                  value:
                    assigned_employees:
                      - id: string
                        avatar_url: string
                        color_hex: string
                        first_name: string
                        last_name: string
                        email: string
                        mobile_number: string
                        role: field tech
                        permissions:
                          can_add_and_edit_job: boolean
                          can_be_booked_online: boolean
                          can_call_and_text_with_customers: boolean
                          can_chat_with_customers: boolean
                          can_delete_and_cancel_job: boolean
                          can_edit_message_on_invoice: boolean
                          can_see_street_view_data: boolean
                          can_share_job: boolean
                          can_take_payment_see_prices: boolean
                          can_see_customers: boolean
                          can_see_full_schedule: boolean
                          can_see_future_jobs: boolean
                          can_see_marketing_campaigns: boolean
                          can_see_reporting: boolean
                          can_edit_settings: boolean
                          is_point_of_contact: boolean
                          is_admin: boolean
      requestBody:
        content:
          application/json:
            schema:
              description: ''
              type: object
              x-examples:
                example-1:
                  dispatched_employees:
                    - employee_id: string
              properties:
                dispatched_employees:
                  type: array
                  minLength: 0
                  items:
                    $ref: '#/components/schemas/DispatchedEmployee'
              required:
                - dispatched_employees
            examples:
              example:
                value:
                  dispatched_employees:
                    - employee_id: string
      description: Dispatch job to employees
      parameters: []
      security:
        - Application API Key: []
        - Housecall User OAuth Token: []
      tags:
        - Jobs
  '/jobs/{job_id}/invoices':
    parameters:
      - schema:
          type: string
        name: job_id
        in: path
        required: true
    get:
      summary: Get Job Invoices
      tags:
        - Job Invoices
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  invoices:
                    type: array
                    x-stoplight:
                      id: 4teygisrbwllt
                    items:
                      $ref: '#/components/schemas/JobInvoice'
      operationId: get-jobs-job_id-invoices
      description: Lists all invoices for a job.
  '/jobs/{job_id}/job_input_materials':
    parameters:
      - schema:
          type: string
        name: job_id
        in: path
        required: true
    get:
      summary: Lists all job input materials for a job
      tags:
        - Jobs
      operationId: get-jobs-job_id-job-input-materials
      description: Lists all job input materials for a job
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                type: object
                properties:
                  job_input_materials:
                    type: array
                    items:
                      $ref: '#/components/schemas/JobInputMaterial'
  '/jobs/{job_id}/job_input_materials/bulk_update':
    parameters:
      - schema:
          type: string
        name: job_id
        in: path
        required: true
    put:
      summary: Bulk update a job's input materials
      tags:
        - Jobs
      operationId: put-jobs-job_id-job-input-materials
      description: Bulk update a job's job inputs materials. If uuid not define for a job input material it will be consider as a new entry.
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                type: object
                properties:
                  job_input_materials:
                    type: array
                    items:
                      $ref: '#/components/schemas/JobInputMaterial'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                job_input_materials:
                  type: array
                  items:
                    $ref: '#/components/schemas/JobInputMaterial'
  '/jobs/{job_id}/tags':
    parameters:
      - schema:
          type: string
        name: job_id
        in: path
        required: true
    post:
      summary: Add job tag
      operationId: post-jobs-job_id-tags
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  tags:
                    type: array
                    items:
                      $ref: '#/components/schemas/Tag'
              examples:
                example-1:
                  value:
                    tags:
                      - id: string
                        name: string
      tags:
        - Jobs
      description: Add a tag to a job.
      security:
        - Company API Key: []
        - Application API Key: []
        - Housecall User OAuth Token: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                tag_id:
                  type: string
              required:
                - tag_id
            examples:
              example-1:
                value:
                  tag_id: string
  '/jobs/{job_id}/notes':
    parameters:
      - schema:
          type: string
        name: job_id
        in: path
        required: true
    post:
      summary: Add job note
      operationId: post-jobs-job_id-notes
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Note'
              examples: {}
      tags:
        - Jobs
      description: Add a note to a job.
      security:
        - Company API Key: []
        - Application API Key: []
        - Housecall User OAuth Token: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                content:
                  type: string
              required:
                - content
            examples: {}
        description: ''
  '/jobs/{job_id}/notes/{note_id}':
    parameters:
      - schema:
          type: string
        name: job_id
        in: path
        required: true
      - schema:
          type: string
        name: note_id
        in: path
        required: true
    delete:
      summary: Delete job note
      operationId: delete-jobs-job_id-notes
      responses:
        '200':
          description: OK
      description: Deletes a specific job note
      security:
        - Company API Key: []
        - Application API Key: []
        - Housecall User OAuth Token: []
      tags:
        - Jobs
  '/jobs/{job_id}/tags/{tag_id}':
    parameters:
      - schema:
          type: string
        name: job_id
        in: path
        required: true
      - schema:
          type: string
        name: tag_id
        in: path
        required: true
    delete:
      summary: Remove job tag
      operationId: delete-jobs-job_id-tags-tag_id
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  tags:
                    type: array
                    items:
                      $ref: '#/components/schemas/Tag'
              examples:
                example-1:
                  value:
                    tags:
                      - id: string
                        name: string
      description: Remove a tag from a job
      security:
        - Company API Key: []
        - Application API Key: []
        - Housecall User OAuth Token: []
      tags:
        - Jobs
  '/jobs/{job_id}/links':
    parameters:
      - schema:
          type: string
        name: job_id
        in: path
        required: true
    post:
      summary: Create Job Link
      operationId: create-job-link
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobLink'
      description: Create a new Job link
      security:
        - Application API Key: []
        - Housecall User OAuth Token: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JobLinkCreate'
      tags:
        - Jobs
  '/jobs/{job_id}/lock':
    parameters:
      - schema:
          type: string
        name: job_id
        in: path
        required: true
    post:
      summary: Lock Job
      operationId: lock-job
      responses:
        '200':
          description: Job was locked successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Job'
        '404':
          description: The specified resource was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                JobNotFound:
                  summary: Example of a job not being found
                  value:
                    error:
                      message: job not found
      description: Lock the Job identified by the given `job_id`
      security:
        - Application API Key: []
        - Housecall User OAuth Token: []
      tags:
        - Jobs
  /jobs/lock:
    post:
      summary: Lock Jobs
      operationId: lock-jobs
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  jobs:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        locked_at:
                          type: string
                          format: date-time
                      required:
                        - id
                        - locked_at
        '422':
          description: 'Validation failed (e.g. `statuses` missing or empty, or an invalid status value was sent)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                MissingStatuses:
                  summary: Example of statuses not being provided
                  value:
                    error:
                      message: statuses is required
      description: Lock Jobs by time range and status. A job is locked when its schedule start (`start`) OR completion time (`completed_at`) falls within the `starting_at`/`ending_at` range for one of the requested `statuses`. The `statuses` array is required.
      security:
        - Application API Key: []
        - Housecall User OAuth Token: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LockJobsByTimeRangeRequest'
      tags:
        - Jobs
  /webhooks/subscription:
    post:
      summary: Create a Webhook Subscription
      operationId: post-webhooks-subscribe
      responses:
        '200':
          description: OK
      description: 'Webhooks are disabled by default and need to be subscribed for each company individually. Once subscribed, you will begin to receive events for the company on your webhook endpoint.'
      requestBody:
        content:
          application/json:
            schema:
              type: object
      tags:
        - Webhooks
    delete:
      summary: Delete a Webhook Subscription
      operationId: delete-webhooks-subscribe
      responses:
        '200':
          description: OK
      description: Delete a company's webhook subciption to stop receiving events for that company.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties: {}
          application/xml:
            schema:
              type: object
              properties: {}
      tags:
        - Webhooks
    parameters: []
  /estimates:
    get:
      summary: Get Estimates
      tags:
        - Estimates
      responses:
        '200':
          description: OK
          headers: {}
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedList'
                  - type: object
                    properties:
                      estimates:
                        type: array
                        items:
                          $ref: '#/components/schemas/Estimate'
      operationId: get-estimates
      description: Get a list of estimates
      parameters:
        - schema:
            type: string
          in: query
          name: scheduled_start_min
          description: Filters estimates with a starting time greater than or equal to the date sent.
        - schema:
            type: string
          in: query
          name: scheduled_start_max
          description: Filters estimates with a starting time less than or equal to the date sent.
        - schema:
            type: string
          in: query
          name: scheduled_end_min
          description: Filters estimates with an end time greater than or equal to the date sent.
        - schema:
            type: string
          in: query
          name: scheduled_end_max
          description: Filters estimates with an end time less than or equal to the date sent.
        - schema:
            type: array
          in: query
          name: employee_ids
          description: Filters estimates by assigned pro id
        - schema:
            type: string
          in: query
          name: customer_id
          description: Filters estimates by a single customer ID (string)
        - schema:
            type: string
            default: '1'
          in: query
          name: page
          description: Paginated page number.
        - schema:
            type: array
            items:
              type: string
              enum:
                - unscheduled
                - scheduled
                - in_progress
                - completed
                - canceled
          in: query
          name: work_status
          description: Work status filter. Returns estimates from all statuses if empty.
        - schema:
            type: number
            default: 10
          in: query
          name: page_size
          description: Number of estimates returned per page.
        - schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
          in: query
          name: sort_direction
          description: Order of estimates returned.
        - schema:
            type: array
            items:
              type: string
          in: query
          name: location_ids
          description: 'Id of locations you want to pull from. * If X-Company-Id header is set, location_ids will be ignored'
        - schema:
            type: array
            enum:
              - attachments
          in: query
          name: expand
          description: Array of strings to expand response body
        - schema:
            type: string
            enum:
              - created_at
              - updated_at
              - id
            default: created_at
          in: query
          name: sort_by
          description: Attribute to sort by
    parameters: []
    post:
      summary: Create an estimate
      operationId: post-estimates
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Estimate'
      description: Create an estimate
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EstimateCreate'
          application/xml:
            schema:
              $ref: '#/components/schemas/EstimateCreate'
            examples: {}
        description: ''
      tags:
        - Estimates
  '/estimates/{estimate_id}':
    parameters:
      - schema:
          type: string
        name: estimate_id
        in: path
        required: true
    get:
      summary: Get a single estimate by ID
      tags:
        - Estimates
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Estimate'
      security:
        - Application API Key: []
        - Housecall User OAuth Token: []
      parameters:
        - schema:
            type: array
            enum:
              - attachments
          in: query
          name: expand
          description: Array of strings to expand response body
  '/estimates/{estimate_id}/options':
    parameters:
      - schema:
          type: string
        name: estimate_id
        in: path
        required: true
        description: The UUID of the estimate
    post:
      summary: Create an estimate option
      operationId: post-estimates-estimate_id-options
      description: Create a new option on an existing estimate.
      tags:
        - Estimates
      security:
        - Company API Key: []
        - Application API Key: []
        - Housecall User OAuth Token: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EstimateOptionCreate'
            example:
              name: Option A
              line_items:
                - name: Labor
                  description: Standard service labor
                  unit_price: 10000
                  unit_cost: 5000
                  quantity: 2
                  taxable: true
              tax:
                taxable: true
                tax_rate: 0.0825
                tax_name: Sales Tax
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EstimateOption'
        '401':
          description: Unauthorized
        '404':
          description: Estimate not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      message:
                        type: string
              example:
                error:
                  message: Estimate not found
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: object
                    additionalProperties:
                      type: array
                      items:
                        type: string
              example:
                errors:
                  name:
                    - is missing
  '/estimates/{estimate_id}/options/{option_id}/attachments':
    parameters:
      - schema:
          type: string
        name: estimate_id
        in: path
        required: true
      - schema:
          type: string
        name: option_id
        in: path
        required: true
    post:
      summary: Create Estimate option attachment
      operationId: create-estimate-option-attachment
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                type: object
                properties:
                  estimate_url:
                    type: string
                    x-stoplight:
                      id: hi35633qwmfgv
      description: Create a new estimate option attachment
      security:
        - Company API Key: []
        - Housecall User OAuth Token: []
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: A binary file from your local machine
              required:
                - file
        description: Attachments can be uploaded to an estimate via a file.
      tags:
        - Estimates
        - Options
  '/estimates/{estimate_id}/options/{option_id}/line_items':
    parameters:
      - schema:
          type: string
        name: estimate_id
        in: path
        required: true
      - schema:
          type: string
        name: option_id
        in: path
        required: true
      - schema:
          type: string
          default: '1'
        in: query
        name: page
        description: Paginated page number.
      - schema:
          type: number
          default: 10
        in: query
        name: page_size
        description: Number of line items returned per page.
    get:
      summary: List estimate option line items
      operationId: get-estimate-option-line-items
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedList'
                  - type: object
                    properties:
                      line_items:
                        type: array
                        items:
                          $ref: '#/components/schemas/LineItemResponse'
      description: Get estimate option line items
      security:
        - Housecall User OAuth Token: []
        - Company API Key: []
      tags:
        - Estimates
  '/estimates/{estimate_id}/options/{option_id}/line_items/bulk_update':
    parameters:
      - schema:
          type: string
        name: estimate_id
        in: path
        required: true
      - schema:
          type: string
        name: option_id
        in: path
        required: true
    put:
      summary: Bulk update estimate option line items
      operationId: put-estimate-option-line-items-bulk-update
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  line_items:
                    type: array
                    items:
                      $ref: '#/components/schemas/LineItemResponse'
      description: Bulk update line items for an estimate option. If id is not defined for a line item it will be considered as a new line item for the option. Multiple line items can be updated in a single request.
      security:
        - Housecall User OAuth Token: []
        - Company API Key: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                line_items:
                  type: array
                  items:
                    $ref: '#/components/schemas/BulkLineItemUpdate'
      tags:
        - Estimates
  '/estimates/{estimate_id}/options/{option_id}/links':
    parameters:
      - schema:
          type: string
        name: estimate_id
        in: path
        required: true
      - schema:
          type: string
        name: option_id
        in: path
        required: true
    post:
      summary: Create Estimate option link
      operationId: create-estimate-option-link
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobLink'
      description: Create a new estimate option link
      security:
        - Company API Key: []
        - Housecall User OAuth Token: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JobLinkCreate'
      tags:
        - Estimates
  '/estimates/{estimate_id}/options/{option_id}/schedule':
    parameters:
      - schema:
          type: string
        name: estimate_id
        in: path
        required: true
      - schema:
          type: string
        name: option_id
        in: path
        required: true
    put:
      summary: Update estimate option schedule
      operationId: put-estimates-estimate_id-options-option_id-schedule
      description: Update an estimate option schedule.
      security:
        - Company API Key: []
        - Housecall User OAuth Token: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                start_time:
                  type: string
                  format: date-time
                  description: Start time of estimate in iso8601
                end_time:
                  type: string
                  format: date-time
                  description: End time of estimate in iso8601
                arrival_window_in_minutes:
                  type: number
                  description: Integer value in minutes of arrival window
                notify:
                  type: boolean
                  description: Notify the customer of the update schedule
                notify_pro:
                  type: boolean
                  description: Notify the employee of the update schedule
                expand:
                  type: array
                  items:
                    type: string
                dispatched_employees:
                  type: array
                  items:
                    allOf:
                      - properties:
                          employee_id:
                            type: string
                    type: object
              required:
                - start_time
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  start_time:
                    type: string
                  end_time:
                    type: string
                  arrival_window_minutes:
                    type: number
                  assigned_employees:
                    type: array
                    items:
                      $ref: '#/components/schemas/Employee'
      tags:
        - Estimates
  '/estimates/{estimate_id}/options/{option_id}/notes':
    parameters:
      - schema:
          type: string
        name: estimate_id
        in: path
        required: true
      - schema:
          type: string
        name: option_id
        in: path
        required: true
    post:
      summary: Create Estimate option note
      operationId: create-estimate-option-note
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Note'
      description: Create a new estimate option note
      security:
        - Housecall User OAuth Token: []
        - Company API Key: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                content:
                  type: string
              required:
                - content
      tags:
        - Estimates
  '/estimates/{estimate_id}/options/{option_id}/notes/{note_id}':
    parameters:
      - schema:
          type: string
        name: estimate_id
        in: path
        required: true
      - schema:
          type: string
        name: option_id
        in: path
        required: true
      - schema:
          type: string
        name: note_id
        in: path
        required: true
    delete:
      summary: Delete estimate option note
      operationId: delete-estimates-estimate_id-options-option_id-notes
      responses:
        '200':
          description: OK
      tags:
        - Estimates
      description: Delete a specific estimate option note
      security:
        - Company API Key: []
        - Housecall User OAuth Token: []
  /estimates/options/decline:
    post:
      summary: Decline estimate options
      operationId: post-estimates-options-decline
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                  last_updated_at:
                    type: string
      description: Update estimate options approval status to Pro declined.
      security:
        - Housecall User OAuth Token: []
        - Company API Key: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                option_ids:
                  type: array
                  items:
                    type: string
              required:
                - option_ids
      tags:
        - Estimates
  /estimates/options/approve:
    post:
      summary: Approve estimate options
      operationId: post-estimates-options-approve
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                  last_updated_at:
                    type: string
                  copied_on_approval_to_job_id:
                    type: string
      description: 'Update estimate options approval status to Pro approved. If company has "Automatically copy an approved estimate to a new job" turned on, all approved estimate options will be copied to a single job.'
      security:
        - Housecall User OAuth Token: []
        - Company API Key: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                option_ids:
                  type: array
                  items:
                    type: string
              required:
                - option_ids
      tags:
        - Estimates
  /company:
    get:
      summary: Get Company
      tags:
        - Company
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Company'
      operationId: get-company
      security:
        - Company API Key: []
        - Application API Key: []
        - Housecall User OAuth Token: []
      description: Get general company information
  /company/franchise_info:
    patch:
      summary: Update Franchise Info
      tags:
        - Company
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Company'
              examples:
                example-1:
                  value:
                    id: uuid
                    franchise_info:
                      root_franchisor_id: uuid
                      franchisor_depth: 2
                      metadata:
                        territory_management:
                          franchise_id: 'FRAN123,FRAN456'
                          franchise_ids:
                            - FRAN123
                            - FRAN456
                        franchisee_identifier: FRAN-001
                        external:
                          custom-key: with-some-value
                          other-key: 123
      operationId: patch-company-franchise-info
      security:
        - Company API Key: []
        - Application API Key: []
        - Housecall User OAuth Token: []
      description: Update organization franchise information
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateFranchiseInfo'
            examples:
              example-1:
                value:
                  metadata:
                    territory_management:
                      franchise_id: 'FRAN123,FRAN456'
                    franchisee_identifier: FRAN-001
                    external:
                      custom-key: with-some-value
                      other-key: 123
  /company/schedule_availability:
    get:
      summary: Schedule Windows
      tags:
        - Schedule
      operationId: get-company-schedule-availability
      security:
        - Company API Key: []
        - Application API Key: []
        - Housecall User OAuth Token: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompleteScheduleAvailability'
      description: See how an organization has configured their business hours and bookable windows.
    put:
      summary: Update a company's schedule windows
      tags:
        - Schedule
      operationId: update-company-schedule-availability
      security:
        - Company API Key: []
        - Application API Key: []
        - Housecall User OAuth Token: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCompleteScheduleAvailability'
            examples:
              Example 1:
                value:
                  availability_buffer_in_days: 0
                  daily_schedule_windows:
                    - day_name: string
                      schedule_windows:
                        - start_time: string
                          end_time: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompleteScheduleAvailability'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: All errors formatted in a sentence
                  attr1:
                    type: string
                    description: 'Error message for field attr1, where attr1 would be one of the attributes for the schedule availability object'
  /company/schedule_availability/booking_windows:
    get:
      summary: Booking Windows
      tags:
        - Schedule
      operationId: get-company-schedule-booking-windows-availability
      security:
        - Company API Key: []
        - Application API Key: []
        - Housecall User OAuth Token: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookingWindows'
              examples:
                example-1:
                  value:
                    booking_windows:
                      - start_time: string
                        end_time: string
                        available: true
                    show_for_days: 0
                    start_date: string
      description: |
        Returns available windows to book a job or estimate for a given time range (default 7 days). Availability is based on the organization's Online Booking settings and actual open time slots per employee.

        **Window duration** (used to compute each availability window):
        - **service_duration** (optional): When provided, must be a positive integer; it is used as the window size and overrides any duration from service_id.
        - **service_id only**: When only service_id is provided, the endpoint uses the service's configured duration (from Online Booking settings) for window size, and still filters by pros assigned to that service.
        - **Neither provided**: Defaults to 30 minutes for backward compatibility.

        Duration resolution order: `service_duration` → service's configured duration (when service_id given) → 30 minutes.
      parameters:
        - schema:
            type: integer
          in: query
          name: show_for_days
          description: An integer value that dictates how many days of the schedule should be shown; defaults to 7
        - schema:
            type: string
          in: query
          name: start_date
          description: 'A date string formatted like ''YYYY-MM-DDTHH:MM:SS''; defaults to the next day with an available booking window'
        - schema:
            type: string
          in: query
          name: service_id
          description: 'When provided, filters availability by pros assigned to this service and uses the service''s configured duration (Online Booking settings) for window size unless service_duration is also provided.'
        - schema:
            type: integer
            minimum: 1
          in: query
          name: service_duration
          description: 'Optional. When provided, must be a positive integer (minutes). Used to compute availability window size and overrides any duration from service_id.'
        - schema:
            type: string
          in: query
          name: price_form_id
          description: A string parameter used to look in the specific price form assigned pros booking availability
        - schema:
            type: array
            items:
              type: string
          in: query
          name: employee_ids
          description: An array of strings used to search on provided pros availability
  /events:
    get:
      summary: Get Events
      tags:
        - Events
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  page:
                    type: integer
                  page_size:
                    type: integer
                  total_pages:
                    type: integer
                  total_items:
                    type: integer
                  events:
                    type: array
                    items:
                      $ref: '#/components/schemas/Event'
              examples:
                example-1:
                  value:
                    page: 0
                    page_size: 0
                    total_pages: 0
                    total_items: 0
                    events:
                      - id: string
                        name: string
                        note: string
                        tags:
                          - string
                        recurrence_rule: string
                        address:
                          street: string
                          street_line_2: string
                          city: string
                          state: string
                          zip: string
                        assigned_employees:
                          id: string
                          avatar_url: string
                          color_hex: string
                          first_name: string
                          last_name: string
                          email: string
                          mobile_number: string
                          role: string
                          created_at: string
                          tags:
                            - string
                          permissions:
                            can_add_and_edit_job: true
                            can_be_booked_online: true
                            can_call_and_text_with_customers: true
                            can_chat_with_customers: true
                            can_delete_and_cancel_job: true
                            can_edit_message_on_invoice: true
                            can_see_street_view_data: true
                            can_share_job: true
                            can_take_payment_see_prices: true
                            can_see_customers: true
                            can_see_full_schedule: true
                            can_see_future_jobs: true
                            can_see_marketing_campaigns: true
                            can_see_reporting: true
                            can_edit_settings: true
                            is_point_of_contact: true
                            is_admin: true
                        schedule:
                          start_time: string
                          end_time: string
                          time_zone: string
                        all_day: true
                        created_at: string
                        updated_at: string
      operationId: get-events
      description: Get a list of events
      parameters:
        - schema:
            type: number
          in: query
          name: page
          description: Paginated page number
        - schema:
            type: number
          in: query
          name: page_size
          description: Number of events returned per page.
        - schema:
            type: string
            default: created_at
            enum:
              - name
              - note
              - created_at
              - updated_at
              - street
              - street_line_2
              - city
              - state
              - zip
          in: query
          name: sort_by
          description: Event attribute to sort by
        - schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
          in: query
          name: sort_direction
          description: Ascending or descending
        - schema:
            type: array
            items:
              type: string
          in: query
          name: location_ids
          description: 'Id of locations you want to pull from. * If X-Company-Id header is set, location_ids will be ignored'
      security:
        - Company API Key: []
        - Application API Key: []
        - Housecall User OAuth Token: []
  '/events/{event_id}':
    parameters:
      - schema:
          type: string
        name: event_id
        in: path
        required: true
    get:
      summary: Get the event via ID.
      tags:
        - Events
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Event'
              examples:
                example-1:
                  value:
                    id: string
                    name: string
                    note: string
                    tags:
                      - string
                    recurrence_rule: string
                    address:
                      street: string
                      street_line_2: string
                      city: string
                      state: string
                      zip: string
                    assigned_employees:
                      id: string
                      avatar_url: string
                      color_hex: string
                      first_name: string
                      last_name: string
                      email: string
                      mobile_number: string
                      role: string
                      created_at: string
                      tags:
                        - string
                      permissions:
                        can_add_and_edit_job: true
                        can_be_booked_online: true
                        can_call_and_text_with_customers: true
                        can_chat_with_customers: true
                        can_delete_and_cancel_job: true
                        can_edit_message_on_invoice: true
                        can_see_street_view_data: true
                        can_share_job: true
                        can_take_payment_see_prices: true
                        can_see_customers: true
                        can_see_full_schedule: true
                        can_see_future_jobs: true
                        can_see_marketing_campaigns: true
                        can_see_reporting: true
                        can_edit_settings: true
                        is_point_of_contact: true
                        is_admin: true
                    schedule:
                      start_time: string
                      end_time: string
                      time_zone: string
                    all_day: true
                    created_at: string
                    updated_at: string
      operationId: get-events-event_id
      description: Get the event via ID.
      security:
        - Company API Key: []
        - Application API Key: []
        - Housecall User OAuth Token: []
  /tags:
    get:
      summary: Get tags
      tags:
        - Tags
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedList'
                  - type: object
                    properties:
                      tags:
                        type: array
                        items:
                          $ref: '#/components/schemas/Tag'
              examples:
                example-1:
                  value:
                    page: 0
                    page_size: 0
                    total_pages: 0
                    total_items: 0
                    tags:
                      - id: string
                        name: string
      operationId: get-tags
      description: Get a list of tags
      security:
        - Company API Key: []
        - Application API Key: []
        - Housecall User OAuth Token: []
      parameters:
        - schema:
            type: number
            default: 1
          in: query
          name: page
          description: Current Page
        - schema:
            type: number
            default: 10
          in: query
          name: page_size
          description: Number of tags per page
        - schema:
            type: string
            default: created_at
            enum:
              - created_at
              - name
          in: query
          name: sort_by
          description: Tag attribute to sort by
        - schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
          in: query
          name: sort_direction
    post:
      summary: Create a tag
      operationId: post-tags
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tag'
      tags:
        - Tags
      description: Create a tag
      security:
        - Company API Key: []
        - Application API Key: []
        - Housecall User OAuth Token: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
            examples:
              example-1:
                value:
                  name: string
  '/tags/{tag_id}':
    parameters:
      - schema:
          type: string
        name: tag_id
        in: path
        required: true
    put:
      summary: Update a tag
      operationId: put-tags-tag_id
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tag'
      tags:
        - Tags
      description: Update a tag value
      security:
        - Company API Key: []
        - Application API Key: []
        - Housecall User OAuth Token: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
            examples:
              example-1:
                value:
                  name: string
  /leads:
    post:
      summary: Create Lead
      operationId: post-leads
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Lead'
      description: Create a lead with the ID for an already existing customer.
      security:
        - Company API Key: []
        - Application API Key: []
        - Housecall User OAuth Token: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LeadCreate'
      tags:
        - Leads
    get:
      summary: Get Leads
      operationId: get-leads
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedList'
                  - type: object
                    properties:
                      leads:
                        type: array
                        items:
                          $ref: '#/components/schemas/Lead'
      description: Get a list of leads
      parameters:
        - schema:
            type: array
          in: query
          name: employee_ids
          description: Filters leads by a list of employee IDs (string)
        - schema:
            type: string
          in: query
          name: customer_id
          description: Filters leads by a single customer ID (string)
        - schema:
            type: string
            default: '1'
          in: query
          name: page
          description: Paginated page number.
        - schema:
            type: string
            enum:
              - lost
              - open
              - won
          in: query
          name: status
          description: Filters leads by status
        - schema:
            type: number
            default: 10
          in: query
          name: page_size
          description: Number of jobs returned per page.
        - schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
          in: query
          name: sort_direction
        - schema:
            type: array
          in: query
          name: tag_ids
          description: Filters leads by a list of tags
        - schema:
            type: array
          in: query
          name: lead_source
          description: Filters leads by a single lead_source
        - schema:
            type: array
            uniqueItems: false
          in: query
          description: 'Id of locations you want to pull from. * If X-Company-Id header is set, location_ids will be ignored'
          name: location_ids
        - schema:
            type: string
            enum:
              - created_at
              - updated_at
              - id
              - status
            default: created_at
          in: query
          name: sort_by
          description: Attribute to sort by
      security:
        - Company API Key: []
        - Application API Key: []
        - Housecall User OAuth Token: []
      tags:
        - Leads
  '/leads/{id}':
    parameters:
      - schema:
          type: string
        name: id
        in: path
        required: true
    get:
      summary: Get Lead
      tags:
        - Leads
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Lead'
      operationId: get-leads-id
      description: Get the lead via ID.
      security:
        - Company API Key: []
        - Application API Key: []
        - Housecall User OAuth Token: []
  '/leads/{id}/convert':
    parameters:
      - schema:
          type: string
        name: id
        in: path
        required: true
    post:
      summary: Convert Lead to Estimate or Job
      tags:
        - Leads
      responses:
        '201':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  job_id:
                    type: string
                    description: Present only if the lead was converted to a job
                  estimate_id:
                    type: string
                    description: Present only if the lead was converted to an estimate
      operationId: put-leads-id-convert
      description: Converts a lead into an estimate or job.
      security:
        - Company API Key: []
        - Application API Key: []
        - Housecall User OAuth Token: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  description: The type to convert the lead to. Must be either "estimate" or "job".
                  example: estimate
                  enum:
                    - estimate
                    - job
  '/leads/{lead_id}/line_items':
    parameters:
      - schema:
          type: string
        name: lead_id
        in: path
        required: true
      - schema:
          type: number
          default: 1
        in: query
        name: page
      - schema:
          type: number
          default: 10
        in: query
        name: page_size
    get:
      summary: Lists all line items for a lead
      operationId: get-leads-lead_id-line-items
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedList'
                  - type: object
                    properties:
                      line_items:
                        type: array
                        items:
                          $ref: '#/components/schemas/LineItemResponse'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      message:
                        type: string
      description: Lists all line items for a lead
      tags:
        - Lead Line Items
  /lead_sources:
    get:
      summary: Get Lead Sources
      tags:
        - Lead Sources
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedList'
                  - type: object
                    properties:
                      lead_sources:
                        type: array
                        items:
                          $ref: '#/components/schemas/LeadSource'
      operationId: get-lead_sources
      description: Get a list of available lead sources.
      security:
        - Company API Key: []
        - Application API Key: []
        - Housecall User OAuth Token: []
      parameters:
        - schema:
            type: string
          in: query
          name: q
          description: A query that can be used to search for a lead source by name
        - schema:
            type: number
            default: 1
          in: query
          name: page
          description: Current Page
        - schema:
            type: number
            default: 10
          in: query
          name: page_size
          description: Number of lead sources per page
        - schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
          in: query
          name: sort_direction
          description: Ascending or descending
    post:
      summary: Create lead source
      operationId: post-lead_sources
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeadSource'
      description: Create a lead source
      tags:
        - Lead Sources
      security:
        - Company API Key: []
        - Application API Key: []
        - Housecall User OAuth Token: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
              required:
                - name
  '/lead_sources/{lead_source_id}':
    parameters:
      - schema:
          type: string
        name: lead_source_id
        in: path
        required: true
    put:
      summary: Update Lead Source
      operationId: put-lead_sources-lead_source_id
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeadSource'
      description: Update a specific lead source. Only lead sources marked as editable can be updated.
      security:
        - Company API Key: []
        - Application API Key: []
        - Housecall User OAuth Token: []
      tags:
        - Lead Sources
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
  /job_fields/job_types:
    get:
      summary: Get Job Types
      tags:
        - Job Types
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedList'
                  - type: object
                    properties:
                      job_types:
                        type: array
                        items:
                          $ref: '#/components/schemas/JobType'
      operationId: get-job_fields-job_types
      description: Get a list of job types
      security:
        - Company API Key: []
        - Housecall User OAuth Token: []
      parameters:
        - schema:
            type: string
          in: query
          name: name
          description: filter job types by name
    parameters: []
    post:
      summary: Create Job Type
      operationId: post-job_fields-job_types
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobType'
      description: create a job type
      security:
        - Company API Key: []
        - Housecall User OAuth Token: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
              required:
                - name
      tags:
        - Job Types
  '/job_fields/job_types/{job_type_id}':
    parameters:
      - schema:
          type: string
        name: job_type_id
        in: path
        required: true
    put:
      summary: Update a Job Type
      operationId: put-job_fields-job_types
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobType'
      description: Update a job type
      security:
        - Company API Key: []
        - Housecall User OAuth Token: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
              required:
                - name
      tags:
        - Job Types
  /invoices:
    get:
      summary: Get Invoices
      tags:
        - Invoices
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedList'
                  - type: object
                    x-stoplight:
                      id: 8vehf17tqgg8r
                    properties:
                      invoices:
                        type: array
                        x-stoplight:
                          id: prgk2z9jx3xcz
                        items:
                          allOf:
                            - $ref: '#/components/schemas/JobInvoice'
                            - type: object
                              x-stoplight:
                                id: 9yl2rmlsiui5y
                              properties:
                                job_id:
                                  type: string
                                  x-stoplight:
                                    id: p2cg7fh3jdpv0
      operationId: get-invoices
      description: Get a list of invoices.
      security:
        - Company API Key: []
        - Application API Key: []
        - Housecall User OAuth Token: []
      parameters:
        - schema:
            type: array
            items:
              type: string
          in: query
          name: location_ids
          description: 'Id of locations you want to pull from. * If X-Company-Id header is set, location_ids will be ignored'
        - schema:
            type: array
            example: open
            enum:
              - open
              - pending_payment
              - paid
              - voided
              - uncollectible
              - canceled
          in: query
          name: status
          description: Filters invoices by status.
        - schema:
            type: array
            example: cus_123
          in: query
          name: customer_uuid
          description: Filters invoices by customer UUIDs.
        - schema:
            type: string
            example: '2024-01-30T00:00:00Z'
          in: query
          name: created_at_min
          description: Filters invoices with a created_at greater than or equal to the input date
        - schema:
            type: string
            example: '2024-01-30T00:00:00Z'
          in: query
          name: created_at_max
          description: Filters invoices with a created_at less than or equal to the input date
        - schema:
            type: string
            example: '2024-01-30T00:00:00Z'
          in: query
          name: due_at_min
          description: Filters invoices with a due_at greater than or equal to the input date
        - schema:
            type: string
            example: '2024-01-30T00:00:00Z'
          in: query
          name: due_at_max
          description: Filters invoices with a due_at less than or equal to the input date
        - schema:
            type: string
            example: '2024-01-30T00:00:00Z'
          in: query
          name: paid_at_min
          description: Filters invoices with a paid_at greater than or equal to the input date
        - schema:
            type: string
            example: '2024-01-30T00:00:00Z'
          in: query
          name: paid_at_max
          description: Filters invoices with a paid_at less than or equal to the input date
        - schema:
            type: number
            example: '10'
          in: query
          name: amount_due_min
          description: Filters invoices with an amount_due greater than or equal to the input amount
        - schema:
            type: number
            example: '10'
          in: query
          name: amount_due_max
          description: Filters invoices with an amount_due less than or equal to the input amount
        - schema:
            type: array
            enum:
              - consumer_financing
              - credit_card
              - ach
              - external
              - mobile_check_deposit
            example: credit_card
          in: query
          name: payment_method
          description: Filters invoices by payment_method.
        - schema:
            type: integer
            default: 1
          in: query
          name: page
          description: Paginated page number.
        - schema:
            type: string
            default: '10'
          in: query
          name: page_size
          description: Number of invoices returned per page.
        - schema:
            type: string
            default: created_at
            enum:
              - amount
              - created_at
              - due_amount
              - due_at
              - invoice_number
              - paid_at
              - sent_at
              - status
              - updated_at
          in: query
          name: sort_by
        - schema:
            type: string
            default: desc
            enum:
              - asc
              - desc
          in: query
          name: sort_direction
  '/api/invoices/{uuid}':
    parameters:
      - schema:
          type: string
        name: uuid
        in: path
        required: true
        description: The UUID of the invoice to retrieve
    get:
      summary: Get Invoice by UUID
      tags:
        - Invoices
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/JobInvoice'
                  - type: object
                    x-stoplight:
                      id: invoice-by-uuid-response
                    properties:
                      job_id:
                        type: string
                        x-stoplight:
                          id: invoice-job-id
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
      operationId: get-invoice-by-uuid
      description: Retrieve a specific invoice by its UUID.
      security:
        - Company API Key: []
        - Application API Key: []
        - Housecall User OAuth Token: []
  '/api/invoices/{uuid}/preview':
    parameters:
      - schema:
          type: string
        name: uuid
        in: path
        required: true
        description: The UUID of the invoice to preview
    get:
      summary: Preview Invoice by UUID
      tags:
        - Invoices
      responses:
        '200':
          description: OK
          content:
            text/html:
              schema:
                type: string
                description: HTML content of the invoice preview
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
      operationId: get-invoice-preview-by-uuid
      description: Preview a specific invoice by its UUID as HTML.
      security:
        - Company API Key: []
        - Application API Key: []
        - Housecall User OAuth Token: []
  /api/price_book/materials:
    get:
      summary: Get Materials
      description: Get all price book materials under a parent category
      tags:
        - Materials
      security:
        - Company API Key: []
        - Housecall User OAuth Token: []
      operationId: index-materials
      parameters:
        - name: material_category_uuid
          in: query
          required: true
          schema:
            type: string
          description: UUID of the material category to fetch materials under
        - schema:
            type: number
            default: 1
          in: query
          name: page
          description: Paginated page number.
        - schema:
            type: number
            default: '10'
          in: query
          name: page_size
          description: Number of materials returned per page.
        - schema:
            type: string
            default: created_at
            enum:
              - name
              - updated_at
              - created_at
          in: query
          description: Material attribute to sort by
          name: sort_by
        - schema:
            type: string
            default: desc
            enum:
              - asc
              - desc
          in: query
          name: sort_direction
          description: Ascending or descending
      responses:
        '200':
          description: Materials fetched
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    description: list
                  page:
                    type: integer
                    description: page number of the paginated list
                  page_size:
                    type: integer
                    description: number of items per page
                  total_pages_count:
                    type: integer
                    description: number of pages of the whole document
                  total_count:
                    type: integer
                    description: total records count
                  data:
                    $ref: '#/components/schemas/Material'
                  url:
                    type: string
    post:
      summary: Create Material
      description: Create a new price book material
      tags:
        - Materials
      security:
        - Company API Key: []
        - Housecall User OAuth Token: []
      operationId: create-material
      parameters:
        - name: material_category_uuid
          in: query
          required: true
          schema:
            type: string
          description: UUID of the material category to create this material under
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - material_category_uuid
                - name
                - price
                - cost
              properties:
                material_category_uuid:
                  type: string
                  description: UUID of the material category to create this material under
                name:
                  type: string
                  description: name of the material to be created
                description:
                  type: string
                  description: description of the material to be created
                price:
                  type: integer
                  description: price of the material to be created in cents
                cost:
                  type: integer
                  description: cost of the material to be created in cents
                unit_of_measure:
                  type: string
                  description: unit of measure of the material to be created (i.e. each)
                part_number:
                  type: string
                  description: part number of the material to be created
                flat_rate_enabled:
                  type: boolean
                  default: false
                taxable:
                  type: boolean
                  description: if the material should be taxable on invoice
                  default: false
            examples:
              Create Material With Minimal Information:
                value:
                  material_category_uuid: pbmatcat_123
                  name: New Name
                  cost: 90
                  price: 120
      responses:
        '200':
          description: Material created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Material'
  '/api/price_book/materials/{uuid}':
    parameters:
      - name: uuid
        in: path
        required: true
        schema:
          type: string
        description: UUID of the material to be updated.
    put:
      summary: Update Material
      description: Update information of an existing price book material
      tags:
        - Materials
      security:
        - Company API Key: []
        - Housecall User OAuth Token: []
      operationId: update-material
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                description:
                  type: string
                price:
                  type: integer
                cost:
                  type: integer
                unit_of_measure:
                  type: string
                part_number:
                  type: string
                flat_rate_enabled:
                  type: boolean
                taxable:
                  type: boolean
            examples:
              Update Material Name:
                value:
                  name: New Name
              Update Material Description:
                value:
                  description: New Description
      responses:
        '200':
          description: Material updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Material'
        '404':
          description: Material Not Found
    delete:
      summary: Delete Material
      description: Delete an existing price book material
      tags:
        - Materials
      security:
        - Company API Key: []
        - Housecall User OAuth Token: []
      operationId: delete-material
      responses:
        '200':
          description: Material deleted
          content:
            application/json:
              schema:
                type: object
        '404':
          description: Material Not Found
  /api/price_book/material_categories:
    get:
      summary: Get Material Categories
      operationId: index-material-categories
      description: Get all price book material categories from root or under a parent category
      tags:
        - Material Categories
      security:
        - Company API Key: []
        - Housecall User OAuth Token: []
      parameters:
        - name: parent_uuid
          in: query
          required: false
          schema:
            type: string
          description: Including the UUID of a specific material category will fetch all material categories that reside under that category. Not including a UUID will fetch all root level categories.
        - schema:
            type: number
            default: 1
          in: query
          name: page
          description: Paginated page number.
        - schema:
            type: number
            default: 10
          in: query
          name: page_size
          description: Number of material categories returned per page.
        - schema:
            type: string
            enum:
              - name
              - updated_at
              - created_at
            default: created_at
          in: query
          name: sort_by
          description: Material category attribute to sort by
        - schema:
            type: string
            default: desc
            enum:
              - asc
              - desc
          in: query
          name: sort_direction
          description: Ascending or descending
      responses:
        '200':
          description: Material Categories Fetched
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: integer
                    description: list
                  page:
                    type: integer
                    description: page number of the paginated list
                  page_size:
                    type: integer
                    description: number of pages of the whole document
                  total_count:
                    type: integer
                    description: total records count
                  data:
                    $ref: '#/components/schemas/MaterialCategory'
                  url:
                    type: string
    post:
      summary: Create Material Category
      operationId: create-material-category
      description: Create a new price book material category
      tags:
        - Material Categories
      security:
        - Company API Key: []
        - Housecall User OAuth Token: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              properties:
                parent_uuid:
                  type: string
                  description: 'UUID of the material category to create this new category under; if left blank, the category will be created at the root level'
                name:
                  type: string
                  description: name of the material category to be created
            examples:
              Create material category with name under a parent:
                value:
                  name: New Category
      responses:
        '200':
          description: Material Category created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MaterialCategory'
  '/api/price_book/material_categories/{uuid}':
    parameters:
      - name: uuid
        in: path
        required: true
        schema:
          type: string
        description: UUID of the material category to be updated.
    delete:
      summary: Delete Material Category
      operationId: delete-material-category
      description: Delete an existing price book material category
      tags:
        - Material Categories
      security:
        - Company API Key: []
        - Housecall User OAuth Token: []
      responses:
        '200':
          description: Material category deleted
          content:
            application/json:
              schema:
                type: object
        '404':
          description: Material category not found
      requestBody:
        content:
          application/json: {}
      x-stoplight:
        id: dhq3lfytvth93
      parameters: []
    put:
      summary: Update Material Category
      operationId: update-material-category
      description: Update information of an existing price book material category
      tags:
        - Material Categories
      security:
        - Company API Key: []
        - Housecall User OAuth Token: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
            examples:
              Update material category name:
                value:
                  name: New Name
      responses:
        '200':
          description: Material Category updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MaterialCategory'
        '404':
          description: Material Category Not Found
  /api/price_book/price_forms:
    post:
      summary: Create Price Form
      tags:
        - Price Forms
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PriceFormResponse'
      operationId: post-api-price_book-price_forms
      x-stoplight:
        id: 4wuj7qqkofhzc
      description: Create a new price book price form
      security:
        - Company API Key: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PriceFormRequest'
    get:
      summary: Get Price Forms
      description: Get a list of active price book price forms
      operationId: get-api-price_book-price_forms-list
      tags:
        - Price Forms
      security:
        - Company API Key: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    description: list
                  page:
                    type: integer
                    description: page number of the paginated list
                  page_size:
                    type: integer
                    description: number of items per page
                  total_pages_count:
                    type: integer
                    description: number of pages of the whole document
                  total_count:
                    type: integer
                    description: total records count
                  data:
                    $ref: '#/components/schemas/PriceFormResponse'
                  url:
                    type: string
  '/api/price_book/price_forms/{uuid}':
    parameters:
      - schema:
          type: string
        name: uuid
        in: path
        required: true
    get:
      summary: Get Price Form
      tags:
        - Price Forms
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PriceFormResponse'
      operationId: get-api-price_book-price_forms-by-id
      description: Get a single price book price form by ID
      security:
        - Company API Key: []
      x-stoplight:
        id: k1ehlpxj1v3tj
    put:
      summary: Update Price Form
      tags:
        - Price Forms
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PriceFormResponse'
        '404':
          description: '{ "error": { "message": "price_form not found" } }'
          content:
            application/json:
              schema:
                type: object
                properties: {}
        '422':
          description: '{ "error": { "message": "Name can''t be blank" } }'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                x-examples:
                  Example 1:
                    error:
                      message: Name can't be blank
      operationId: put-api-price_book-price_forms-uuid
      x-stoplight:
        id: jnx0gdqplve86
      security:
        - Company API Key: []
        - Housecall User OAuth Token: []
      description: Updates price form
      requestBody:
        content:
          application/json:
            schema:
              type: object
              x-examples:
                Example 1:
                  name: Deep Clean
                  description: Full home deep cleaning service
                  automatically_add_to_new_job: true
                  taxable: true
                  olb_enabled: true
                  duration_in_minutes: 180
                  image: null
                  dynamic_duration_enabled: false
                  service_area_pricing_enabled: false
                  default_service_zone_id: null
                  bookable_as: job
                  question_1: Do you have pets?
                  question_2: Any special instructions?
                  assigned:
                    pros:
                      - uuid: pro_0000000000000001
                        full_name: Jane Professional
                      - uuid: pro_0000000000000002
                        full_name: John Professional
                    tags:
                      - kitchen
                      - premium
                  fields_attributes:
                    - id: pbpff_1111111111111111
                      name: Number of rooms
                      kind: quantity_select
                      price: 5000
                      order_index: 0
                      duration_in_minutes: 30
                      _destroy: false
                    - name: Package
                      kind: single_select
                      order_index: 1
                      duration_in_minutes: 60
                      options_attributes:
                        - name: Standard
                          price: 0
                          duration_in_minutes: 0
                          _destroy: false
                        - name: Premium
                          price: 3000
                          duration_in_minutes: 15
                          _destroy: false
                    - name: Extras
                      kind: multiple_select
                      order_index: 2
                      duration_in_minutes: 0
                      options_attributes:
                        - name: Inside fridge
                          price: 1500
                          duration_in_minutes: 10
                          _destroy: false
                        - name: Inside oven
                          price: 2000
                          duration_in_minutes: 15
                          _destroy: false
                    - name: Square footage
                      kind: numerical_range
                      order_index: 3
                      duration_in_minutes: 0
                      options_attributes:
                        - name: 0–1000
                          lower_bound: 0
                          upper_bound: 1000
                          price: 0
                          duration_in_minutes: 0
                          _destroy: false
                        - name: 1001–2000
                          lower_bound: 1001
                          upper_bound: 2000
                          price: 5000
                          duration_in_minutes: 30
                          _destroy: false
                    - id: pbpff_2222222222222222
                      _destroy: true
              properties:
                name:
                  type: string
                description:
                  type: string
                automatically_add_to_new_job:
                  type: boolean
                taxable:
                  type: boolean
                olb_enabled:
                  type: boolean
                duration_in_minutes:
                  type: integer
                image:
                  description: 'when uploading an image, send multipart/form-data with a file under image. If sending JSON only, use image: null or omit it.'
                  nullable: true
                dynamic_duration_enabled:
                  type: boolean
                bookable_as:
                  type: string
                  description: 'accepted: "jobs" or "estimates"'
                question_1:
                  type: string
                question_2:
                  type: string
                service_area_pricing_enabled:
                  type: boolean
                default_service_zone_id:
                  type: string
                fields_attributes:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                      name:
                        type: string
                      kind:
                        type: string
                        description: 'Accepted: "single_select", "multiple select", "quantity_select", "numerical_range"'
                      price:
                        type: integer
                      order_index:
                        type: integer
                      duration_in_minutes:
                        type: integer
                      _destroy:
                        type: boolean
                      options_attributes:
                        type: array
                        description: 'accepted when `numerical_ranges`: "lower bound", "upper_bound"'
                        items:
                          type: object
                          properties:
                            name:
                              type: string
                            price:
                              type: integer
                            duration_in_minutes:
                              type: integer
                            _destroy:
                              type: boolean
                      service_area_fields_attributes:
                        type: array
                        items:
                          type: object
                          properties:
                            service_zone_id:
                              type: string
                            price:
                              type: integer
                            service_area_field_options_attributes:
                              type: array
                              items:
                                type: object
                                properties:
                                  price:
                                    type: integer
                assigned:
                  type: object
                  properties:
                    pros:
                      type: array
                      items:
                        type: object
                        properties:
                          uuid:
                            type: string
                          full_name:
                            type: string
                    tags:
                      type: array
                      items:
                        type: string
        description: ''
    delete:
      summary: Delete Price Form
      tags:
        - Price Forms
      responses:
        '204':
          description: No Content
      operationId: delete-api-price_book-price_forms-price_form_id
      x-stoplight:
        id: eghd88vvk0dst
      description: 'Delete a price form '
      security:
        - Company API Key: []
        - Housecall User OAuth Token: []
  /api/price_book/services:
    get:
      summary: Get Price Book Services
      tags:
        - Price Book Services
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PricebookServiceList'
      operationId: get-price-book-services
      description: Get a list of price book services.
      security:
        - Application API Key: []
        - Housecall User OAuth Token: []
      parameters:
        - schema:
            type: number
            default: 1
          in: query
          name: page
          description: Current Page
        - schema:
            type: number
            default: 10
          in: query
          name: page_size
          description: Number of items returned per page.
        - schema:
            type: string
            default: created_at
          in: query
          name: sort_by
          description: Price book service attribute to sort by
        - schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
          in: query
          name: sort_direction
          description: Ascending or descending
        - schema:
            type: string
          in: query
          name: q
          description: 'A query that can be used to search for a service by name, description and task_number.'
        - schema:
            type: array
            items:
              type: object
              properties:
                property:
                  type: string
                  enum:
                    - online_booking_enabled
                    - managed_by
                    - flat_rate_enabled
                    - taxable
                    - category
                    - organization_industry
                  description: Filter field name.
                operator:
                  type: string
                  enum:
                    - eq
                  description: Comparison operator.
                values:
                  type: array
                  minItems: 1
                  items:
                    oneOf:
                      - type: boolean
                      - type: string
                  description: 'Values to filter by (booleans for flags, strings for text fields).'
              required:
                - property
                - operator
                - values
          in: query
          name: filters
          style: deepObject
          explode: true
          description: |
            Deep-object filters sent as `filters[][property]`, `filters[][operator]`, and `filters[][values][]`. Supported properties: `online_booking_enabled`, `managed_by`, `flat_rate_enabled`, `taxable`, `category`, `organization_industry`. Only the `eq` operator is supported. Each `filters[][values][]` entry may be a boolean (`true`/`false`) or a string, depending on the property. Serialized as nested array params over the wire, e.g. `filters[][property]=online_booking_enabled&filters[][operator]=eq&filters[][values][]=true`. The example above is the authoritative wire format; the `style: deepObject` declaration is approximate — Rails' array-of-nested-objects serialization has no exact OpenAPI 3.0 style equivalent.
        - schema:
            type: array
            items:
              type: string
              enum:
                - service_materials
                - service_labor_rates
          in: query
          name: expand
          style: form
          explode: true
          description: |
            Array of strings to expand in the response body. Sent as repeated `expand[]` query params (e.g. `expand[]=service_materials&expand[]=service_labor_rates`). By default `service_materials` and `service_labor_rates` are returned as empty lists (`{ "object": "list", "data": [] }`); include the corresponding value here to populate its `data` array. Supported values: `service_materials`, `service_labor_rates`.
  /service_zones:
    get:
      summary: Get Service Zones
      tags:
        - Service Zones
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedList'
                  - type: object
                    properties:
                      service_zones:
                        type: array
                        items:
                          $ref: '#/components/schemas/ServiceZoneResponse'
      operationId: get-service-zones
      description: Get a list of service zones
      security:
        - Application API Key: []
        - Housecall User OAuth Token: []
      parameters:
        - schema:
            type: number
            default: 1
          in: query
          name: page
          description: Current Page
        - schema:
            type: number
            default: 10
          in: query
          name: page_size
          description: Number of service zones per page
        - schema:
            type: string
          in: query
          name: zip_code
          description: Filter service zones by zip code
        - schema:
            type: string
          in: query
          name: address
          description: Filter service zones by address
  /routes:
    get:
      summary: Get Routes
      operationId: get-routes
      description: 'Get a list of routes for the company. A route groups employees and their job appointments, events, and estimates for a given date.'
      tags:
        - Routes
      security:
        - Application API Key: []
        - Housecall User OAuth Token: []
      parameters:
        - schema:
            type: string
          in: query
          name: date
          description: 'Filter routes by date, formatted as YYYY-MM-DD. Defaults to today.'
        - schema:
            type: number
            default: 1
          in: query
          name: page
          description: Current page number.
        - schema:
            type: number
            default: 10
          in: query
          name: per_page
          description: Number of routes returned per page.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  routes:
                    type: array
                    items:
                      $ref: '#/components/schemas/Route'
                  total_items:
                    type: integer
                  total_pages:
                    type: integer
                  page:
                    type: integer
                  page_size:
                    type: integer
  /pipeline/statuses:
    get:
      summary: Get Pipeline Statuses
      description: |
        Retrieves a list of pipeline statuses for a given resource type (lead, job, or estimate).
        Returns an empty array for organizations without pipeline enabled.
      tags:
        - Pipeline
      parameters:
        - name: resource_type
          in: query
          required: true
          schema:
            type: string
            enum:
              - lead
              - job
              - estimate
        - name: page
          in: query
          schema:
            type: integer
            default: 1
        - name: page_size
          in: query
          schema:
            type: integer
            default: 10
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedList'
                  - type: object
                    properties:
                      statuses:
                        type: array
                        items:
                          $ref: '#/components/schemas/PipelineStatus'
              examples:
                with_pipeline:
                  summary: Organization with pipeline enabled
                  value:
                    page: 1
                    page_size: 10
                    total_pages: 2
                    total_items: 13
                    statuses:
                      - id: string
                        name: string
                        status_type: string
                without_pipeline:
                  summary: Organization without pipeline enabled
                  value:
                    page: 1
                    page_size: 10
                    total_pages: 0
                    total_items: 0
                    statuses: []
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
    put:
      summary: Update Pipeline Status
      description: |
        Updates pipeline status for lead, job, or estimate.
        The Pipeline domain only allows forward movement to statuses with equal or higher order values.
      tags:
        - Pipeline
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PipelineStatusUpdate'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  status_id:
                    type: string
                    description: The UUID of the updated status
                  resource_id:
                    type: string
                    description: 'The UUID of the resource (lead, job, or estimate)'
                  resource_type:
                    type: string
                    enum:
                      - lead
                      - job
                      - estimate
                  name:
                    type: string
                    description: The name of the pipeline status
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
      required:
        - error
    Application:
      title: Application
      type: object
      properties:
        name:
          type: string
        state:
          type: string
          enum:
            - enabled
            - disabled
            - pending
        organization_id:
          type: string
      required:
        - name
        - state
        - organization_id
    Checklist:
      title: Checklist
      type: object
      properties:
        id:
          type: string
        title:
          type: string
        job_uuid:
          type: string
        estimate_uuid:
          type: string
        sections:
          type: array
          items:
            $ref: '#/components/schemas/ChecklistSection'
    CustomerCreate:
      title: CustomerCreate
      type: object
      x-examples: {}
      properties:
        first_name:
          type: string
          nullable: true
        last_name:
          type: string
          nullable: true
        email:
          type: string
          nullable: true
        company:
          type: string
          nullable: true
        notifications_enabled:
          type: boolean
          description: Will the customer receive notifications
        mobile_number:
          type: string
          nullable: true
        home_number:
          type: string
          nullable: true
        work_number:
          type: string
          nullable: true
        tags:
          type: array
          items:
            type: string
        lead_source:
          type: string
          nullable: true
        notes:
          type: string
        addresses:
          type: array
          items:
            allOf:
              - properties:
                  street:
                    type: string
                  street_line_2:
                    type: string
                  city:
                    type: string
                  state:
                    type: string
                  zip:
                    type: string
                  country:
                    type: string
            type: object
    CustomerUpdate:
      title: CustomerUpdate
      type: object
      x-examples: {}
      properties:
        first_name:
          type: string
          nullable: true
        last_name:
          type: string
          nullable: true
        email:
          type: string
          nullable: true
        company:
          type: string
          nullable: true
        notifications_enabled:
          type: boolean
          description: Will the customer receive notifications
        mobile_number:
          type: string
          nullable: true
        home_number:
          type: string
          nullable: true
        work_number:
          type: string
          nullable: true
        tags:
          type: array
          items:
            type: string
        lead_source:
          type: string
          nullable: true
        notes:
          type: string
          x-stoplight:
            id: dxxempl7y3c55
    Address:
      title: Address
      nullable: true
      x-examples: {}
      allOf:
        - properties:
            id:
              type: string
            type:
              type: string
              enum:
                - billing
                - service
            street:
              type: string
              nullable: true
            street_line_2:
              type: string
              nullable: true
            city:
              type: string
              nullable: true
            state:
              type: string
              nullable: true
            zip:
              type: string
              nullable: true
            country:
              type: string
              nullable: true
          required:
            - id
      type: object
    Note:
      title: Note
      type: object
      x-examples: {}
      properties:
        id:
          type: string
        content:
          type: string
    Job:
      title: Job
      type: object
      x-examples: {}
      description: A single job segment.
      properties:
        id:
          type: string
        invoice_number:
          type: string
        description:
          type: string
        customer:
          type: object
          properties:
            id:
              type: string
            first_name:
              type: string
              nullable: true
            last_name:
              type: string
              nullable: true
            email:
              type: string
              nullable: true
            mobile_number:
              type: string
              nullable: true
            home_number:
              type: string
              nullable: true
            work_number:
              type: string
              nullable: true
            company:
              type: string
              nullable: true
            notifications_enabled:
              type: boolean
            lead_source:
              type: string
              nullable: true
            notes:
              type: array
              items:
                $ref: '#/components/schemas/Note'
            created_at:
              type: string
            updated_at:
              type: string
            company_name:
              type: string
            company_id:
              type: string
            tags:
              type: array
              items:
                type: string
        address:
          $ref: '#/components/schemas/Address'
        notes:
          type: array
          items:
            $ref: '#/components/schemas/Note'
        work_status:
          type: string
          enum:
            - needs scheduling
            - scheduled
            - in progress
            - complete rated
            - complete unrated
            - user canceled
            - pro canceled
        work_timestamps:
          $ref: '#/components/schemas/WorkTimestamps'
        schedule:
          $ref: '#/components/schemas/Schedule'
        total_amount:
          type: integer
        outstanding_balance:
          type: integer
        subtotal:
          type: integer
        assigned_employees:
          type: array
          items:
            $ref: '#/components/schemas/Employee'
        tags:
          type: array
          items:
            type: string
        original_estimate_id:
          type: string
          description: null unless job has been copied from an estimate
          nullable: true
        original_estimate_uuids:
          type: array
          description: null unless job has been copied from an estimate. Includes all estimate UUIDs if job was created from multiple estimate options.
          items:
            type: string
        lead_source:
          type: string
          nullable: true
        job_fields:
          type: object
          properties:
            job_type:
              $ref: '#/components/schemas/JobType'
            business_unit:
              $ref: '#/components/schemas/JobType'
        attachments:
          type: array
          description: Only present if expanded with attachments
          items:
            $ref: '#/components/schemas/Attachment'
        locked_at:
          type: string
          format: date-time
        created_at:
          type: string
        updated_at:
          type: string
        canceled_at:
          type: string
          format: date-time
          nullable: true
          description: When the job was user canceled (ISO8601 UTC). null if not user canceled.
        deleted_at:
          type: string
          format: date-time
          nullable: true
          description: When the job was pro canceled/deleted (ISO8601 UTC). null if not pro canceled.
        company_name:
          type: string
        company_id:
          type: string
        recurrence_number:
          type: integer
          description: The occurrence number of this job in the recurrence series if recurrent
        recurrence_rule:
          type: string
          description: The iCal RRULE string defining the recurrence pattern if recurrent
          example: FREQ=MONTHLY;COUNT=12;BYDAY=1FR
        recurrence_status:
          type: string
          nullable: true
          enum:
            - active
            - complete
            - cancelled
          description: The status of the recurrence series. null if not recurrent.
        recurrence_id:
          type: string
          nullable: true
          description: UUID of the recurrence series this job belongs to. null if not recurrent.
        assigned_route_template_id:
          type: string
          nullable: true
          description: UUID of the route template assigned to this job. null if no route template is assigned.
    Employee:
      title: Employee
      x-examples:
        example-1:
          id: string
          avatar_url: string
          color_hex: string
          first_name: string
          last_name: string
          email: string
          mobile_number: string
          role: string
          created_at: string
          tags:
            - string
          permissions:
            can_add_and_edit_job: true
            can_be_booked_online: true
            can_call_and_text_with_customers: true
            can_chat_with_customers: true
            can_delete_and_cancel_job: true
            can_edit_message_on_invoice: true
            can_see_street_view_data: true
            can_share_job: true
            can_take_payment_see_prices: true
            can_see_customers: true
            can_see_full_schedule: true
            can_see_future_jobs: true
            can_see_marketing_campaigns: true
            can_see_reporting: true
            can_edit_settings: true
            is_point_of_contact: true
            is_admin: true
      allOf:
        - properties:
            id:
              type: string
            first_name:
              type: string
            last_name:
              type: string
            email:
              type: string
            mobile_number:
              type: string
            color_hex:
              type: string
            avatar_url:
              type: string
            role:
              type: string
            created_at:
              type: string
            tags:
              type: array
              items:
                type: string
            permissions:
              type: object
              properties:
                can_add_and_edit_job:
                  type: boolean
                can_be_booked_online:
                  type: boolean
                can_call_and_text_with_customers:
                  type: boolean
                can_chat_with_customers:
                  type: boolean
                can_delete_and_cancel_job:
                  type: boolean
                can_edit_message_on_invoice:
                  type: boolean
                can_see_street_view_data:
                  type: boolean
                can_share_job:
                  type: boolean
                can_take_payment_see_prices:
                  type: boolean
                can_see_customers:
                  type: boolean
                can_see_full_schedule:
                  type: boolean
                can_see_future_jobs:
                  type: boolean
                can_see_marketing_campaigns:
                  type: boolean
                can_see_reporting:
                  type: boolean
                can_edit_settings:
                  type: boolean
                is_point_of_contact:
                  type: boolean
                is_admin:
                  type: boolean
            company_name:
              type: string
            company_id:
              type: string
      type: object
    DispatchedEmployee:
      title: DispatchedEmployee
      x-examples: {}
      description: ''
      allOf:
        - type: object
          properties:
            employee_id:
              type: string
              description: ID of the employee assigned to the job
    Phone:
      title: Phone
      type: object
      properties:
        name:
          type: string
        number:
          type: string
      required:
        - name
        - number
      x-examples: {}
    Customer:
      allOf:
        - properties:
            id:
              type: string
            first_name:
              type: string
              nullable: true
            last_name:
              type: string
              nullable: true
            email:
              type: string
              nullable: true
            mobile_number:
              type: string
              nullable: true
            home_number:
              type: string
              nullable: true
            work_number:
              type: string
              nullable: true
            company:
              type: string
              nullable: true
            notifications_enabled:
              type: boolean
              description: Will the customer receive notifications
            lead_source:
              type: string
              nullable: true
            notes:
              type: string
              nullable: true
            created_at:
              type: string
            updated_at:
              type: string
            company_name:
              type: string
            company_id:
              type: string
              x-stoplight:
                id: 8xrs6ebtt71k3
            tags:
              type: array
              items:
                type: string
            addresses:
              type: array
              items:
                $ref: '#/components/schemas/Address'
        - properties:
            attachments:
              type: array
              description: Only present if expanded with attachments
              items:
                $ref: '#/components/schemas/Attachment'
            created_at:
              type: string
            updated_at:
              type: string
            do_not_service:
              type: boolean
              description: Only present if expanded with do_not_service
      type: object
    JobInputMaterial:
      title: JobInputMaterial
      type: object
      properties:
        uuid:
          type: string
          description: Only required for updating a job input material
        name:
          type: string
        description:
          type: string
        part_number:
          type: string
        unit_cost:
          type: integer
          example: 100
          description: Unit in cents.
        quantity:
          type: number
          example: 1.51
      required:
        - name
    JobLinkCreate:
      title: JobLinkCreate
      type: object
      properties:
        title:
          type: string
        url:
          type: string
      required:
        - title
        - url
    JobLink:
      title: JobLink
      allOf:
        - type: object
          properties:
            id:
              type: string
          required:
            - id
        - $ref: '#/components/schemas/JobLinkCreate'
    LockJobsByTimeRangeRequest:
      title: LockJobsByTimeRangeRequest
      type: object
      properties:
        starting_at:
          type: string
          format: date-time
          description: Start of the time range (inclusive). A job matches when its schedule start (`start`) OR its completion time (`completed_at`) falls within the range.
        ending_at:
          type: string
          format: date-time
          description: End of the time range (inclusive).
        statuses:
          type: array
          x-stoplight:
            id: lk9statuses01x
          description: Job statuses to lock within the time range. Required and must contain at least one value. `completed` matches jobs by `completed_at`; `scheduled` and `in_progress` match by schedule `start`. A job is locked when its `start` OR `completed_at` falls inside the range for one of the requested statuses.
          minItems: 1
          items:
            type: string
            enum:
              - scheduled
              - in_progress
              - completed
      required:
        - starting_at
        - ending_at
        - statuses
    AddressCreate:
      title: AddressCreate
      type: object
      properties:
        street:
          type: string
        street_line_2:
          type: string
          nullable: true
        city:
          type: string
        state:
          type: string
        zip:
          type: string
        country:
          type: string
        latitude:
          oneOf:
            - type: number
            - type: string
        longitude:
          oneOf:
            - type: number
            - type: string
      required:
        - street
        - city
        - state
        - zip
        - country
    JobCreate:
      title: JobCreate
      type: object
      description: Object used when creating a job.
      properties:
        invoice_number:
          type: number
          description: 'Invoice number must be unique across all of a company''s jobs in Housecall Pro. If left blank, one will be automatically generated.'
        customer_id:
          type: string
        address_id:
          type: string
        schedule:
          type: object
          properties:
            scheduled_start:
              type: string
              x-stoplight:
                id: 9scsdlsbqsihw
              description: 'ISO-8601 formatted date string YYYY-MM-DDTHH:MM:SS(2023-03-23T15:30:00)'
            scheduled_end:
              type: string
              x-stoplight:
                id: yaq1sdovroarp
              description: 'ISO-8601 formatted date string YYYY-MM-DDTHH:MM:SS(2023-03-23T16:30:00)'
            arrival_window:
              type: integer
              x-stoplight:
                id: oacq0prfccgz4
              description: In minutes
            anytime:
              type: boolean
              description: 'If true, the job can be scheduled anytime during the day.'
              default: false
            anytime_start_date:
              type: string
              description: ISO-8601 formatted date string YYYY-MM-DD(2023-03-23) **Required if anytime is true**
        assigned_employee_ids:
          type: array
          items:
            type: string
        line_items:
          type: array
          items:
            $ref: '#/components/schemas/LineItemCreate'
        tags:
          type: array
          items:
            type: string
        lead_source:
          type: string
        notes:
          type: string
        job_fields:
          type: object
          properties:
            job_type_id:
              type: string
            business_unit_id:
              type: string
      required:
        - customer_id
        - address_id
    PaginatedList:
      title: PaginatedList
      type: object
      x-examples:
        example-1:
          page: 0
          page_size: 0
          total_pages: 0
          total_items: 0
      properties:
        page:
          type: number
        page_size:
          type: number
        total_pages:
          type: number
        total_items:
          type: number
      required:
        - page
        - page_size
        - total_pages
        - total_items
    Schedule:
      title: Schedule
      type: object
      properties:
        scheduled_start:
          type: string
          description: 'ISO-8601 formatted date string in UTC YYYY-MM-DDTHH:MM:SS(2023-03-23T15:30:00)'
        scheduled_end:
          type: string
          description: 'ISO-8601 formatted date string in UTC YYYY-MM-DDTHH:MM:SS(2023-03-23T16:30:00)'
        time_zone:
          type: string
          nullable: true
          example: America/Los_Angeles
          description: IANA time zone identifier used to schedule this job. null if no time zone could be determined.
        scheduled_start_local:
          type: string
          format: date-time
          nullable: true
          example: '2023-03-23T08:30:00-07:00'
          description: 'scheduled_start expressed in time_zone, as an ISO-8601 timestamp with a UTC offset (not "Z"). null if unscheduled or time_zone is unknown. Prefer this field over scheduled_start whenever showing the scheduled time to a user.'
        scheduled_end_local:
          type: string
          format: date-time
          nullable: true
          example: '2023-03-23T09:30:00-07:00'
          description: 'scheduled_end expressed in time_zone, as an ISO-8601 timestamp with a UTC offset (not "Z"). null if unscheduled or time_zone is unknown. Prefer this field over scheduled_end whenever showing the scheduled time to a user.'
        arrival_window:
          type: integer
        appointments:
          type: array
          x-stoplight:
            id: b4fdt4m20q7fo
          description: Only present if expanded with appointments
          items:
            $ref: '#/components/schemas/Appointment'
    Attachment:
      title: Attachment
      type: object
      properties:
        id:
          type: string
        file_name:
          type: string
        url:
          type: string
        file_type:
          type: string
    LineItem:
      title: LineItem
      type: object
      properties:
        service_item_id:
          type: string
        service_item_type:
          type: string
          enum:
            - market_place
            - organizational
            - pricebook_material
        name:
          type: string
        unit_price:
          type: number
        unit_cost:
          type: number
        quantity:
          type: number
        kind:
          type: string
          enum:
            - materials
            - labor
            - fixed gratuity
            - fixed discount
            - percent discount
          default: labor
        taxable:
          type: boolean
        description:
          type: string
      required:
        - name
    BulkLineItemUpdate:
      title: BulkLineItemUpdate
      type: object
      properties:
        id:
          type: string
        service_item_id:
          type: string
        service_item_type:
          type: string
          enum:
            - market_place
            - organizational
            - pricebook_material
        name:
          type: string
        unit_price:
          type: number
        unit_cost:
          type: number
        quantity:
          type: number
        kind:
          type: string
          enum:
            - materials
            - labor
            - fixed gratuity
            - fixed discount
            - percent discount
          default: labor
        taxable:
          type: boolean
        description:
          type: string
      required:
        - name
    LineItemResponse:
      title: LineItemReponse
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
        unit_price:
          type: number
        unit_cost:
          type: number
        unit_of_measure:
          type: string
        quantity:
          type: number
        kind:
          type: string
          enum:
            - materials
            - labor
            - fixed gratuity
            - fixed discount
            - percent discount
          default: labor
        taxable:
          type: boolean
        amount:
          type: number
        order_index:
          type: integer
        service_item_id:
          type: string
        service_item_type:
          type: string
          enum:
            - market_place
            - organizational
            - pricebook_material
    LineItemDeletedResponse:
      title: LineItemDeletedResponse
      type: object
      properties:
        id:
          type: string
        deleted:
          type: boolean
    LineItemCreate:
      title: LineItemCreate
      type: object
      description: Object used to create a line on a job.
      properties:
        name:
          type: string
        description:
          type: string
          description: ''
        unit_price:
          type: number
          default: 0
          description: Selling price of a singe unit in cents.
        quantity:
          type: number
          description: The number of items being solid. This can be a float up to two decmial places.
          default: 1
        unit_cost:
          type: number
          description: Direct cost to the company of a singe unit in cents. This value is used for job costing.
          default: 0
        pricing_form:
          $ref: '#/components/schemas/CreateJobPriceFormCreate'
      required:
        - name
    JobLineItemCreate:
      title: JobLineItemCreate
      type: object
      description: Object used to create a line on a job.
      properties:
        name:
          type: string
        description:
          type: string
          description: ''
        unit_price:
          type: number
          default: 0
          description: Selling price of a singe unit in cents.
        quantity:
          type: number
          description: The number of items being solid. This can be a float up to two decmial places.
          default: 1
        unit_cost:
          type: number
          description: Direct cost to the company of a singe unit in cents. This value is used for job costing.
          default: 0
        kind:
          type: string
          enum:
            - materials
            - labor
            - fixed gratuity
            - fixed discount
            - percent discount
          default: labor
        taxable:
          type: boolean
          default: true
        service_item_id:
          type: string
          description: 'ID of the service item this line item is based on, if applicable'
        service_item_type:
          type: string
          enum:
            - market_place
            - organizational
            - pricebook_material
      required:
        - name
    CreateJobPriceFormCreate:
      title: PriceForm
      type: object
      nullable: true
      properties:
        id:
          type: string
          format: uuid
          pattern: '^pbpf_[a-f0-9]{32}$'
          example: pbpf_3fa85f6457174562b3fc2c963f66afa6
        fields:
          type: array
          items:
            $ref: '#/components/schemas/CreateJobPriceFormFieldCreate'
      required:
        - id
    CreateJobPriceFormFieldCreate:
      title: PriceFormField
      type: object
      properties:
        id:
          type: string
          format: uuid
          pattern: '^pbpff_[a-f0-9]{32}$'
          example: pbpff_d458bfa14c0543cf9d4dd4b549a58a9e
        value:
          type: number
        options:
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/CreateJobPriceFormFieldOptionCreate'
      required:
        - id
    CreateJobPriceFormFieldOptionCreate:
      title: PriceFormFieldOption
      type: object
      properties:
        id:
          type: string
          format: uuid
          pattern: '^pbpffo_[a-f0-9]{32}$'
          example: pbpffo_b6145991abce4e9c8cd0d7d2014fca01
      required:
        - id
    Estimate:
      title: Estimate
      type: object
      x-examples: {}
      properties:
        id:
          type: string
        estimate_number:
          type: string
        work_status:
          type: string
        lead_source:
          type: string
          nullable: true
        customer:
          type: object
          properties:
            id:
              type: string
            first_name:
              type: string
              nullable: true
            last_name:
              type: string
              nullable: true
            email:
              type: string
              nullable: true
            mobile_number:
              type: string
              nullable: true
            home_number:
              type: string
              nullable: true
            work_number:
              type: string
              nullable: true
            company:
              type: string
              nullable: true
            notifications_enabled:
              type: boolean
            lead_source:
              type: string
              nullable: true
            notes:
              type: string
            created_at:
              type: string
            updated_at:
              type: string
            company_name:
              type: string
            company_id:
              type: string
            tags:
              type: array
              items:
                type: string
        address:
          $ref: '#/components/schemas/Address'
        created_at:
          type: string
        updated_at:
          type: string
        company_name:
          type: string
        company_id:
          type: string
        work_timestamps:
          $ref: '#/components/schemas/WorkTimestamps'
        schedule:
          $ref: '#/components/schemas/Schedule'
        assigned_employees:
          type: array
          items:
            $ref: '#/components/schemas/Employee'
        estimate_fields:
          type: object
          properties:
            job_type:
              allOf:
                - $ref: '#/components/schemas/JobType'
              nullable: true
            business_unit:
              $ref: '#/components/schemas/JobType'
              nullable: true
        assigned_route_template_id:
          type: string
          nullable: true
          description: UUID of the route template assigned to the first estimate option. null if no route template is assigned.
        options:
          type: array
          items:
            $ref: '#/components/schemas/EstimateOption'
      description: ''
    EstimateOption:
      title: Estimate Option
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        option_number:
          type: string
        total_amount:
          type: integer
        approval_status:
          type: string
          example: 'pro declined, pro approved, declined, approved, awaiting response, expired'
        approval_status_updated_at:
          type: string
          format: date-time
          nullable: true
          example: '2026-09-02T14:31:07Z'
          description: |
            Timestamp of the most recent change to `approval_status`, in ISO 8601 format. This is not an
            "approved at" timestamp: it moves on every transition (for example approved -> declined, or
            awaiting response -> expired), so it must be read together with `approval_status`.

            Do not treat this value as monotonic. It is null while the option has no approval status, and it
            returns to null if the approval status is later cleared. For estimates created through a data
            import it reflects the import time rather than the original customer decision.
        message_from_pro:
          type: string
        tags:
          type: array
          items:
            type: string
        status:
          type: string
          example: 'open, needs scheduling, scheduled, in progress, submitted for signoff, timed out, canceled, deleted, complete unrated, complete rated, created job from estimate'
        notes:
          type: array
          items:
            $ref: '#/components/schemas/Note'
        created_at:
          type: string
        updated_at:
          type: string
        attachments:
          type: array
          description: Only present if expanded with attachments
          items:
            $ref: '#/components/schemas/Attachment'
    EstimateOptionCreate:
      title: EstimateOptionCreate
      type: object
      required:
        - name
      properties:
        name:
          type: string
          description: Name of the estimate option.
        line_items:
          type: array
          description: Line items to add to the option.
          items:
            type: object
            properties:
              name:
                type: string
                description: Name of the line item.
              description:
                type: string
                description: Description of the line item.
              unit_price:
                type: integer
                description: 'Unit price in cents (e.g., 10000 = $100.00).'
              unit_cost:
                type: integer
                description: Unit cost in cents. Used for job costing.
              quantity:
                type: number
                description: Quantity of the line item. Supports up to two decimal places.
              taxable:
                type: boolean
                description: Whether the line item is taxable.
        tax:
          type: object
          description: 'Tax settings for the option. When taxable is true, both tax_name and tax_rate are required.'
          properties:
            taxable:
              type: boolean
              description: Whether the option total is taxable.
            tax_rate:
              type: number
              description: 'Tax rate as a decimal between 0 and 1 (e.g., 0.0825 for 8.25%). Required when taxable is true.'
            tax_name:
              type: string
              description: 'Name of the tax (e.g., "Sales Tax"). Required when taxable is true.'
    WorkTimestamps:
      title: Work Timestamps
      type: object
      properties:
        on_my_way_at:
          type: string
          description: 'ISO-8601 formatted date string YYYY-MM-DDTHH:MM:SS(2023-03-23T15:30:00)'
          nullable: true
        started_at:
          type: string
          description: 'ISO-8601 formatted date string YYYY-MM-DDTHH:MM:SS(2023-03-23T15:30:00)'
          nullable: true
        completed_at:
          type: string
          description: 'ISO-8601 formatted date string YYYY-MM-DDTHH:MM:SS(2023-03-23T15:30:00)'
          nullable: true
    Company:
      title: Company
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        support_email:
          type: string
        phone_number:
          type: string
        logo_url:
          type: string
        address:
          $ref: '#/components/schemas/AddressCreate'
        website:
          type: string
        default_arrival_window:
          type: string
        time_zone:
          type: string
        service_areas_data:
          type: object
          $ref: '#/components/schemas/ServiceAreasData'
        locations:
          type: array
          items:
            $ref: '#/components/schemas/Company'
        franchise_info:
          type: object
          description: Present when the company belongs to a franchise organization.
          properties:
            root_franchisor_id:
              type: string
            franchisor_depth:
              type: integer
            metadata:
              type: object
              properties:
                territory_management:
                  type: object
                  description: Territory management metadata. Requests write `franchise_id`; responses also expose the derived `franchise_ids` array.
                  properties:
                    franchise_id:
                      type: string
                      nullable: true
                      description: Territory management franchise identifier string. Multiple values may be provided as a comma-separated list. Send `null` to clear the stored value.
                    franchise_ids:
                      type: array
                      description: Response-only derived array parsed from `franchise_id`.
                      items:
                        type: string
                franchisee_identifier:
                  type: string
                  nullable: true
                  description: Dedicated franchisee identifier managed separately from external metadata.
                external:
                  type: object
                  additionalProperties: true
                  description: Custom key-value pairs for external metadata.
      description: ''
    UpdateFranchiseInfo:
      title: Update Franchise Info
      type: object
      properties:
        metadata:
          type: object
          properties:
            territory_management:
              type: object
              description: Territory management metadata.
              properties:
                franchise_id:
                  type: string
                  nullable: true
                  description: Territory management franchise identifier string. Multiple values may be provided as a comma-separated list. Send `null` to clear the stored value.
            franchisee_identifier:
              type: string
              nullable: true
              description: Dedicated franchisee identifier managed separately from external metadata. Send `null` to clear the stored value.
            external:
              type: object
              additionalProperties: true
              description: Custom key-value pairs for external metadata. Updating this object does not overwrite `franchisee_identifier`.
      description: Request payload for updating franchise information
    CompleteScheduleAvailability:
      title: Complete schedule availability
      type: object
      properties:
        availability_buffer_in_days:
          type: number
        daily_availabilities:
          type: object
          properties:
            data:
              type: array
              items:
                type: object
                properties:
                  day_name:
                    type: string
                  schedule_windows:
                    type: array
                    items:
                      type: object
                      properties:
                        start_time:
                          type: string
                          description: ISO-8601 formatted date string
                        end_time:
                          type: string
                          description: ISO-8601 formatted date string
    UpdateCompleteScheduleAvailability:
      title: Complete schedule availability
      type: object
      required:
        - availability_buffer_in_days
        - daily_schedule_windows
      properties:
        availability_buffer_in_days:
          type: number
        daily_schedule_windows:
          type: array
          items:
            type: object
            required:
              - day_name
              - schedule_windows
            properties:
              day_name:
                type: string
              schedule_windows:
                type: array
                items:
                  type: object
                  required:
                    - start_time
                    - end_time
                  properties:
                    start_time:
                      type: string
                      description: ISO-8601 formatted date string
                    end_time:
                      type: string
                      description: ISO-8601 formatted date string
    EstimateCreate:
      title: EstimateCreate
      type: object
      x-examples:
        Example 1:
          estimate_number: 0
          note: string
          message: string
          customer_id: string
          assigned_employee_ids:
            - string
          address_id: string
          lead_source: string
          address:
            street: string
            street_line_2: string
            city: string
            state: string
            zip: string
          options:
            - name: string
              tags:
                - string
              line_items:
                - name: string
                  description: string
                  unit_price: 0
                  quantity: 1
                  unit_cost: 0
          tax:
            taxable: true
            tax_rate: 0
            tax_name: string
          schedule:
            start_time: string
            end_time: string
            arrival_window_in_minutes: 0
            notify_customer: true
      properties:
        estimate_number:
          type: integer
          description: 'Estimate number unique across all of a company''s estimates in Housecall Pro. If left blank, one will be automatically generated.'
        note:
          type: string
        message:
          type: string
        customer_id:
          type: string
        assigned_employee_ids:
          type: array
          items:
            type: string
        address_id:
          type: string
        lead_source:
          type: string
        address:
          type: object
          properties:
            street:
              type: string
            street_line_2:
              type: string
            city:
              type: string
            state:
              type: string
            zip:
              type: string
        options:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              tags:
                type: array
                items:
                  type: string
              line_items:
                type: array
                items:
                  $ref: '#/components/schemas/LineItemCreate'
        tax:
          type: object
          properties:
            taxable:
              type: boolean
            tax_rate:
              type: number
            tax_name:
              type: string
        schedule:
          type: object
          properties:
            start_time:
              type: string
            end_time:
              type: string
            arrival_window_in_minutes:
              type: integer
            notify_customer:
              type: boolean
        estimate_fields:
          type: object
          properties:
            job_type_id:
              type: string
            business_unit_id:
              type: string
    Event:
      title: Event
      type: object
      x-examples:
        example-1:
          id: string
          name: string
          note: string
          tags:
            - string
          recurrence_rule: string
          address:
            street: string
            street_line_2: string
            city: string
            state: string
            zip: string
          assigned_employees:
            id: string
            avatar_url: string
            color_hex: string
            first_name: string
            last_name: string
            email: string
            mobile_number: string
            role: string
            tags:
              - string
            permissions:
              can_add_and_edit_job: true
              can_be_booked_online: true
              can_call_and_text_with_customers: true
              can_chat_with_customers: true
              can_delete_and_cancel_job: true
              can_edit_message_on_invoice: true
              can_see_street_view_data: true
              can_share_job: true
              can_take_payment_see_prices: true
              can_see_customers: true
              can_see_full_schedule: true
              can_see_future_jobs: true
              can_see_marketing_campaigns: true
              can_see_reporting: true
              can_edit_settings: true
              is_point_of_contact: true
              is_admin: true
          schedule:
            start_time: string
            end_time: string
            time_zone: string
          all_day: true
          created_at: string
          updated_at: string
      properties:
        id:
          type: string
        name:
          type: string
        note:
          type: string
          nullable: true
        tags:
          type: array
          items:
            type: string
        recurrence_rule:
          type: string
          description: iCal format
          nullable: true
        address:
          type: object
          properties:
            street:
              type: string
            street_line_2:
              type: string
            city:
              type: string
            state:
              type: string
            zip:
              type: string
        assigned_employees:
          type: array
          items:
            $ref: '#/components/schemas/Employee'
        schedule:
          type: object
          properties:
            start_time:
              type: string
            end_time:
              type: string
            time_zone:
              type: string
        all_day:
          type: boolean
        created_at:
          type: string
        updated_at:
          type: string
        company_name:
          type: string
        company_id:
          type: string
    Tag:
      title: Tag
      type: object
      x-examples:
        example-1:
          id: string
          name: string
      properties:
        id:
          type: string
        name:
          type: string
    BookingWindows:
      title: BookingWindows
      type: object
      properties:
        booking_windows:
          type: array
          items:
            type: object
            properties:
              start_time:
                type: string
                description: A timestamp of the start time of a booking window (UTC)
              end_time:
                type: string
                description: A timestamp of the finish time of a booking window (UTC)
              available:
                type: boolean
                description: The value representing if an organization is available during the booking window
        show_for_days:
          type: integer
        start_date:
          type: string
      x-examples:
        example-1:
          booking_windows:
            - start_time: string
              end_time: string
              available: true
          show_for_days: 0
          start_date: string
    LeadCreate:
      title: LeadsCreate
      x-stoplight:
        id: dmcfl12yj9zvk
      type: object
      properties:
        customer_id:
          type: string
          description: Either this or Customer required
        customer:
          type: object
          description: Either this or Customer ID required
          properties:
            first_name:
              type: string
            last_name:
              type: string
            email:
              type: string
            notifications_enabled:
              type: boolean
            mobile_number:
              type: string
            company:
              type: string
            home_number:
              type: string
            work_number:
              type: string
            lead_source:
              type: string
            notes:
              type: string
            tags:
              type: array
              items:
                type: string
            addresses:
              type: array
              items:
                type: object
                properties:
                  city:
                    type: string
                  state:
                    type: string
                  street:
                    type: string
                  street_line_2:
                    type: string
                  zip:
                    type: string
        assigned_employee_id:
          type: string
        address_id:
          type: string
        address:
          type: object
          properties:
            city:
              type: string
            state:
              type: string
            street:
              type: string
            street_line_2:
              type: string
            zip:
              type: string
        lead_source:
          type: string
        line_items:
          type: array
          items:
            type: object
            properties:
              description:
                type: string
              kind:
                type: string
                enum:
                  - labor
                  - materials
                  - fixed discount
                  - percent discount
              name:
                type: string
              quantity:
                type: integer
                description: The number of items being solid. This can be a float up to two decmial places.
                default: 1
              unit_cost:
                type: integer
                description: Direct cost to the company of a singe unit in cents. This value is used for job costing.
                default: 0
              unit_price:
                type: integer
                description: Selling price of a singe unit in cents.
                default: 0
        note:
          type: string
        tags:
          type: array
          items:
            type: string
        tax_name:
          type: string
        tax_rate:
          type: integer
      description: ''
    Lead:
      title: Lead
      type: object
      x-stoplight:
        id: 0bjegsy2nxv8i
      description: Object return on leads
      properties:
        id:
          type: string
        number:
          type: integer
        customer:
          type: object
          properties:
            id:
              type: string
            first_name:
              type: string
              nullable: true
            last_name:
              type: string
              nullable: true
            email:
              type: string
              nullable: true
            company:
              type: string
              nullable: true
            notifications_enabled:
              type: boolean
              description: Will the customer receive notifications
            mobile_number:
              type: string
              nullable: true
            home_number:
              type: string
              nullable: true
            work_number:
              type: string
              nullable: true
            tags:
              type: array
              items:
                type: string
            lead_source:
              type: string
              nullable: true
        address:
          type: object
          properties:
            id:
              type: string
            city:
              type: string
            state:
              type: string
            street:
              type: string
            street_line_2:
              type: string
            zip:
              type: string
        lead_source:
          type: string
        tags:
          type: array
          items:
            type: string
        assigned_employee:
          $ref: '#/components/schemas/Employee'
        status:
          type: string
          enum:
            - lost
            - open
            - won
        pipeline_status:
          type: string
        company_name:
          type: string
        company_id:
          type: string
        lost_at:
          type: string
          format: date-time
          nullable: true
          description: When the lead was marked lost (ISO8601 UTC). null if not lost.
        total_amount:
          type: integer
          nullable: true
          description: Total amount of the lead in cents.
        conversions:
          type: array
          description: List of jobs or estimates this lead was converted into.
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                  - Job
                  - Estimate
              id:
                type: string
                description: UUID of the converted job or estimate.
        job_fields:
          type: object
          description: Job type and business unit assigned to this lead.
          properties:
            job_type_uuid:
              type: string
              nullable: true
            business_unit_uuid:
              type: string
              nullable: true
    LeadSource:
      title: LeadSource
      x-stoplight:
        id: 8fppj9p7hg2w8
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        editable:
          type: boolean
    JobType:
      title: JobType
      x-stoplight:
        id: okqhrhfhihrzp
      type: object
      properties:
        id:
          type: string
        name:
          type: string
    Appointment:
      title: Appointment
      x-stoplight:
        id: 4ad5nuq1b22ft
      type: object
      properties:
        id:
          type: string
        start_date:
          type: string
          description: Start date of job appointment in iso8601
          example: '2021-01-10'
        start_time:
          type: string
          description: Start time of job appointment in iso8601
          example: '2021-01-10T10:45:00'
        end_time:
          type: string
          example: '2021-01-10T10:45:00'
          description: End time of job appointment in iso8601
        anytime:
          type: boolean
          description: Boolean value indicating if appointment is anytime
        arrival_window_minutes:
          type: integer
          description: Integer value in minutes of arrival window
        dispatched_employees_ids:
          type: array
          description: List of pros ids to be assign in appointment
          items:
            type: string
    CreateAppointment:
      title: CreateAppointment
      x-stoplight:
        id: hjnfql1pu227v
      type: object
      properties:
        start_time:
          type: string
          description: Start time of job appointment in iso8601
          example: '2021-01-10T10:45:00'
        end_time:
          type: string
          description: End time of job appointment in iso8601
          example: '2021-01-10T10:45:00'
        arrival_window_minutes:
          type: integer
          description: Integer value in minutes of arrival window
        dispatched_employees_ids:
          type: array
          description: List of pros ids to be assign in appointment
          items:
            type: string
      required:
        - start_time
        - end_time
        - dispatched_employees_ids
    JobInvoice:
      title: JobInvoice
      x-stoplight:
        id: v4wpllvot99xp
      type: object
      properties:
        id:
          type: string
        status:
          type: string
          x-stoplight:
            id: juid1c5altoo4
        invoice_number:
          type: string
          x-stoplight:
            id: e7b7tb47nd7rl
        amount:
          type: integer
          x-stoplight:
            id: dcfu0ruz4n4my
        subtotal:
          type: integer
        due_amount:
          type: integer
          x-stoplight:
            id: dwvobsajfwbhz
        due_at:
          type: string
          x-stoplight:
            id: zi2hdbc3wrkdu
        display_due_concept:
          type: string
          x-stoplight:
            id: 1djkkq2rt1z8k
        due_concept:
          type: string
          x-stoplight:
            id: hi0yaz55na6m7
        paid_at:
          type: string
          x-stoplight:
            id: uebgxeenqx8x6
        sent_at:
          type: string
          x-stoplight:
            id: clit0kjxvak9b
        service_date:
          type: string
          x-stoplight:
            id: qe2nva9tdy589
        invoice_date:
          type: string
          x-stoplight:
            id: 31aimkyb5d2ks
        items:
          type: array
          x-stoplight:
            id: e4gwxothh0czl
          items:
            $ref: '#/components/schemas/InvoiceItem'
        taxes:
          type: array
          x-stoplight:
            id: z8k304zjlfoer
          items:
            $ref: '#/components/schemas/InvoiceTax'
        discounts:
          type: array
          x-stoplight:
            id: 1eatdly8ujen2
          items:
            $ref: '#/components/schemas/InvoiceDiscount'
        payments:
          type: array
          x-stoplight:
            id: ys45ormkcw4ce
          items:
            $ref: '#/components/schemas/InvoicePayment'
    InvoiceItem:
      title: InvoiceItem
      type: object
      properties:
        id:
          type: string
        name:
          type: string
          x-stoplight:
            id: t4pj17mmofqa3
        unit_cost:
          type: integer
          x-stoplight:
            id: frkk6zfz36452
        unit_price:
          type: integer
          x-stoplight:
            id: 45mczw4cvbbir
        qty_in_hundredths:
          type: integer
          x-stoplight:
            id: rc0z9w0xm0w42
        amount:
          type: integer
          x-stoplight:
            id: popaiqmvrswq5
        invoiced_amount:
          type: integer
          nullable: true
          x-stoplight:
            id: ov2gforha0wkb
          description: 'Portion of this line item''s amount allocated to this invoice, in cents. For invoices created by splitting a job''s total across multiple linked or progress invoices, this is the amount invoiced on this invoice; for a standalone invoice it equals `amount`.'
        description:
          type: string
          x-stoplight:
            id: usjeu0tm8c0my
        type:
          type: string
          x-stoplight:
            id: 17zy0xvdrpkee
    InvoiceTax:
      title: InvoiceTax
      type: object
      properties:
        id:
          type: string
        rate:
          type: integer
          x-stoplight:
            id: c4rbl8uv7f4dq
        amount:
          type: integer
          x-stoplight:
            id: kw2xj1vcv8l8a
        name:
          type: string
          x-stoplight:
            id: 9eq5hprfvugky
    InvoiceDiscount:
      title: InvoiceDiscount
      type: object
      properties:
        id:
          type: string
        amount:
          type: integer
          x-stoplight:
            id: zqtqhw9gixo0j
        name:
          type: string
          x-stoplight:
            id: ivi8esff5b9na
        description:
          type: string
          x-stoplight:
            id: 5kqzjhtgjn1ps
    InvoicePayment:
      title: InvoicePayment
      type: object
      properties:
        id:
          type: string
        status:
          type: string
          x-stoplight:
            id: uk03x7mc2e9es
        payment_method:
          type: string
          x-stoplight:
            id: 6mnmfp5mn0r7b
        amount:
          type: integer
          x-stoplight:
            id: 7cfng6dxfml0i
        note:
          type: string
          x-stoplight:
            id: dy85zfidy8wrd
        paid_at:
          type: string
          x-stoplight:
            id: 7htxivm27nyde
        category:
          type: string
          x-stoplight:
            id: bwwxrvv13dihg
    Material:
      title: Material
      x-stoplight:
        id: a8asnqx4lrnhc
      type: object
      properties:
        object:
          type: string
          x-stoplight:
            id: cusa8w8dpwki2
        uuid:
          type: string
          x-stoplight:
            id: qi86j2rtnh3bt
        material_category_uuid:
          type: string
          x-stoplight:
            id: dcrlrrd2es43m
        name:
          type: string
          x-stoplight:
            id: j5f2b2rv725zg
        description:
          type: string
          x-stoplight:
            id: 3gyqe3bjqty7q
        image:
          type: string
          x-stoplight:
            id: of73ym6e0m0ur
        cost:
          type: integer
          x-stoplight:
            id: yq72xz4sha8gp
        unit_of_measure:
          type: string
          x-stoplight:
            id: al3ph8bqpc0na
        part_number:
          type: string
          x-stoplight:
            id: ilc3av6z05ggp
        price:
          type: integer
          x-stoplight:
            id: u6rdfifon86fw
        flat_rate_enabled:
          type: boolean
          x-stoplight:
            id: xehldusnnhuon
        material_category_name:
          type: string
          x-stoplight:
            id: nwgo66mn8q0jc
        taxable:
          type: boolean
          x-stoplight:
            id: 2zekf9e469k5t
    MaterialCategory:
      title: MaterialCategory
      x-stoplight:
        id: 5oawzos1v8k43
      type: object
      properties:
        object:
          type: string
          x-stoplight:
            id: c4j0lh71w3wqd
        uuid:
          type: string
          x-stoplight:
            id: o155pytmjh6c6
        parent_uuid:
          type: string
          x-stoplight:
            id: wkuoptvf0tolt
          nullable: true
        name:
          type: string
          x-stoplight:
            id: nycsggbs09442
        image:
          type: string
          x-stoplight:
            id: 597qql0ewqw7o
    PriceFormRequest:
      title: PriceForm
      type: object
      required:
        - name
      properties:
        name:
          type: string
        description:
          type: string
        automatically_add_to_new_job:
          type: boolean
        taxable:
          type: boolean
        olb_enabled:
          type: boolean
        duration_in_minutes:
          type: integer
        image:
          type: string
        dynamic_duration_enabled:
          type: boolean
        bookable_as:
          type: string
        question_1:
          type: string
        question_2:
          type: string
        service_area_pricing_enabled:
          type: boolean
        default_service_zone_id:
          type: string
        assigned:
          type: object
          properties:
            pros:
              type: array
              items:
                type: object
                properties:
                  uuid:
                    type: string
                  full_name:
                    type: string
            tags:
              type: array
              items:
                type: string
        fields_attributes:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              kind:
                type: string
              price:
                type: integer
              order_index:
                type: integer
              duration_in_minutes:
                type: integer
              options_attributes:
                type: array
                items:
                  type: object
                  properties:
                    name:
                      type: string
                    price:
                      type: integer
                    lower_bound:
                      type: integer
                    upper_bound:
                      type: integer
                    duration_in_minutes:
                      type: integer
              service_area_fields_attributes:
                type: array
                items:
                  type: object
                  properties:
                    service_zone_id:
                      type: string
                    price:
                      type: integer
                    service_area_field_options_attributes:
                      type: array
                      items:
                        type: object
                        properties:
                          price:
                            type: integer
    PriceFormResponse:
      title: PriceForm
      type: object
      properties:
        id:
          type: string
          format: uuid
          pattern: '^pbpf_[a-f0-9]{32}$'
          example: pbpf_3fa85f6457174562b3fc2c963f66afa6
        name:
          type: string
        automatically_add_to_new_job:
          type: boolean
        olb_enabled:
          type: boolean
        duration_in_minutes:
          type: integer
        taxable:
          type: boolean
        template_type:
          type: string
        description:
          type: string
        dynamic_duration_enabled:
          type: boolean
        order_index:
          type: integer
        question_1:
          type: string
        question_2:
          type: string
        bookable_as:
          type: string
        service_area_pricing_enabled:
          type: boolean
        image_url:
          type: string
        fields:
          type: object
          properties:
            data:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    pattern: '^pbpff_[a-f0-9]{32}$'
                    example: pbpff_d458bfa14c0543cf9d4dd4b549a58a9e
                  name:
                    type: string
                  price:
                    type: integer
                  kind:
                    type: string
                  order_index:
                    type: integer
                  duration_in_minutes:
                    type: integer
                  options:
                    type: object
                    properties:
                      data:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                              pattern: '^pbpffo_[a-f0-9]{32}$'
                              example: pbpffo_b59627a1f9284c12a6a981c6cc2d97c5
                            name:
                              type: string
                            price:
                              type: integer
                            upper_bound:
                              type: integer
                            lower_bound:
                              type: integer
                            duration_in_minutes:
                              type: integer
                            uuid:
                              type: string
                              x-stoplight:
                                id: jby6f4a1b1qvf
                  service_area_fields:
                    type: object
                    properties:
                      data:
                        type: array
                        items:
                          type: object
                          properties:
                            price:
                              type: integer
                            service_zone_id:
                              type: string
                              format: uuid
                              pattern: '^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$'
                              example: 2a742be3-6451-4dc4-bcf1-f8c5a6956009
                            service_area_field_options:
                              type: object
                              properties:
                                data:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      price:
                                        type: integer
                                      price_form_field_option_id:
                                        type: string
                                        pattern: '^pbpffo_[a-f0-9]{32}$'
                                        example: pbpffo_eb8ff5fba4e24f2cb4269f441946dc9a
                                        description: 'The ID of the corresponding entry in the parent field''s options array. Use this to look up the option''s name, upper_bound, lower_bound, etc.'
                  assigned_pros:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                          pattern: '^pro_[a-f0-9]{32}$'
                          example: pro_b9d8d7384b894851b03c1df9a748f653
                        full_name:
                          type: string
                  assigned_tags:
                    type: array
                    items:
                      type: string
    ServiceAreasData:
      title: ServiceAreasData
      type: object
      properties:
        zip_codes:
          type: array
          items:
            type: string
          description: Zip codes that the company offer services
          example:
            - '94110'
            - '94111'
    ChecklistSection:
      title: ChecklistSection
      type: object
      description: items is an array that may contain checklist items of various types.
      properties:
        title:
          type: string
        order_index:
          type: integer
        items:
          type: array
          items:
            anyOf:
              - $ref: '#/components/schemas/TextChecklistItem'
              - $ref: '#/components/schemas/BooleanChecklistItem'
              - $ref: '#/components/schemas/MultiSelectChecklistItem'
              - $ref: '#/components/schemas/SingleSelectChecklistItem'
              - $ref: '#/components/schemas/PassFlagFailChecklistItem'
              - $ref: '#/components/schemas/MediaUploadChecklistItem'
    BooleanChecklistItem:
      title: BooleanChecklistItem
      type: object
      properties:
        type:
          type: string
          description: checkbox
        title:
          type: string
        required:
          type: boolean
        comment:
          type: string
        order_index:
          type: integer
        value:
          type: boolean
    TextChecklistItem:
      title: TextChecklistItem
      type: object
      properties:
        type:
          type: string
          description: text
        title:
          type: string
        required:
          type: boolean
        comment:
          type: string
        order_index:
          type: integer
        value:
          type: string
    PassFlagFailChecklistItem:
      title: PassFlagFailChecklistItem
      type: object
      properties:
        type:
          type: string
          description: text
        title:
          type: string
        required:
          type: boolean
        comment:
          type: string
        order_index:
          type: integer
        value:
          type: string
    MultiSelectChecklistItem:
      title: MultiSelectChecklistItem
      type: object
      properties:
        type:
          type: string
          description: multi_select
        title:
          type: string
        required:
          type: boolean
        comment:
          type: string
        order_index:
          type: integer
        value:
          type: boolean
        options:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              value:
                type: boolean
              order_index:
                type: integer
    MediaUploadChecklistItem:
      title: MediaUploadChecklistItem
      type: object
      properties:
        type:
          type: string
          description: media_upload
        title:
          type: string
        required:
          type: boolean
        comment:
          type: string
        order_index:
          type: integer
        value:
          type: boolean
          description: flag to check if attachments have been added
        attachments:
          type: array
          items:
            type: object
            properties:
              url:
                type: string
              file_type:
                type: string
              file_name:
                type: string
              id:
                type: string
    SingleSelectChecklistItem:
      title: SingleSelectChecklistItem
      type: object
      properties:
        type:
          type: string
          description: single_select
        title:
          type: string
        required:
          type: boolean
        comment:
          type: string
        order_index:
          type: integer
        value:
          type: boolean
        options:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              value:
                type: boolean
              order_index:
                type: integer
    PricebookServiceList:
      allOf:
        - $ref: '#/components/schemas/PaginatedList'
        - type: object
          properties:
            data:
              type: array
              items:
                $ref: '#/components/schemas/PricebookService'
            url:
              type: string
    PricebookService:
      type: object
      properties:
        object:
          type: string
          enum:
            - service
        uuid:
          type: string
        name:
          type: string
        description:
          type: string
          nullable: true
        task_number:
          type: string
          nullable: true
        image:
          type: string
        flat_rate_enabled:
          type: boolean
        service_materials:
          allOf:
            - $ref: '#/components/schemas/PricebookServiceMaterialList'
          description: |
            Materials associated with the service. The `data` array is only populated when `service_materials` is requested via the `expand` query parameter; otherwise `data` is empty.
        service_labor_rates:
          allOf:
            - $ref: '#/components/schemas/PricebookServiceLaborRateList'
          description: |
            Labor rates associated with the service. The `data` array is only populated when `service_labor_rates` is requested via the `expand` query parameter; otherwise `data` is empty.
        managed_by:
          type: string
          nullable: true
        price:
          type: integer
        cost:
          type: integer
        taxable:
          type: boolean
        unit_of_measure:
          type: string
        category:
          $ref: '#/components/schemas/PricebookServiceCategory'
        industry:
          $ref: '#/components/schemas/PricebookServiceIndustry'
        online_booking_enabled:
          type: boolean
        duration:
          type: integer
        bookable_as:
          type: string
        assigned_pros:
          $ref: '#/components/schemas/PricebookServiceAssignedProList'
        question_1:
          type: string
          nullable: true
        question_2:
          type: string
          nullable: true
      required:
        - object
        - uuid
        - name
        - flat_rate_enabled
        - service_materials
        - service_labor_rates
        - price
        - cost
        - taxable
        - online_booking_enabled
        - assigned_pros
    PricebookServiceMaterialList:
      type: object
      properties:
        object:
          type: string
          enum:
            - list
        data:
          type: array
          items:
            $ref: '#/components/schemas/PricebookServiceMaterial'
      required:
        - object
        - data
    PricebookServiceMaterial:
      type: object
      properties:
        object:
          type: string
          enum:
            - service_material
        quantity:
          type: number
        material:
          $ref: '#/components/schemas/Material'
      required:
        - object
        - quantity
        - material
    PricebookServiceLaborRateList:
      type: object
      properties:
        object:
          type: string
          enum:
            - list
        data:
          type: array
          items:
            $ref: '#/components/schemas/PricebookServiceLaborRate'
      required:
        - object
        - data
    PricebookServiceLaborRate:
      type: object
      properties:
        object:
          type: string
          enum:
            - service_labor_rate
        number_of_hours:
          type: string
        labor_rate:
          $ref: '#/components/schemas/PricebookLaborRate'
      required:
        - object
        - number_of_hours
        - labor_rate
    PricebookLaborRate:
      type: object
      properties:
        object:
          type: string
          enum:
            - labor_rate
        uuid:
          type: string
        name:
          type: string
        hourly_cost:
          type: integer
        hourly_price:
          type: integer
        default:
          type: boolean
        services_count:
          type: integer
      required:
        - object
        - uuid
        - name
        - hourly_cost
        - hourly_price
        - default
        - services_count
    PricebookServiceAssignedProList:
      type: object
      properties:
        object:
          type: string
          enum:
            - list
        data:
          type: array
          items:
            $ref: '#/components/schemas/PricebookServiceAssignedPro'
      required:
        - object
        - data
    PricebookServiceAssignedPro:
      type: object
      properties:
        object:
          type: string
          enum:
            - assigned_pro
        uuid:
          type: string
        full_name:
          type: string
      required:
        - object
        - uuid
        - full_name
    PricebookServiceCategory:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
      required:
        - id
        - name
    PricebookServiceIndustry:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
      required:
        - id
        - name
    ServiceZoneResponse:
      title: ServiceZoneResponse
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        coverage_type:
          type: string
        trip_charge:
          type: integer
        fee_name:
          type: string
        zip_codes:
          type: array
          items:
            type: string
        cities:
          type: array
          items:
            $ref: '#/components/schemas/ServiceZoneCity'
        service_pros:
          type: array
          items:
            $ref: '#/components/schemas/ServiceZoneServicePro'
      required:
        - id
        - name
        - coverage_type
        - zip_codes
        - cities
        - service_pros
    ServiceZoneCity:
      title: ServiceZoneCity
      type: object
      properties:
        city:
          type: string
        state:
          type: string
        country:
          type: string
      required:
        - city
        - state
        - country
    ServiceZoneServicePro:
      title: ServiceZoneServicePro
      type: object
      properties:
        id:
          type: string
        first_name:
          type: string
        last_name:
          type: string
        email:
          type: string
        full_name:
          type: string
      required:
        - id
        - first_name
        - last_name
        - email
        - full_name
    Route:
      title: Route
      type: object
      description: 'A route groups employees and their scheduled job appointments, events, and estimates for a given date.'
      properties:
        id:
          type: string
          description: The unique identifier of the route.
        name:
          type: string
          description: The display name of the route.
        color_hex:
          type: string
          description: The hex color code used to visually distinguish this route (e.g. "#FF5733").
        date:
          type: string
          description: 'The date this route is scheduled for, formatted as YYYY-MM-DD.'
        employee_ids:
          type: array
          description: IDs of employees assigned to this route.
          items:
            type: string
        job_appointments:
          type: array
          description: Job appointments included in this route.
          items:
            type: object
        event_ids:
          type: array
          description: IDs of events included in this route.
          items:
            type: string
        estimate_ids:
          type: array
          description: IDs of estimates included in this route.
          items:
            type: string
    PipelineStatus:
      title: PipelineStatus
      type: object
      description: 'A pipeline status for lead, job, or estimate.'
      properties:
        id:
          type: string
          description: The unique identifier of the pipeline status (e.g. kcs_...)
        name:
          type: string
          description: The display name of the status
        status_type:
          type: string
      required:
        - id
        - name
        - status_type
    PipelineStatusUpdate:
      title: PipelineStatusUpdate
      type: object
      description: |
        Request body for updating pipeline status.

        Note: Only forward movement is allowed. The target status must have an order value greater than or equal to the current status.
      properties:
        resource_type:
          type: string
          enum:
            - lead
            - job
            - estimate
        resource_id:
          type: string
          description: the UUID of the resource
        status_id:
          type: string
          description: the UUID of the pipeline status
      required:
        - resource_type
        - resource_id
        - status_id
  securitySchemes:
    Company API Key:
      name: Authorization
      type: apiKey
      in: header
      description: |-
        Company API Key Authorization.

        Authorization Header value format [Token {api-key}]
    Application API Key:
      name: Authorization
      type: apiKey
      in: header
      description: |-
        Application API Key Authorization.

        Authorization Header value format [Token {api-key}]
    Housecall User OAuth Token:
      type: oauth2
      description: ''
      flows:
        clientCredentials:
          tokenUrl: ''
          refreshUrl: ''
          scopes: {}
