openapi: 3.0.0
info:
  version: v2
  title: Core API
servers:
  - url: https://openapi.paintscout.com/v2
paths:
  /companies:
    get:
      summary: List Companies
      operationId: listCompanies
      tags:
        - Companies
      parameters:
        - name: page
          in: query
          schema:
            type: integer
            format: int32
            minimum: 1
        - name: perPage
          in: query
          schema:
            type: integer
            format: int32
            minimum: 1
            maximum: 100
        - name: query
          in: query
          allowReserved: true
          schema:
            type: string
        - name: sort
          in: query
          schema:
            type: string
        - name: sortDir
          in: query
          schema:
            type: string
            enum:
              - asc
              - desc
      responses:
        "200":
          description: List of companies
          content:
            application/json:
              schema:
                type: object
                properties:
                  totalRows:
                    type: number
                  page:
                    type: number
                  perPage:
                    type: number
                  rows:
                    type: array
                    items:
                      $ref: "#/components/schemas/Company"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    post:
      summary: Create Company
      operationId: createCompany
      tags:
        - Companies
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Company"
      responses:
        "200":
          description: Details about the new Company
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Company"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  "/companies/{id}":
    get:
      summary: Retrieve Company
      operationId: getCompany
      tags:
        - Companies
      parameters:
        - name: id
          in: path
          description: ID of the Company
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Details about the company
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Company"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    put:
      summary: Update Company
      parameters:
        - name: id
          in: path
          description: ID of the Company
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Company"
      operationId: updateCompany
      tags:
        - Companies
      responses:
        "200":
          description: The updated company
          content:
            application/json:
              schema:
                additionalProperties: false
                $ref: "#/components/schemas/Company"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    delete:
      summary: Delete Company
      parameters:
        - name: id
          in: path
          description: ID of the Company
          required: true
          schema:
            type: string
      operationId: deleteCompany
      tags:
        - Companies
      responses:
        "204":
          description: No Content
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  /contacts:
    get:
      summary: List Contacts
      operationId: listContacts
      tags:
        - Contacts
      parameters:
        - name: page
          in: query
          schema:
            type: integer
            format: int32
            minimum: 1
        - name: perPage
          in: query
          schema:
            type: integer
            format: int32
            minimum: 1
            maximum: 100
        - name: query
          in: query
          allowReserved: true
          schema:
            type: string
        - name: sort
          in: query
          schema:
            type: string
        - name: sortDir
          in: query
          schema:
            type: string
            enum:
              - asc
              - desc
      responses:
        "200":
          description: List of contacts
          content:
            application/json:
              schema:
                type: object
                properties:
                  totalRows:
                    type: number
                  page:
                    type: number
                  perPage:
                    type: number
                  rows:
                    type: array
                    items:
                      $ref: "#/components/schemas/Contact"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    post:
      summary: Create Contact
      operationId: createContact
      tags:
        - Contacts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Contact"
      responses:
        "200":
          description: Details about the new Contact
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Contact"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  "/contacts/{id}":
    get:
      summary: Retrieve Contact
      operationId: getContact
      tags:
        - Contacts
      parameters:
        - name: id
          in: path
          description: ID of the Contact
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Details about the contact
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Contact"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    put:
      summary: Update Contact
      parameters:
        - name: id
          in: path
          description: ID of the Contact
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Contact"
      operationId: updateContact
      tags:
        - Contacts
      responses:
        "200":
          description: The updated contact
          content:
            application/json:
              schema:
                additionalProperties: false
                $ref: "#/components/schemas/Contact"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    delete:
      summary: Delete Contact
      parameters:
        - name: id
          in: path
          description: ID of the Contact
          required: true
          schema:
            type: string
      operationId: deleteContact
      tags:
        - Contacts
      responses:
        "204":
          description: No Content
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  /deals:
    get:
      summary: List Deals
      operationId: listDeals
      tags:
        - Deals
      parameters:
        - name: page
          in: query
          schema:
            type: integer
            format: int32
            minimum: 1
        - name: perPage
          in: query
          schema:
            type: integer
            format: int32
            minimum: 1
            maximum: 100
        - name: query
          in: query
          allowReserved: true
          schema:
            type: string
        - name: sort
          in: query
          schema:
            type: string
        - name: sortDir
          in: query
          schema:
            type: string
            enum:
              - asc
              - desc
      responses:
        "200":
          description: List of deals
          content:
            application/json:
              schema:
                type: object
                properties:
                  totalRows:
                    type: number
                  page:
                    type: number
                  perPage:
                    type: number
                  rows:
                    type: array
                    items:
                      $ref: "#/components/schemas/Deal"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    post:
      summary: Create Deal
      operationId: createDeal
      tags:
        - Deals
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Deal"
      responses:
        "200":
          description: Details about the new Deal
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Deal"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  "/deals/{id}":
    get:
      summary: Retrieve Deal
      operationId: getDeal
      tags:
        - Deals
      parameters:
        - name: id
          in: path
          description: ID of the Deal
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Details about the deal
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Deal"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    put:
      summary: Update Deal
      parameters:
        - name: id
          in: path
          description: ID of the Deal
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                name:
                  type: string
                  nullable: true
                  description: The Name of the Deal.
                contact:
                  type: object
                  nullable: true
                  description: Contact id to associate with the Deal
                  properties:
                    id:
                      type: string
                      format: uuid
                      description: A unique ID for the Contact.
                jobAddress:
                  type: object
                  nullable: true
                  additionalProperties: false
                  description: The Job Address of this Deal
                  properties:
                    address:
                      type: string
                      nullable: true
                      description: The address component of the job address
                    city:
                      type: string
                      nullable: true
                      description: The city component of the job address
                    state:
                      type: string
                      nullable: true
                      description: The state component of the job address
                    zip:
                      type: string
                      nullable: true
                      description: The zip code component of the job address
                pipeline:
                  type: string
                  nullable: true
                  description: The pipeline this Deal is in
                stage:
                  type: string
                  nullable: true
                  description: The stage of the pipeline this Deal is in
                leadSource:
                  type: string
                  nullable: true
                  description: The lead source of this Deal
                owner:
                  type: object
                  nullable: true
                  $ref: "#/components/schemas/Owner"
                tags:
                  type: array
                  description: Tags associated with this Deal
                  items:
                    type: string
              example:
                name: New Deal
                contact:
                  firstName: Alice
                  lastName: Smith
                  email: aliceemail@fakemail.com
                jobAddress:
                  address: 123 Main St
                  city: Springfield
                  state: IL
                  zip: "62701"
                pipeline: sales-pipeline
                stage: initial-contact
                leadSource: Website
      operationId: updateDeal
      tags:
        - Deals
      responses:
        "200":
          description: The updated deal
          content:
            application/json:
              schema:
                additionalProperties: false
                $ref: "#/components/schemas/Deal"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    delete:
      summary: Delete Deal
      parameters:
        - name: id
          in: path
          description: ID of the Deal
          required: true
          schema:
            type: string
      operationId: deleteDeal
      tags:
        - Deals
      responses:
        "204":
          description: No Content
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  /events:
    get:
      summary: List Events
      operationId: listEvents
      tags:
        - Events
      parameters:
        - name: page
          in: query
          schema:
            type: integer
            format: int32
            minimum: 1
        - name: perPage
          in: query
          schema:
            type: integer
            format: int32
            minimum: 1
            maximum: 100
        - name: query
          in: query
          allowReserved: true
          schema:
            type: string
        - name: sort
          in: query
          schema:
            type: string
        - name: sortDir
          in: query
          schema:
            type: string
            enum:
              - asc
              - desc
      responses:
        "200":
          description: List of events
          content:
            application/json:
              schema:
                type: object
                properties:
                  totalRows:
                    type: number
                  page:
                    type: number
                  perPage:
                    type: number
                  rows:
                    type: array
                    items:
                      $ref: "#/components/schemas/Event"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    post:
      summary: Create Event
      operationId: createEvent
      tags:
        - Events
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Event"
      responses:
        "200":
          description: Details about the new Event
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Event"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  "/events/{id}":
    get:
      summary: Retrieve Event
      operationId: getEvent
      tags:
        - Events
      parameters:
        - name: id
          in: path
          description: ID of the Event
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Details about the event
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Event"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    put:
      summary: Update Event
      parameters:
        - name: id
          in: path
          description: ID of the Event
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Event"
      operationId: updateEvent
      tags:
        - Events
      responses:
        "200":
          description: The updated event
          content:
            application/json:
              schema:
                additionalProperties: false
                $ref: "#/components/schemas/Event"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    delete:
      summary: Delete Event
      parameters:
        - name: id
          in: path
          description: ID of the Event
          required: true
          schema:
            type: string
      operationId: deleteEvent
      tags:
        - Events
      responses:
        "204":
          description: No Content
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  /quotes:
    get:
      summary: List Quotes
      operationId: listQuotes
      tags:
        - Quotes
      parameters:
        - name: page
          in: query
          schema:
            type: integer
            format: int32
            minimum: 1
        - name: perPage
          in: query
          schema:
            type: integer
            format: int32
            minimum: 1
            maximum: 100
        - name: query
          in: query
          allowReserved: true
          schema:
            type: string
        - name: sort
          in: query
          schema:
            type: string
        - name: sortDir
          in: query
          schema:
            type: string
            enum:
              - asc
              - desc
        - name: workOrder
          in: query
          schema:
            type: boolean
      responses:
        "200":
          description: List of quotes
          content:
            application/json:
              schema:
                type: object
                properties:
                  totalRows:
                    type: number
                  rows:
                    type: array
                    items:
                      $ref: "#/components/schemas/QuoteSearchResult"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    post:
      summary: Create Quote
      operationId: createQuote
      tags:
        - Quotes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/QuoteUpdate"
      responses:
        "200":
          description: Details about the new Quote
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Quote"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  "/quotes/{id}":
    get:
      summary: Retrieve Quote
      operationId: getQuote
      tags:
        - Quotes
      parameters:
        - name: id
          in: path
          description: ID of the Quote
          required: true
          schema:
            type: string
        - name: display
          in: query
          description: Display as either a Quote or Work Order.
          required: false
          schema:
            type: string
            enum:
              - quote
              - work-order
            default: quote
        - name: lang
          in: query
          description: Language used to locale-format Work Order values (only applies when
            display=work-order).
          required: false
          schema:
            type: string
            enum:
              - en
              - es
              - fr
            default: en
      responses:
        "200":
          description: Details about the quote
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Quote"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    put:
      summary: Update Quote
      parameters:
        - name: id
          in: path
          description: ID of the Quote
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/QuoteUpdate"
      operationId: updateQuote
      tags:
        - Quotes
      responses:
        "200":
          description: The updated quote
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Quote"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    delete:
      summary: Delete Quote
      parameters:
        - name: id
          in: path
          description: ID of the Quote
          required: true
          schema:
            type: string
      operationId: deleteQuote
      tags:
        - Quotes
      responses:
        "204":
          description: No Content
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  "/quotes/{id}/items":
    get:
      summary: List Quote Items
      operationId: listQuoteItems
      tags:
        - Quotes
      parameters:
        - name: id
          in: path
          description: ID of the Quote
          required: true
          schema:
            type: string
      responses:
        "200":
          description: List of quote items
          content:
            application/json:
              schema:
                type: object
                properties:
                  bid:
                    type: array
                    items:
                      $ref: "#/components/schemas/QuoteItem"
                  options:
                    type: array
                    items:
                      $ref: "#/components/schemas/QuoteItem"
                  archived:
                    type: array
                    items:
                      $ref: "#/components/schemas/QuoteItem"
                  additionalWork:
                    type: array
                    items:
                      $ref: "#/components/schemas/QuoteItem"
                  pending:
                    type: array
                    items:
                      $ref: "#/components/schemas/QuoteItem"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    post:
      summary: Create Quote Item
      operationId: createQuoteItem
      tags:
        - Quotes
      parameters:
        - name: id
          in: path
          description: ID of the Quote
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/QuoteItemCreate"
      responses:
        "200":
          description: Details about the new Quote Item
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/QuoteItem"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  "/quotes/{id}/items/{itemId}":
    get:
      summary: Get Quote Item
      operationId: getQuoteItem
      tags:
        - Quotes
      parameters:
        - name: id
          in: path
          description: ID of the Quote
          required: true
          schema:
            type: string
        - name: itemId
          in: path
          description: ID of the Quote Item
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Details about the quote item
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/QuoteItem"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Quote or item not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    put:
      summary: Update Quote Item
      operationId: updateQuoteItem
      tags:
        - Quotes
      parameters:
        - name: id
          in: path
          description: ID of the Quote
          required: true
          schema:
            type: string
        - name: itemId
          in: path
          description: ID of the Quote Item
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/QuoteItemUpdate"
      responses:
        "200":
          description: Updated quote item details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/QuoteItem"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Quote or item not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    delete:
      summary: Delete Quote Item
      operationId: deleteQuoteItem
      tags:
        - Quotes
      parameters:
        - name: id
          in: path
          description: ID of the Quote
          required: true
          schema:
            type: string
        - name: itemId
          in: path
          description: ID of the Quote Item
          required: true
          schema:
            type: string
      responses:
        "204":
          description: Quote item successfully deleted
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Quote or item not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  /invoices:
    get:
      summary: List Invoices
      operationId: listInvoices
      tags:
        - Invoices
      parameters:
        - name: page
          in: query
          schema:
            type: integer
            format: int32
            minimum: 1
        - name: perPage
          in: query
          schema:
            type: integer
            format: int32
            minimum: 1
            maximum: 100
        - name: query
          in: query
          allowReserved: true
          schema:
            type: string
        - name: sort
          in: query
          schema:
            type: string
        - name: sortDir
          in: query
          schema:
            type: string
            enum:
              - asc
              - desc
        - name: workOrder
          in: query
          schema:
            type: boolean
      responses:
        "200":
          description: List of invoices
          content:
            application/json:
              schema:
                type: object
                properties:
                  totalRows:
                    type: number
                  rows:
                    type: array
                    items:
                      $ref: "#/components/schemas/InvoiceSearchResult"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    post:
      summary: Create Invoice
      operationId: createInvoice
      tags:
        - Invoices
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/InvoiceUpdate"
      responses:
        "200":
          description: Details about the new Invoice
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Invoice"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  "/invoices/{id}":
    get:
      summary: Retrieve Invoice
      operationId: getInvoice
      tags:
        - Invoices
      parameters:
        - name: id
          in: path
          description: ID of the Invoice
          required: true
          schema:
            type: string
        - name: display
          in: query
          description: Display as either an Invoice or Work Order.
          required: false
          schema:
            type: string
            enum:
              - quote
              - work-order
            default: quote
        - name: lang
          in: query
          description: Language used to locale-format Work Order values (only applies when
            display=work-order).
          required: false
          schema:
            type: string
            enum:
              - en
              - es
              - fr
            default: en
      responses:
        "200":
          description: Details about the invoice
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Invoice"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    put:
      summary: Update Invoice
      parameters:
        - name: id
          in: path
          description: ID of the Invoice
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/InvoiceUpdate"
      operationId: updateInvoice
      tags:
        - Invoices
      responses:
        "200":
          description: The updated invoice
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Invoice"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    delete:
      summary: Delete Invoice
      parameters:
        - name: id
          in: path
          description: ID of the Invoice
          required: true
          schema:
            type: string
      operationId: deleteInvoice
      tags:
        - Invoices
      responses:
        "204":
          description: No Content
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  "/invoices/{id}/items":
    get:
      summary: List Invoice Items
      operationId: listInvoiceItems
      tags:
        - Invoices
      parameters:
        - name: id
          in: path
          description: ID of the Invoice
          required: true
          schema:
            type: string
      responses:
        "200":
          description: List of invoice items
          content:
            application/json:
              schema:
                type: object
                properties:
                  bid:
                    type: array
                    items:
                      $ref: "#/components/schemas/InvoiceItem"
                  options:
                    type: array
                    items:
                      $ref: "#/components/schemas/InvoiceItem"
                  archived:
                    type: array
                    items:
                      $ref: "#/components/schemas/InvoiceItem"
                  additionalWork:
                    type: array
                    items:
                      $ref: "#/components/schemas/InvoiceItem"
                  pending:
                    type: array
                    items:
                      $ref: "#/components/schemas/InvoiceItem"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    post:
      summary: Create Invoice Item
      operationId: createInvoiceItem
      tags:
        - Invoices
      parameters:
        - name: id
          in: path
          description: ID of the Invoice
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/InvoiceItemCreate"
      responses:
        "200":
          description: Details about the new Invoice Item
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InvoiceItem"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  "/invoices/{id}/items/{itemId}":
    get:
      summary: Get Invoice Item
      operationId: getInvoiceItem
      tags:
        - Invoices
      parameters:
        - name: id
          in: path
          description: ID of the Invoice
          required: true
          schema:
            type: string
        - name: itemId
          in: path
          description: ID of the Invoice Item
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Details about the invoice item
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InvoiceItem"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Invoice or item not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    put:
      summary: Update Invoice Item
      operationId: updateInvoiceItem
      tags:
        - Invoices
      parameters:
        - name: id
          in: path
          description: ID of the Invoice
          required: true
          schema:
            type: string
        - name: itemId
          in: path
          description: ID of the Invoice Item
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/InvoiceItemUpdate"
      responses:
        "200":
          description: Updated invoice item details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InvoiceItem"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Invoice or item not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    delete:
      summary: Delete Invoice Item
      operationId: deleteInvoiceItem
      tags:
        - Invoices
      parameters:
        - name: id
          in: path
          description: ID of the Invoice
          required: true
          schema:
            type: string
        - name: itemId
          in: path
          description: ID of the Invoice Item
          required: true
          schema:
            type: string
      responses:
        "204":
          description: Invoice item successfully deleted
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Invoice or item not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  /settings/lineItems:
    get:
      summary: List Line Item Options
      operationId: listLineItemOptions
      tags:
        - Settings - Line Items
      responses:
        "200":
          description: List of line items
          content:
            application/json:
              schema:
                type: object
                properties:
                  totalRows:
                    type: number
                  rows:
                    type: array
                    items:
                      $ref: "#/components/schemas/LineItem"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    post:
      summary: Create Line Item
      operationId: createLineItem
      tags:
        - Settings - Line Items
      requestBody:
        description: Data for creating a new area label
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                label:
                  type: string
                  description: The label of the line item
                description:
                  type: string
                  description: The description of the line item.
                unit:
                  type: string
                  description: The unit type (hour, sqft, etc).
                rate:
                  type: number
                  description: The rate for this line item.
                active:
                  type: boolean
                  description: Whether this line item is active & usable
                crewNote:
                  type: string
                  description: The crew note of the line item
                clientNote:
                  type: string
                  description: The client note of the line item
                calculateBy:
                  type: string
                  enum:
                    - none
                    - hourlyRate
                    - quantity
                  description: The calculation type of this line item
                quantity:
                  type: number
                  description: The quantity use if this is a quantity calculated line item
                hours:
                  type: number
                  description: The hours of this line item
                hourlyRate:
                  type: number
                  description: The hourly rate used if using an hourly-rate based calculation
                pricePerUnit:
                  type: number
                  description: The price per unit if using a quantity-based calculation
                price:
                  type: number
                  description: The price of this line item
              required:
                - label
              example:
                label: Test Line Item
                description: Test line item template
                unit: hour
                rate: 45
      responses:
        "200":
          description: Details about the new line item
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LineItem"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  "/settings/lineItems/{id}":
    get:
      summary: Retrieve Line Item
      operationId: getLineItem
      tags:
        - Settings - Line Items
      parameters:
        - name: id
          in: path
          description: ID of the line item
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Details about the line item
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LineItem"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    put:
      summary: Update Line Item
      operationId: updateLineItem
      tags:
        - Settings - Line Items
      parameters:
        - name: id
          in: path
          description: ID of the Line Item
          required: true
          schema:
            type: string
      requestBody:
        description: Updated line item data
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/LineItem"
      responses:
        "200":
          description: Successfully updated line item
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LineItem"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    delete:
      summary: Delete Line Item
      tags:
        - Settings - Line Items
      parameters:
        - name: id
          in: path
          description: ID of the Line Item
          required: true
          schema:
            type: string
      operationId: deleteLineItem
      responses:
        "204":
          description: Line item successfully deleted
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  /settings/quoteTypes:
    get:
      summary: List Quote Types
      operationId: listQuoteTypes
      tags:
        - Settings - Quote Types
      responses:
        "200":
          description: List of quote types
          content:
            application/json:
              schema:
                type: object
                properties:
                  totalRows:
                    type: number
                  rows:
                    type: array
                    items:
                      $ref: "#/components/schemas/QuoteType"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    post:
      summary: Create Quote Type
      operationId: createQuoteType
      tags:
        - Settings - Quote Types
      requestBody:
        description: Data for creating a new quote type
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                label:
                  type: string
                  description: The display label of the quote type.
                active:
                  type: boolean
                  description: Whether this quote type is active & usable
                defaultHourlyRate:
                  type: number
                  description: The default hourly rate for this quote type
                defaultTerms:
                  type: string
                  description: The default terms template for this quote type
                defaultAreaType:
                  type: string
                  description: The default area type for this quote type
                defaultPresentation:
                  type: string
                  description: The default presentation template for this quote type
                overrideCompanyOptions:
                  type: boolean
                  description: Whether this quote type overrides global company options
                companyOptions:
                  type: object
                  description: Custom company options for this quote type
                  additionalProperties: true
              required:
                - label
              example:
                label: Commercial Interior
                active: true
                defaultHourlyRate: 75
      responses:
        "200":
          description: Successfully created quote type
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/QuoteType"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "409":
          description: Conflict - Quote type already exists
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Quote type already exists
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  "/settings/quoteTypes/{id}":
    get:
      summary: Retrieve Quote Type
      operationId: getQuoteType
      tags:
        - Settings - Quote Types
      parameters:
        - name: id
          in: path
          description: ID of the Quote Type
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Details about the quote type
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/QuoteType"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Quote type not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    put:
      summary: Update Quote Type
      operationId: updateQuoteType
      tags:
        - Settings - Quote Types
      parameters:
        - name: id
          in: path
          description: ID of the Quote Type
          required: true
          schema:
            type: string
      requestBody:
        description: Updated quote type data
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/QuoteType"
      responses:
        "200":
          description: Successfully updated quote type
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/QuoteType"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Quote type not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    delete:
      summary: Delete Quote Type
      operationId: deleteQuoteType
      tags:
        - Settings - Quote Types
      parameters:
        - name: id
          in: path
          description: ID of the Quote Type
          required: true
          schema:
            type: string
      responses:
        "204":
          description: Quote type successfully deleted
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Quote type not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  /settings/products:
    get:
      summary: List Products
      operationId: listProducts
      tags:
        - Settings - Products
      responses:
        "200":
          description: List of products
          content:
            application/json:
              schema:
                type: object
                properties:
                  totalRows:
                    type: number
                  rows:
                    type: array
                    items:
                      $ref: "#/components/schemas/Product"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    post:
      summary: Create Product
      operationId: createProduct
      tags:
        - Settings - Products
      requestBody:
        description: Data for creating a new product
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                label:
                  type: string
                  description: The display label of the product.
                active:
                  type: boolean
                  description: Whether this product is active & usable
                coverageRate:
                  type: number
                  description: Square feet coverage per gallon (sqft/gal)
                lnftCoverage:
                  type: number
                  description: Linear feet coverage
                quantityCoverage:
                  type: number
                  description: Quantity coverage
                pricePerUnit:
                  type: number
                  description: Unit price per gallon ($/gal)
                unit:
                  type: string
                  description: Measurement unit label
                quoteTypes:
                  type: array
                  items:
                    type: string
                  description: Quote types this product applies to
              required:
                - label
                - coverageRate
                - lnftCoverage
                - quantityCoverage
              example:
                label: Premium Interior Paint
                active: true
                coverageRate: 400
                lnftCoverage: 0
                quantityCoverage: 1
                pricePerUnit: 65.99
                unit: gallon
                quoteTypes:
                  - interior
                  - residential
      responses:
        "200":
          description: Successfully created product
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Product"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "409":
          description: Conflict - Product already exists
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Product already exists
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  "/settings/products/{id}":
    get:
      summary: Retrieve Product
      operationId: getProduct
      tags:
        - Settings - Products
      parameters:
        - name: id
          in: path
          description: ID of the Product
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Details about the product
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Product"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Product not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    put:
      summary: Update Product
      operationId: updateProduct
      tags:
        - Settings - Products
      parameters:
        - name: id
          in: path
          description: ID of the Product
          required: true
          schema:
            type: string
      requestBody:
        description: Updated product data
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Product"
      responses:
        "200":
          description: Successfully updated product
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Product"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Product not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    delete:
      summary: Delete Product
      operationId: deleteProduct
      tags:
        - Settings - Products
      parameters:
        - name: id
          in: path
          description: ID of the Product
          required: true
          schema:
            type: string
      responses:
        "204":
          description: Product successfully deleted
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Product not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  /settings/rateCategories:
    get:
      summary: List Rate Categories
      operationId: listRateCategories
      tags:
        - Settings - Rate Categories
      responses:
        "200":
          description: List of rate categories
          content:
            application/json:
              schema:
                type: object
                properties:
                  totalRows:
                    type: number
                  rows:
                    type: array
                    items:
                      $ref: "#/components/schemas/RateCategory"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    post:
      summary: Create Rate Category
      operationId: createRateCategory
      tags:
        - Settings - Rate Categories
      requestBody:
        description: Data for creating a new rate category
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                label:
                  type: string
                  description: The display label of the rate category.
                active:
                  type: boolean
                  description: Whether this rate category is active & usable
                quoteTypes:
                  type: array
                  items:
                    type: string
                  description: Quote types this rate category applies to
              required:
                - label
              example:
                label: Interior Painting
                active: true
                quoteTypes:
                  - interior
                  - residential
      responses:
        "200":
          description: Successfully created rate category
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RateCategory"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "409":
          description: Conflict - Rate category already exists
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Rate category already exists
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  "/settings/rateCategories/{id}":
    get:
      summary: Retrieve Rate Category
      operationId: getRateCategory
      tags:
        - Settings - Rate Categories
      parameters:
        - name: id
          in: path
          description: ID of the Rate Category
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Details about the rate category
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RateCategory"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Rate category not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    put:
      summary: Update Rate Category
      operationId: updateRateCategory
      tags:
        - Settings - Rate Categories
      parameters:
        - name: id
          in: path
          description: ID of the Rate Category
          required: true
          schema:
            type: string
      requestBody:
        description: Updated rate category data
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RateCategory"
      responses:
        "200":
          description: Successfully updated rate category
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RateCategory"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Rate category not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    delete:
      summary: Delete Rate Category
      operationId: deleteRateCategory
      tags:
        - Settings - Rate Categories
      parameters:
        - name: id
          in: path
          description: ID of the Rate Category
          required: true
          schema:
            type: string
      responses:
        "204":
          description: Rate category successfully deleted
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Rate category not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  /settings/rates:
    get:
      summary: List Rates
      operationId: listRates
      tags:
        - Settings - Rates
      responses:
        "200":
          description: List of rates
          content:
            application/json:
              schema:
                type: object
                properties:
                  totalRows:
                    type: number
                  rows:
                    type: array
                    items:
                      $ref: "#/components/schemas/Rate"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    post:
      summary: Create Rate
      operationId: createRate
      tags:
        - Settings - Rates
      requestBody:
        description: Data for creating a new rate
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Rate"
      responses:
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
        "501":
          description: Not Implemented - Rate creation requires complex document operations
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Rate creation not yet implemented
  "/settings/rates/{id}":
    get:
      summary: Retrieve Rate
      operationId: getRate
      tags:
        - Settings - Rates
      parameters:
        - name: id
          in: path
          description: ID of the Rate
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Details about the rate
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Rate"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Rate not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    put:
      summary: Update Rate
      operationId: updateRate
      tags:
        - Settings - Rates
      parameters:
        - name: id
          in: path
          description: ID of the Rate
          required: true
          schema:
            type: string
      requestBody:
        description: Updated rate data
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Rate"
      responses:
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Rate not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
        "501":
          description: Not Implemented - Rate updates require complex document operations
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Rate updates not yet implemented
    delete:
      summary: Delete Rate
      operationId: deleteRate
      tags:
        - Settings - Rates
      parameters:
        - name: id
          in: path
          description: ID of the Rate
          required: true
          schema:
            type: string
      responses:
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Rate not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
        "501":
          description: Not Implemented - Rate deletion requires complex document operations
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Rate deletion not yet implemented
  /settings/eventTypes:
    get:
      summary: List Event Types
      operationId: listEventTypes
      tags:
        - Settings - Event Types
      responses:
        "200":
          description: List of event types
          content:
            application/json:
              schema:
                type: object
                properties:
                  totalRows:
                    type: number
                  rows:
                    type: array
                    items:
                      $ref: "#/components/schemas/EventType"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    post:
      summary: Create Event Type
      operationId: createEventType
      tags:
        - Settings - Event Types
      requestBody:
        description: Data for creating a new event type
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                name:
                  type: string
                  description: The name of the event type.
              required:
                - name
              example:
                name: Consultation
      responses:
        "200":
          description: Successfully created event type
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EventType"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "409":
          description: Conflict - Event type already exists
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Event type already exists
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  "/settings/eventTypes/{id}":
    get:
      summary: Retrieve Event Type
      operationId: getEventType
      tags:
        - Settings - Event Types
      parameters:
        - name: id
          in: path
          description: ID of the Event Type
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Details about the event type
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EventType"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Event type not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    put:
      summary: Update Event Type
      operationId: updateEventType
      tags:
        - Settings - Event Types
      parameters:
        - name: id
          in: path
          description: ID of the Event Type
          required: true
          schema:
            type: string
      requestBody:
        description: Updated event type data
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/EventType"
      responses:
        "200":
          description: Successfully updated event type
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EventType"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Event type not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    delete:
      summary: Delete Event Type
      operationId: deleteEventType
      tags:
        - Settings - Event Types
      parameters:
        - name: id
          in: path
          description: ID of the Event Type
          required: true
          schema:
            type: string
      responses:
        "204":
          description: Event Type successfully deleted
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Event Type not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  /settings/areaLabels:
    get:
      summary: List Area Labels
      operationId: listAreaLabels
      tags:
        - Settings - Area Labels
      responses:
        "200":
          description: List of area labels
          content:
            application/json:
              schema:
                type: object
                properties:
                  totalRows:
                    type: number
                  rows:
                    type: array
                    items:
                      $ref: "#/components/schemas/AreaLabel"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    post:
      summary: Create Area Label
      operationId: createAreaLabel
      tags:
        - Settings - Area Labels
      requestBody:
        description: Data for creating a new area label
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                label:
                  type: string
                  description: The display name of the area label.
                active:
                  type: boolean
                  description: Whether this area label is active & usable
                quoteTypes:
                  type: array
                  items:
                    type: string
                  description: The quote types this area label applies to
              required:
                - label
              example:
                label: Living Room
                active: true
                quoteTypes:
                  - interior
                  - residential
      responses:
        "200":
          description: Successfully created area label
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AreaLabel"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "409":
          description: Conflict - Area label already exists
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Area label already exists
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  "/settings/areaLabels/{id}":
    get:
      summary: Retrieve Area Label
      operationId: getAreaLabel
      tags:
        - Settings - Area Labels
      parameters:
        - name: id
          in: path
          description: ID of the Area Label
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Details about the area label
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AreaLabel"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Area label not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    put:
      summary: Update Area Label
      operationId: updateAreaLabel
      tags:
        - Settings - Area Labels
      parameters:
        - name: id
          in: path
          description: ID of the Area Label
          required: true
          schema:
            type: string
      requestBody:
        description: Updated area label data
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AreaLabel"
      responses:
        "200":
          description: Successfully updated area label
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AreaLabel"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Area label not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    delete:
      summary: Delete Area Label
      operationId: deleteAreaLabel
      tags:
        - Settings - Area Labels
      parameters:
        - name: id
          in: path
          description: ID of the Area Label
          required: true
          schema:
            type: string
      responses:
        "204":
          description: Area label successfully deleted
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Area label not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  /settings/leadSources:
    get:
      summary: List Lead Sources
      operationId: listLeadSources
      tags:
        - Settings - Lead Sources
      responses:
        "200":
          description: List of lead sources
          content:
            application/json:
              schema:
                type: object
                properties:
                  totalRows:
                    type: number
                  rows:
                    type: array
                    items:
                      $ref: "#/components/schemas/LeadSource"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    post:
      summary: Create Lead Source
      operationId: createLeadSource
      tags:
        - Settings - Lead Sources
      requestBody:
        description: Data for creating a new lead source
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                name:
                  type: string
                  description: The name of the lead source.
              required:
                - name
              example:
                name: Charity Event
      responses:
        "200":
          description: Successfully created lead source
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LeadSource"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "409":
          description: Conflict - Lead source already exists
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Lead source already exists
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  "/settings/leadSources/{id}":
    get:
      summary: Retrieve Lead Source
      operationId: getLeadSource
      tags:
        - Settings - Lead Sources
      parameters:
        - name: id
          in: path
          description: ID of the Lead Source
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Details about the lead source
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LeadSource"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Lead source not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    put:
      summary: Update Lead Source
      operationId: updateLeadSource
      tags:
        - Settings - Lead Sources
      parameters:
        - name: id
          in: path
          description: ID of the Lead Source
          required: true
          schema:
            type: string
      requestBody:
        description: Updated lead source data
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/LeadSource"
      responses:
        "200":
          description: Successfully updated lead source
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LeadSource"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Event type not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    delete:
      summary: Delete Lead Source
      operationId: deleteLeadSource
      tags:
        - Settings - Lead Sources
      parameters:
        - name: id
          in: path
          description: ID of the Lead Source
          required: true
          schema:
            type: string
      responses:
        "204":
          description: Lead Source successfully deleted
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Lead Source not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  /settings/quoteTemplates:
    get:
      summary: List Quote Templates
      operationId: listQuoteTemplates
      tags:
        - Settings - Quote Templates
      responses:
        "200":
          description: List of quote templates
          content:
            application/json:
              schema:
                type: object
                properties:
                  totalRows:
                    type: number
                  rows:
                    type: array
                    items:
                      $ref: "#/components/schemas/QuoteTemplate"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  "/settings/quoteTemplates/{id}":
    get:
      summary: Retrieve Quote Template
      operationId: getQuoteTemplate
      tags:
        - Settings - Quote Templates
      parameters:
        - name: id
          in: path
          description: ID of the Quote Template
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Details about the template
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/QuoteTemplate"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Quote Template not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  /settings/stages:
    get:
      summary: List Stages
      operationId: listStages
      tags:
        - Settings - Stages
      responses:
        "200":
          description: List of stages
          content:
            application/json:
              schema:
                type: object
                properties:
                  totalRows:
                    type: number
                  rows:
                    type: array
                    items:
                      $ref: "#/components/schemas/Stage"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  "/settings/stages/{pipelineId}":
    get:
      summary: Retrieve Pipeline Stages
      operationId: getPipelineStages
      tags:
        - Settings - Pipeline Stages
      parameters:
        - name: pipelineId
          in: path
          description: ID of the Pipeline
          required: true
          schema:
            type: string
      responses:
        "200":
          description: List of stages for the pipeline
          content:
            application/json:
              schema:
                type: object
                properties:
                  totalRows:
                    type: number
                  rows:
                    type: array
                    items:
                      $ref: "#/components/schemas/Stage"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Pipeline not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  /settings/pipelines:
    get:
      summary: List Piplelines
      operationId: listPipelines
      tags:
        - Settings - Pipelines
      responses:
        "200":
          description: List of pipelines
          content:
            application/json:
              schema:
                type: object
                properties:
                  totalRows:
                    type: number
                  rows:
                    type: array
                    items:
                      $ref: "#/components/schemas/Pipeline"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  "/settings/pipelines/{id}":
    get:
      summary: Retrieve Pipeline
      operationId: getPipeline
      tags:
        - Settings - Pipelines
      parameters:
        - name: id
          in: path
          description: ID of the Pipeline
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Details about the pipeline
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Pipeline"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Pipeline not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  /settings/taxRates:
    get:
      summary: List Tax Rates
      operationId: listTaxRates
      tags:
        - Settings - Tax Rates
      responses:
        "200":
          description: List of tax rates
          content:
            application/json:
              schema:
                type: object
                properties:
                  totalRows:
                    type: number
                  rows:
                    type: array
                    items:
                      $ref: "#/components/schemas/TaxRate"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    post:
      summary: Create Tax Rate
      operationId: createTaxRate
      tags:
        - Settings - Tax Rates
      requestBody:
        description: Data for creating a new tax rate
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TaxRateCreate"
      responses:
        "200":
          description: Successfully created tax rate
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TaxRate"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "409":
          description: Conflict - Tax Rate already exists
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Tax rate already exists
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  "/settings/taxRates/{id}":
    get:
      summary: Retrieve Tax Rate
      operationId: getTaxRate
      tags:
        - Settings - Tax Rates
      parameters:
        - name: id
          in: path
          description: ID of the Tax Rate
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Details about the tax rate
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TaxRate"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - tax Rate not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    put:
      summary: Update Tax Rate
      operationId: updateTaxRate
      tags:
        - Settings - Tax Rates
      parameters:
        - name: id
          in: path
          description: ID of the Tax Rate
          required: true
          schema:
            type: string
      requestBody:
        description: Updated tax rate data
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TaxRate"
      responses:
        "200":
          description: Successfully updated tax rate
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TaxRate"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Tax rate not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    delete:
      summary: Delete Tax Rate
      operationId: deleteTaxRate
      tags:
        - Settings - Tax Rates
      parameters:
        - name: id
          in: path
          description: ID of the Tax Rate
          required: true
          schema:
            type: string
      responses:
        "204":
          description: Tax Rate successfully deleted
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Tax Rate not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  /settings/tags:
    get:
      summary: List Tags
      operationId: listTags
      tags:
        - Settings - Tags
      responses:
        "200":
          description: List of tags
          content:
            application/json:
              schema:
                type: object
                properties:
                  totalRows:
                    type: number
                  rows:
                    type: array
                    items:
                      $ref: "#/components/schemas/Tag"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    post:
      summary: Create Tag
      operationId: createTag
      tags:
        - Settings - Tags
      requestBody:
        description: Data for creating a new tag
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                label:
                  type: string
                  description: The display label of the tag.
                color:
                  type: string
                  description: The color of the tag (hex code).
              required:
                - label
              example:
                label: High Priority
                color: "#FF5733"
      responses:
        "200":
          description: Successfully created tag
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Tag"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "409":
          description: Conflict - Tag already exists
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Tag already exists
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  "/settings/tags/{id}":
    get:
      summary: Retrieve Tag
      operationId: getTag
      tags:
        - Settings - Tags
      parameters:
        - name: id
          in: path
          description: ID of the Tag
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Details about the tag
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Tag"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Tag not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    put:
      summary: Update Tag
      operationId: updateTag
      tags:
        - Settings - Tags
      parameters:
        - name: id
          in: path
          description: ID of the Tag
          required: true
          schema:
            type: string
      requestBody:
        description: Updated tag data
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Tag"
      responses:
        "200":
          description: Successfully updated tag
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Tag"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Tag not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    delete:
      summary: Delete Tag
      operationId: deleteTag
      tags:
        - Settings - Tags
      parameters:
        - name: id
          in: path
          description: ID of the Tag
          required: true
          schema:
            type: string
      responses:
        "204":
          description: Tag successfully deleted
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Tag not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  /tasks:
    get:
      summary: List Tasks
      operationId: listTasks
      tags:
        - Tasks
      parameters:
        - name: page
          in: query
          schema:
            type: integer
            format: int32
            minimum: 1
        - name: perPage
          in: query
          schema:
            type: integer
            format: int32
            minimum: 1
            maximum: 100
        - name: query
          in: query
          allowReserved: true
          schema:
            type: string
        - name: sort
          in: query
          schema:
            type: string
        - name: sortDir
          in: query
          schema:
            type: string
            enum:
              - asc
              - desc
      responses:
        "200":
          description: List of tasks
          content:
            application/json:
              schema:
                type: object
                properties:
                  totalRows:
                    type: number
                  page:
                    type: number
                  perPage:
                    type: number
                  rows:
                    type: array
                    items:
                      $ref: "#/components/schemas/Task"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    post:
      summary: Create Task
      operationId: createTask
      tags:
        - Tasks
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Task"
      responses:
        "200":
          description: Details about the new Task
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Task"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  "/tasks/{id}":
    get:
      summary: Retrieve Task
      operationId: getTask
      tags:
        - Tasks
      parameters:
        - name: id
          in: path
          description: ID of the Task
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Details about the task
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Task"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    put:
      summary: Update Task
      parameters:
        - name: id
          in: path
          description: ID of the Task
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                title:
                  type: string
                  nullable: false
                  description: The title of the Task.
                dealId:
                  type: string
                  nullable: false
                  description: The deal ID this task is associated with
                owner:
                  type: object
                  nullable: false
                  $ref: "#/components/schemas/Owner"
                notes:
                  type: string
                  nullable: true
                  description: A note about this task
                completed:
                  type: boolean
                  nullable: true
                  description: Whether the task has been completed
                timestamp:
                  type: object
                  nullable: false
                  $ref: "#/components/schemas/TaskTimestamp"
              required:
                - dealId
                - owner
              example:
                title: Make the call
                dealId: abcd1234-abcd-1234-abcd-abcd1234abcd
                notes: Call the client to see how everything is going.
                owner:
                  id: ownerid1234
                  firstName: John
                  lastName: Doe
                  email: johndoefake@fakemail.com
                timestamp:
                  start: 1672531200
      operationId: updateTask
      tags:
        - Tasks
      responses:
        "200":
          description: The updated task
          content:
            application/json:
              schema:
                additionalProperties: false
                $ref: "#/components/schemas/Task"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    delete:
      summary: Delete Task
      parameters:
        - name: id
          in: path
          description: ID of the Task
          required: true
          schema:
            type: string
      operationId: deleteTask
      tags:
        - Tasks
      responses:
        "204":
          description: No Content
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  /users:
    get:
      summary: List Users
      operationId: listUsers
      tags:
        - Users
      parameters:
        - name: page
          in: query
          schema:
            type: integer
            format: int32
            minimum: 1
        - name: perPage
          in: query
          schema:
            type: integer
            format: int32
            minimum: 1
            maximum: 100
        - name: query
          in: query
          allowReserved: true
          schema:
            type: string
        - name: sort
          in: query
          schema:
            type: string
        - name: sortDir
          in: query
          schema:
            type: string
            enum:
              - asc
              - desc
      responses:
        "200":
          description: List of users
          content:
            application/json:
              schema:
                type: object
                properties:
                  totalRows:
                    type: number
                  page:
                    type: number
                  perPage:
                    type: number
                  rows:
                    type: array
                    items:
                      $ref: "#/components/schemas/User"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  "/users/{id}":
    get:
      summary: Retrieve User
      operationId: getUser
      tags:
        - Users
      parameters:
        - name: id
          in: path
          description: ID of the User
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Details about the user
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/User"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  /files:
    post:
      summary: Create Files
      operationId: createFiles
      tags:
        - Files
      parameters:
        - name: docId
          in: query
          required: true
          schema:
            type: string
          description: The document ID to attach files to
        - name: docType
          in: query
          required: true
          schema:
            type: string
            enum:
              - deal
              - contact
              - company
          description: The document type (deal, contact, or company)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/FileCreate"
      responses:
        "200":
          description: Array of created files
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/File"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  /notes:
    post:
      summary: Create Note
      operationId: createNote
      tags:
        - Notes
      parameters:
        - name: docId
          in: query
          required: true
          schema:
            type: string
          description: The document ID
        - name: docType
          in: query
          required: true
          schema:
            type: string
          description: The document type
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Note"
      responses:
        "200":
          description: Details about the new Note
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Note"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  "/notes/{id}":
    get:
      summary: Retrieve Note
      operationId: getNote
      tags:
        - Notes
      parameters:
        - name: id
          in: path
          description: ID of the Note
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Details about the note
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Note"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  /webhooks:
    get:
      summary: List Webhooks
      operationId: listWebhooks
      tags:
        - Webhooks
      parameters:
        - name: page
          in: query
          schema:
            type: integer
            format: int32
        - name: perPage
          in: query
          schema:
            type: integer
            format: int32
      responses:
        "200":
          description: List of webhooks
          content:
            application/json:
              schema:
                type: object
                properties:
                  totalRows:
                    type: number
                  rows:
                    type: array
                    items:
                      type: object
                      additionalProperties: false
                      properties:
                        id:
                          type: string
                          description: A unique ID for the Webhook.
                        url:
                          type: string
                          description: The URL of the webhook, which will receive requests with data for
                            any events fired that fall within the events of the
                            Webhook.
                        events:
                          type: array
                          $ref: "#/components/schemas/Webhook/properties/events"
                        params:
                          type: object
                          nullable: true
                          additionalProperties: false
                          description: An optional object of key-value pairs used to customize webhook
                            trigger behavior.
                          properties:
                            isInvoice:
                              type: boolean
                              description: Whether or not the quote webhook is only to toggle for invoices.
                                Only applicable for quote-related webhooks.
                            quoteTypes:
                              type: array
                              description: A list of quote types (by Id or Label) to filter quote-related
                                webhooks. Only applicable for quote-related
                                webhooks.
                              items:
                                type: string
                            quoteStatus:
                              type: array
                              description: A list of quote statuses to filter quote-related webhooks. Only
                                applicable for quote or invoice related
                                webhooks.
                              items:
                                type: string
                            eventTypes:
                              type: array
                              description: A list of event types (by Id or Label) to filter event-created
                                webhooks. Only applicable for event-created
                                webhooks.
                              items:
                                type: string
                            stageIds:
                              type: array
                              description: A list of Deal Stage Ids to filter deal-stage-changed webhooks.
                              items:
                                type: string
                            tagsAdded:
                              type: array
                              description: A list of tags, if any of these tags are added to the entity, the
                                webhook will trigger.
                              items:
                                type: string
                            tagsRemoved:
                              type: array
                              description: A list of tags, if any of these tags are removed from the entity,
                                the webhook will trigger.
                              items:
                                type: string
                        token:
                          type: string
                          description: A string used to hash the webhook body for verification.
                        enabled:
                          type: boolean
                          description: Whether or not the Webhook is enabled/active.
                        timestamp:
                          $ref: "#/components/schemas/Timestamp"
                      required:
                        - id
                        - url
                        - events
                      example:
                        id: "42"
                        url: https://sweet-webhooks.com/my/webhook/endpoint
                        events:
                          - quote-sent
                          - quote-accepted
                        token: "123456"
                        enabled: true
                        timestamp:
                          created: 1490737206
                          updated: 1490737206
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    post:
      summary: Create Webhook
      operationId: createWebhook
      tags:
        - Webhooks
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Webhook"
      responses:
        "200":
          description: Details about the new Webhook
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Webhook"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
  "/webhooks/{id}":
    get:
      summary: Retrieve Webhook
      operationId: getWebhook
      tags:
        - Webhooks
      parameters:
        - name: id
          in: path
          description: ID of the Webhooks
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Details about the webhooks
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Webhook"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    put:
      summary: Update Webhook
      parameters:
        - name: id
          in: path
          description: ID of the Webhook
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Webhook"
      operationId: updateWebhook
      tags:
        - Webhooks
      responses:
        "200":
          description: The updated webhook
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Webhook"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
    delete:
      summary: Delete Webhook
      parameters:
        - name: id
          in: path
          description: ID of the Webhook
          required: true
          schema:
            type: string
      operationId: deleteWebhook
      tags:
        - Webhooks
      responses:
        "204":
          description: No Content
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Bad Request
        "401":
          description: Not Authorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Not Authorized
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - Record not found
        "500":
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                errors:
                  - An unexpected error occurred
components:
  schemas:
    Company:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          description: The unique ID of the Company. Ignord when creating & updating
            companies
        name:
          type: string
          nullable: true
          description: The Name of the Company.
        email:
          type: string
          nullable: true
          description: The email address of this Company
        phoneNumber:
          type: string
          nullable: true
          description: The phone number of this Company
        phoneNumberExt:
          type: string
          nullable: true
          description: The phone number extension of this Company
        address:
          type: string
          nullable: true
          description: The address of this Company
        city:
          type: string
          nullable: true
          description: The city of this Company
        state:
          type: string
          nullable: true
          description: The state of this Company
        zip:
          type: string
          nullable: true
          description: The zip or postal code of this Company
        leadSource:
          type: string
          nullable: true
          description: The lead source of this Company
        owner:
          type: object
          nullable: true
          $ref: "#/components/schemas/Owner"
        timestamp:
          $ref: "#/components/schemas/Timestamp"
        tags:
          type: array
          description: Tags associated with this Company
          items:
            type: string
      example:
        id: abcd1234-abcd-1234-abcd-abcd1234abcd
        name: Bobs Plumbing
        email: bob@bobsplumbing.com
        phoneNumber: "5551234567"
    CompanySearchResult:
      $ref: "#/components/schemas/Company"
    Contact:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          description: The unique ID of the Contact. Ignored when creating & updating
            contacts
        firstName:
          type: string
          nullable: true
          description: The First Name of the Contact.
        lastName:
          type: string
          nullable: true
          description: The Last Name of the Contact
        secondaryFirstName:
          type: string
          nullable: true
          description: The secondary First Name of the Contact
        secondaryLastName:
          type: string
          nullable: true
          description: The secondary Last Name of the Contact
        company:
          type: string
          nullable: true
          description: The name of the Company this Contact is associated with
        email:
          type: string
          nullable: true
          description: The email address of this Contact
        alternateEmail:
          type: string
          nullable: true
          description: The alternate email address of this Contact
        phoneNumber:
          type: string
          nullable: true
          description: The phone number of this Contact
        phoneNumberExt:
          type: string
          nullable: true
          description: The phone number extension of this Contact
        alternatePhoneNumber:
          type: string
          nullable: true
          description: The alternate phone number of this Contact
        alternatePhoneNumberExt:
          type: string
          nullable: true
          description: The alternate phone number extension of this Contact
        preferredContactMethod:
          type: string
          nullable: true
          description: The preferred contact method for this Contact
        address:
          type: string
          nullable: true
          description: The address of this Contact
        city:
          type: string
          nullable: true
          description: The city of this Contact
        state:
          type: string
          nullable: true
          description: The state of this Contact
        zip:
          type: string
          nullable: true
          description: The zip or postal code of this Contact
        leadSource:
          type: string
          nullable: true
          description: The lead source of this Contact
        source:
          $ref: "#/components/schemas/Source"
        owner:
          type: object
          nullable: true
          $ref: "#/components/schemas/Owner"
        timestamp:
          $ref: "#/components/schemas/Timestamp"
        note:
          type: string
          nullable: true
          description: A note about this Contact
        tags:
          type: array
          description: Tags associated with this Contact
          items:
            type: string
      example:
        id: abcd1234-abcd-1234-abcd-abcd1234abcd
        firstName: Bob
        lastName: Johnson
        company: Johnson Construction
        email: bob@johnsonconstruction.com
        phoneNumber: "5551234567"
    ContactSearchResult:
      $ref: "#/components/schemas/Contact"
    Deal:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          format: uuid
          description: The unique ID for the Deal. Ignored when creating & updating deals.
        name:
          type: string
          nullable: true
          description: The Name of the Deal.
        contact:
          type: object
          nullable: false
          description: Contact details to create inline with the Deal
          $ref: "#/components/schemas/Contact"
        jobAddress:
          type: object
          nullable: true
          additionalProperties: false
          description: The Job Address of this Deal
          properties:
            address:
              type: string
              nullable: true
              description: The address component of the job address
            city:
              type: string
              nullable: true
              description: The city component of the job address
            state:
              type: string
              nullable: true
              description: The state component of the job address
            zip:
              type: string
              nullable: true
              description: The zip code component of the job address
        pipeline:
          type: string
          nullable: true
          description: The pipeline this Deal is in
        stage:
          type: string
          nullable: true
          description: The stage of the pipeline this Deal is in
        value:
          type: number
          format: float
          nullable: true
          description: The monetary value of this Deal
        leadSource:
          type: string
          nullable: true
          description: The lead source of this Deal
        owner:
          type: object
          nullable: true
          $ref: "#/components/schemas/Owner"
        timestamp:
          $ref: "#/components/schemas/Timestamp"
        tags:
          type: array
          description: Tags associated with this Deal
          items:
            type: string
        quoteType:
          type: object
          nullable: true
          additionalProperties: false
          description: The Quote Type associated with this Deal
          properties:
            id:
              type: string
              description: The unique ID of the Quote Type
            label:
              type: string
              description: The display label of the Quote Type
        linkedEstimateIds:
          type: array
          description: List of linked Estimate IDs
          items:
            type: string
        linkedInvoiceIds:
          type: array
          description: List of linked Invoice IDs
          items:
            type: string
      example:
        id: abcd1234-abcd-1234-abcd-abcd1234abcd
        name: New Deal
        contact:
          firstName: Alice
          lastName: Smith
          email: aliceemail@fakemail.com
        jobAddress:
          address: 123 Main St
          city: Springfield
          state: IL
          zip: "62701"
        pipeline: sales-pipeline
        stage: initial-contact
        leadSource: Website
        linkedEstimateIds:
          - estimate-123
        linkedInvoiceIds:
          - invoice-321
    DealSearchResult:
      $ref: "#/components/schemas/Deal"
    Event:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          nullable: false
          description: The unique ID of the Event. Ignored when creating new events.
        eventType:
          type: string
          nullable: false
          description: The type of Event.
        dealId:
          type: string
          nullable: false
          description: The deal ID this event is associated with
        address:
          type: string
          nullable: true
          description: The address
        note:
          type: string
          nullable: true
          description: A note about this event
        canceled:
          type: boolean
          nullable: true
          description: Whether the event has been canceled
        owner:
          type: object
          nullable: true
          $ref: "#/components/schemas/Owner"
        timestamp:
          type: object
          additionalProperties: false
          properties:
            created:
              type: number
              description: The timestamp when this entity was created
            updated:
              type: number
              description: The timestamp when this entity was last updated
            start:
              type: number
              description: The timestamp when this event is scheduled to start
            end:
              type: number
              description: The timestamp when this event is scheduled to end
          example:
            created: 1234567890
            updated: 1234567890
            start: 1234567890
            end: 1234567890
      example:
        id: f123453-abcd-1234-abcd-122233324989
        eventType: follow-up
        dealId: abcd1234-abcd-1234-abcd-abcd1234abcd
        address: 123 Main St, Springfield, IL 62701
        note: Follow up with the client to discuss project details.
        canceled: false
        owner:
          id: ownerid1234
          firstName: John
          lastName: Doe
          email: johndoefake@fakemail.com
        timestamp:
          created: 1234567890
          updated: 1234567890
          start: 1234567890
          end: 1234567890
    EventSearchResult:
      $ref: "#/components/schemas/Event"
    Quote:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          description: A unique ID for the Quote. Ignored when creating & updating quotes
        number:
          type: number
          description: The Number of the Quote
        status:
          type: string
          nullable: true
          description: The status of this quote
        hourlyRate:
          type: number
          description: The Hourly Rate of the Quote
        contactId:
          type: string
          nullable: true
          deprecated: true
          description: This field is deprecated. Use contact.id instead.
        contact:
          $ref: "#/components/schemas/Contact"
        billingContact:
          $ref: "#/components/schemas/Contact"
        dates:
          type: object
          additionalProperties: false
          description: important dates about this quote
          properties:
            quote:
              type: number
              description: The date the quote was create
            sent:
              type: number
              description: The date the quote was most recently sent
            viewed:
              type: number
              description: The date the quote was most recently viewed
            accepted:
              type: number
              description: The date the quote was accepted
            declined:
              type: number
              description: The date the quote was declined
        jobAddress:
          type: object
          additionalProperties: false
          description: The Job Address/Identifier of this quote
          properties:
            identifier:
              type: string
              nullable: true
              description: The free-form job identifier of this quote
            address:
              type: string
              nullable: true
              description: The address component of the job address
            city:
              type: string
              nullable: true
              description: The city component of the job address
            state:
              type: string
              nullable: true
              description: The state component of the job address
            zip:
              type: string
              nullable: true
              description: The zip code component of the job address
        parentQuoteId:
          type: string
          nullable: true
          description: The unique ID of the parent quote if this quote was created from
            another quote
        parentQuoteNumber:
          type: number
          description: The quote number of the parent quote if this quote was created from
            another quote
        childInvoiceId:
          type: string
          nullable: true
          description: The unique ID of the invoice created from this quote if available
        dealId:
          type: string
          nullable: true
          description: The unique ID of the deal associated with this quote
        leadSource:
          type: string
          nullable: true
          description: The lead source of this quote
        quoteType:
          type: object
          additionalProperties: false
          description: The Quote Type of this quote
          properties:
            id:
              type: string
              nullable: true
              description: The unique ID of the Quote Type
            value:
              type: string
              nullable: true
              deprecated: true
              description: This field is deprecated. Use quoteType.id instead
            label:
              type: string
              nullable: true
              description: The text used to describe this Quote Type
        quoteTypeId:
          type: string
          nullable: true
          deprecated: true
          description: This field is deprecated. Use quoteType.id instead
        quoteTemplate:
          type: object
          additionalProperties: false
          description: The Quote Template that was made to use this quote
          properties:
            id:
              type: string
              nullable: true
              description: The unique ID of the Quote Template
            value:
              type: string
              nullable: true
              deprecated: true
              description: This field is deprecated. Use quoteType.id instead
            label:
              type: string
              nullable: true
              description: The label of the Quote Template
        quoteTemplateId:
          type: string
          nullable: true
          deprecated: true
          description: This field is deprecated. Use quoteTemplate.id instead
        payments:
          type: array
          description: Payments applied to this quote
          items:
            $ref: "#/components/schemas/Payment"
        totalAdjustment:
          type: object
          additionalProperties: false
          description: The manual total adjustment applied to the quote
          properties:
            rate:
              type: number
              description: The percentage of the adjustment. Omitted if the adjustment is not
                a percentage
            total:
              type: number
              description: The calculated amount of the adjustment of the sub-total
            description:
              type: string
              nullable: true
              description: The description of the adjustment
        discount:
          type: object
          additionalProperties: false
          description: The discount applied to the quote
          properties:
            rate:
              type: number
              description: The percentage of the discount. Omitted if the discount is not a
                percentage
            total:
              type: number
              description: The calculated amount of the discount of the sub-total
            description:
              type: string
              nullable: true
              description: The description of the discount
        tax:
          type: object
          additionalProperties: false
          description: The tax applied to the quote
          properties:
            rate:
              type: number
              description: The percentage rate of tax
            total:
              type: number
              description: The total amount of tax applied
            description:
              type: string
              nullable: true
              description: The description of the tax
            details:
              type: array
              description: The detailed tax breakdown by rate
              items:
                type: object
                additionalProperties: false
                properties:
                  key:
                    type: string
                    nullable: true
                    description: The id of the tax rate
                  rate:
                    type: number
                    description: The percentage rate of tax
                  description:
                    type: string
                    nullable: true
                    description: The description of the tax rate
        terms:
          type: string
          nullable: true
          description: The terms/contract associated with this quote
        estimatorNotes:
          type: string
          nullable: true
          description: The estimator notes associated with this quote
        clientNote:
          type: string
          nullable: true
          description: The client note associated with this quote
        crewNote:
          type: string
          nullable: true
          description: The crew note associated with this quote
        totals:
          type: object
          additionalProperties: false
          description: The totals of the quote
          properties:
            price:
              type: number
              description: The sub-total price of the quote
            laborPrice:
              type: number
              description: The labor component of the sub-total
            materialsPrice:
              type: number
              description: The materials component of the sub-total
            additionalWorkLaborPrice:
              type: number
              description: The additional work labor component of the total
            additionalWorkMaterialsPrice:
              type: number
              description: The additional work materials component of the total
            afterAdjustment:
              type: number
              description: The price after sub-total adjustment of the quote
            afterDiscount:
              type: number
              description: The price after discount of the quote
            afterTax:
              type: number
              description: The after tax price of the quote
            hours:
              type: number
              description: The number of hours of the quote
        urls:
          type: object
          additionalProperties: false
          description: Customer-View Links to this quote and work order
          properties:
            quote:
              type: string
              description: A link to this quote
            workOrder:
              type: string
              description: A link to this work order
        source:
          $ref: "#/components/schemas/Source"
        owner:
          $ref: "#/components/schemas/Owner"
        timestamp:
          $ref: "#/components/schemas/Timestamp"
        tags:
          type: array
          description: Tags associated with this Quote
          items:
            type: string
        tagDetails:
          type: array
          description: Detailed tag information associated with this Quote
          items:
            $ref: "#/components/schemas/TagDetail"
      example:
        id: abcd1234-abcd-1234-abcd-abcd1234abcd
        number: 234
        hourlyRate: 65.5
    QuoteUpdate:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          description: A unique ID for the Quote. Ignored when creating & updating quotes
        number:
          type: number
          description: The Number of the Quote
        status:
          type: string
          nullable: true
          description: The status of this quote
        hourlyRate:
          type: number
          description: The Hourly Rate of the Quote
        contactId:
          type: string
          nullable: true
          deprecated: true
          description: This field is deprecated. Use contact.id instead.
        contact:
          $ref: "#/components/schemas/Contact"
        billingContact:
          $ref: "#/components/schemas/Contact"
        dates:
          type: object
          additionalProperties: false
          description: important dates about this quote
          properties:
            quote:
              type: number
              description: The date the quote was create
            sent:
              type: number
              description: The date the quote was most recently sent
            viewed:
              type: number
              description: The date the quote was most recently viewed
            accepted:
              type: number
              description: The date the quote was accepted
            declined:
              type: number
              description: The date the quote was declined
        jobAddress:
          type: object
          additionalProperties: false
          description: The Job Address/Identifier of this quote
          properties:
            identifier:
              type: string
              nullable: true
              description: The free-form job identifier of this quote
            address:
              type: string
              nullable: true
              description: The address component of the job address
            city:
              type: string
              nullable: true
              description: The city component of the job address
            state:
              type: string
              nullable: true
              description: The state component of the job address
            zip:
              type: string
              nullable: true
              description: The zip code component of the job address
        parentQuoteId:
          type: string
          nullable: true
          description: The unique ID of the parent quote if this quote was created from
            another quote
        parentQuoteNumber:
          type: number
          description: The quote number of the parent quote if this quote was created from
            another quote
        childInvoiceId:
          type: string
          nullable: true
          description: The unique ID of the invoice created from this quote if available
        dealId:
          type: string
          nullable: true
          description: The unique ID of the deal associated with this quote
        leadSource:
          type: string
          nullable: true
          description: The lead source of this quote
        quoteType:
          type: object
          additionalProperties: false
          description: The Quote Type of this quote
          properties:
            id:
              type: string
              nullable: true
              description: The unique ID of the Quote Type
            value:
              type: string
              nullable: true
              deprecated: true
              description: This field is deprecated. Use quoteType.id instead
            label:
              type: string
              nullable: true
              description: The text used to describe this Quote Type
        quoteTypeId:
          type: string
          nullable: true
          deprecated: true
          description: This field is deprecated. Use quoteType.id instead
        quoteTemplate:
          type: object
          additionalProperties: false
          description: The Quote Template that was made to use this quote
          properties:
            id:
              type: string
              nullable: true
              description: The unique ID of the Quote Template
            value:
              type: string
              nullable: true
              deprecated: true
              description: This field is deprecated. Use quoteType.id instead
            label:
              type: string
              nullable: true
              description: The label of the Quote Template
        quoteTemplateId:
          type: string
          nullable: true
          deprecated: true
          description: This field is deprecated. Use quoteTemplate.id instead
        totalAdjustment:
          type: object
          additionalProperties: false
          description: The manual total adjustment applied to the quote
          properties:
            rate:
              type: number
              description: The percentage of the adjustment. Omitted if the adjustment is not
                a percentage
            total:
              type: number
              description: The calculated amount of the adjustment of the sub-total
            description:
              type: string
              nullable: true
              description: The description of the adjustment
        discount:
          type: object
          additionalProperties: false
          description: The discount applied to the quote
          properties:
            rate:
              type: number
              description: The percentage of the discount. Omitted if the discount is not a
                percentage
            total:
              type: number
              description: The calculated amount of the discount of the sub-total
            description:
              type: string
              nullable: true
              description: The description of the discount
        tax:
          type: object
          additionalProperties: false
          description: The tax applied to the quote
          properties:
            rate:
              type: number
              description: The percentage rate of tax
            total:
              type: number
              description: The total amount of tax applied
            description:
              type: string
              nullable: true
              description: The description of the tax
            details:
              type: array
              description: The detailed tax breakdown by rate
              items:
                type: object
                additionalProperties: false
                properties:
                  key:
                    type: string
                    nullable: true
                    description: The id of the tax rate
                  rate:
                    type: number
                    description: The percentage rate of tax
                  description:
                    type: string
                    nullable: true
                    description: The description of the tax rate
        terms:
          type: string
          nullable: true
          description: The terms/contract associated with this quote
        estimatorNotes:
          type: string
          nullable: true
          description: The estimator notes associated with this quote
        clientNote:
          type: string
          nullable: true
          description: The client note associated with this quote
        crewNote:
          type: string
          nullable: true
          description: The crew note associated with this quote
        totals:
          type: object
          additionalProperties: false
          description: The totals of the quote
          properties:
            price:
              type: number
              description: The sub-total price of the quote
            laborPrice:
              type: number
              description: The labor component of the sub-total
            materialsPrice:
              type: number
              description: The materials component of the sub-total
            additionalWorkLaborPrice:
              type: number
              description: The additional work labor component of the total
            additionalWorkMaterialsPrice:
              type: number
              description: The additional work materials component of the total
            afterAdjustment:
              type: number
              description: The price after sub-total adjustment of the quote
            afterDiscount:
              type: number
              description: The price after discount of the quote
            afterTax:
              type: number
              description: The after tax price of the quote
            hours:
              type: number
              description: The number of hours of the quote
        urls:
          type: object
          additionalProperties: false
          description: Customer-View Links to this quote and work order
          properties:
            quote:
              type: string
              description: A link to this quote
            workOrder:
              type: string
              description: A link to this work order
        source:
          $ref: "#/components/schemas/Source"
        owner:
          $ref: "#/components/schemas/Owner"
        timestamp:
          $ref: "#/components/schemas/Timestamp"
        tags:
          type: array
          description: Tags associated with this Quote
          items:
            type: string
        tagDetails:
          type: array
          description: Detailed tag information associated with this Quote
          items:
            $ref: "#/components/schemas/TagDetail"
    QuoteItem:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          description: Unique identifier for the quote item
        name:
          type: string
          description: The title/name for this item
        quoteType:
          type: string
          description: The quote type this item applies to
        description:
          type: string
          description: The plain text description for this item
        descriptionHtml:
          type: string
          description: The HTML formatted description for this item
        price:
          type: number
          description: The total price for this item
        hours:
          type: number
          description: The estimated hours for this item
        quantity:
          type: number
          description: The quantity of this item
        pricePerUnit:
          type: number
          description: The price per unit if quantity-based pricing
        calculateBy:
          type: string
          enum:
            - none
            - hourlyRate
            - quantity
          description: How price/hours are computed for this item
        files:
          type: array
          description: Files attached to this item
          items:
            type: object
            properties:
              key:
                type: string
                description: Unique identifier for the file
              src:
                type: string
                description: URL or path to the file
              title:
                type: string
                description: Title of the file
              caption:
                type: string
                description: Caption or description of the file
        source:
          type: object
          description: External source information if item is from external system
          properties:
            provider:
              type: string
              description: The provider/system name
            id:
              type: string
              description: External system ID
            value:
              type: string
              description: External system value
            label:
              type: string
              description: External system label
        section:
          type: string
          enum:
            - bid
            - options
            - archived
            - additional
            - pending
          description: The section this item belongs to
          default: bid
      required:
        - name
        - price
      example:
        name: Interior Wall Painting
        quoteType: interior
        description: Professional interior wall painting with premium paint
        descriptionHtml: <p>Professional interior wall painting with <strong>premium
          paint</strong></p>
        price: 1245.5
        hours: 8.5
        quantity: 1
        files: []
        source:
          provider: paintscout
          id: rate-001
          value: interior-walls
          label: Interior Wall Painting Rate
    QuoteItemCreate:
      type: object
      additionalProperties: false
      properties:
        name:
          type: string
          description: The title/name for this item
        quoteType:
          type: string
          description: The quote type this item applies to
        description:
          type: string
          description: The plain text description for this item
        descriptionHtml:
          type: string
          description: The HTML formatted description for this item
        price:
          type: number
          description: The total price for this item
        hours:
          type: number
          description: The estimated hours for this item
        quantity:
          type: number
          description: The quantity of this item
        pricePerUnit:
          type: number
          description: The price per unit if quantity-based pricing
        calculateBy:
          type: string
          enum:
            - none
            - hourlyRate
            - quantity
          description: How price/hours are computed
        files:
          type: array
          description: Files attached to this item
          items:
            type: object
            required:
              - src
            properties:
              key:
                type: string
                description: Optional existing file key to reuse. If omitted, a new file is
                  added.
              src:
                type: string
                description: URL of the file
              title:
                type: string
                description: Title of the file
              caption:
                type: string
                description: Caption or description of the file
        source:
          type: object
          description: External source information if item is from external system
          properties:
            provider:
              type: string
              description: The provider/system name
            id:
              type: string
              description: External system ID
            value:
              type: string
              description: External system value
            label:
              type: string
              description: External system label
        section:
          type: string
          enum:
            - bid
            - options
            - archived
            - additional
            - pending
          description: The section this item belongs to
          default: bid
      required:
        - name
        - price
      example:
        name: Interior Wall Painting
        quoteType: interior
        description: Professional interior wall painting with premium paint
        descriptionHtml: <p>Professional interior wall painting with <strong>premium
          paint</strong></p>
        price: 1245.5
        hours: 8.5
        quantity: 1
        files: []
        source:
          provider: paintscout
          id: rate-001
          value: interior-walls
          label: Interior Wall Painting Rate
    QuoteItemUpdate:
      type: object
      additionalProperties: false
      description: >
        Updates a quote item. The `{itemId}` path parameter may refer to either
        a line item or

        an area (both are returned by `GET /v2/quotes/{id}/items`). Fields like `price`,

        `hours`, `quantity`, `pricePerUnit`, and `calculateBy` apply only to line items;

        for areas, those fields are ignored (areas calculate from their substrates).
      properties:
        name:
          type: string
          description: The title/name for this item
        quoteType:
          type: string
          description: The quote type this item applies to
        description:
          type: string
          description: The plain text description for this item
        descriptionHtml:
          type: string
          description: The HTML formatted description for this item (preferred over
            `description` when both are sent)
        price:
          type: number
          description: The total price for this item (line items only)
        hours:
          type: number
          description: The estimated hours for this item (line items only)
        quantity:
          type: number
          description: The quantity of this item (line items only)
        pricePerUnit:
          type: number
          description: The price per unit if quantity-based pricing (line items only)
        calculateBy:
          type: string
          enum:
            - none
            - hourlyRate
            - quantity
          description: How price/hours are computed (line items only)
        files:
          type: array
          description: Files attached to this item. Replaces the existing list — send `[]`
            to clear.
          items:
            type: object
            required:
              - src
            properties:
              key:
                type: string
                description: Existing file key to reuse. If omitted, a new file is added.
              src:
                type: string
                description: URL of the file
              title:
                type: string
                description: Title of the file
              caption:
                type: string
                description: Caption or description of the file
        source:
          type: object
          description: External source information if item is from external system (line
            items only)
          properties:
            provider:
              type: string
              description: The provider/system name
            id:
              type: string
              description: External system ID
            value:
              type: string
              description: External system value
            label:
              type: string
              description: External system label
        section:
          type: string
          enum:
            - bid
            - options
            - archived
            - additional
            - pending
          description: The section this item belongs to. Setting this moves the item.
      example:
        price: 1500
        quantity: 2
        description: Updated description for the item
    QuoteSearchResult:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          nullable: false
          description: A unique ID for the Quote.
        number:
          type: number
          description: The Number of the Quote
        status:
          type: string
          description: The status of this quote
        hourlyRate:
          type: number
          description: The Hourly Rate of the Quote
        contactId:
          type: string
          deprecated: true
          description: This field is deprecated. Use contact.id instead
        contact:
          $ref: "#/components/schemas/Contact"
        billingContact:
          $ref: "#/components/schemas/Contact"
        dates:
          type: object
          additionalProperties: false
          description: important dates about this quote
          properties:
            quote:
              type: number
              description: The date the quote was create
            sent:
              type: number
              description: The date the quote was most recently sent
            viewed:
              type: number
              description: The date the quote was most recently viewed
            accepted:
              type: number
              description: The date the quote was accepted
            declined:
              type: number
              description: The date the quote was declined
        jobAddress:
          type: object
          additionalProperties: false
          description: The Job Address/Identifier of this quote
          properties:
            identifier:
              type: string
              description: The free-form job identifier of this quote
            address:
              type: string
              description: The address component of the job address
            city:
              type: string
              description: The city component of the job address
            state:
              type: string
              description: The state component of the job address
            zip:
              type: string
              description: The zip code component of the job address
        childInvoiceId:
          type: string
          description: The unique ID of the invoice created from this quote if available
        quoteType:
          type: object
          additionalProperties: false
          description: The Quote Type of this quote
          properties:
            id:
              type: string
              description: The unique ID of the Quote Type
            value:
              type: string
              deprecated: true
              description: This field is deprecated. Use quoteType.id instead
            label:
              type: string
              description: The text used to describe this Quote Type
        quoteTypeId:
          type: string
          deprecated: true
          description: This field is deprecated. Use quoteType.id instead
        quoteTemplate:
          type: object
          additionalProperties: false
          description: The Quote Template that was made to use this quote
          properties:
            id:
              type: string
              description: The unique ID of the Quote Template
            value:
              type: string
              deprecated: true
              description: This field is deprecated. Use quoteTemplate.id instead
            label:
              type: string
              description: The label of the Quote Template
        quoteTemplateId:
          type: string
          deprecated: true
          description: This field is deprecated. Use quoteTemplate.id instead
        dealId:
          type: string
          description: The unique ID of the deal associated with this quote
        totalAdjustment:
          type: object
          additionalProperties: false
          description: The manual total adjustment applied to the quote
          properties:
            rate:
              type: number
              description: The percentage of the adjustment. Omitted if the adjustment is not
                a percentage
            total:
              type: number
              description: The calculated amount of the adjustment of the sub-total
            description:
              type: string
              description: The description of the adjustment
        discount:
          type: object
          additionalProperties: false
          description: The discount applied to the quote
          properties:
            rate:
              type: number
              description: The percentage of the discount. Omitted if the discount is not a
                percentage
            total:
              type: number
              description: The calculated amount of the discount of the sub-total
            description:
              type: string
              description: The description of the discount
        tax:
          type: object
          additionalProperties: false
          description: The tax applied to the quote
          properties:
            rate:
              type: number
              description: The percentage rate of tax
            total:
              type: number
              description: The total amount of tax applied
            description:
              type: string
              description: The description of the tax
        totals:
          type: object
          additionalProperties: false
          description: The totals of the quote
          properties:
            price:
              type: number
              description: The sub-total price of the quote
            laborPrice:
              type: number
              description: The labor component of the sub-total
            materialsPrice:
              type: number
              description: The materials component of the sub-total
            additionalWorkLaborPrice:
              type: number
              description: The additional work labor component of the total
            additionalWorkMaterialsPrice:
              type: number
              description: The additional work materials component of the total
            afterAdjustment:
              type: number
              description: The price after sub-total adjustment of the quote
            afterDiscount:
              type: number
              description: The price after discount of the quote
            afterTax:
              type: number
              description: The after tax price of the quote
            hours:
              type: number
              description: The number of hours of the quote
        source:
          $ref: "#/components/schemas/Source"
        owner:
          $ref: "#/components/schemas/Owner"
        timestamp:
          $ref: "#/components/schemas/Timestamp"
        tags:
          type: array
          description: Tags associated with this Quote
          items:
            type: string
        tagDetails:
          type: array
          description: Detailed tag information associated with this Quote
          items:
            $ref: "#/components/schemas/TagDetail"
      example:
        id: abcd1234-abcd-1234-abcd-abcd1234abcd
        number: 234
        hourlyRate: 65.5
    Invoice:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          nullable: false
          description: A unique ID for the Invoice. Ignored when creating & updating
            invoices.
        number:
          type: number
          description: The Number of the Invoice
        status:
          type: string
          nullable: true
          description: The status of this invoice
        hourlyRate:
          type: number
          description: The Hourly Rate of the Invoice
        contactId:
          type: string
          nullable: true
          deprecated: true
          description: This field is deprecated. Use contact.id instead
        contact:
          $ref: "#/components/schemas/Contact"
        billingContact:
          $ref: "#/components/schemas/Contact"
        dates:
          type: object
          additionalProperties: false
          description: important dates about this invoice
          properties:
            quote:
              type: number
              description: The date the invoice was created
            sent:
              type: number
              description: The date the invoice was most recently sent
            viewed:
              type: number
              description: The date the invoice was most recently viewed
            accepted:
              type: number
              description: The date the invoice was accepted
            declined:
              type: number
              description: The date the invoice was declined
        jobAddress:
          type: object
          additionalProperties: false
          description: The Job Address/Identifier of this invoice
          properties:
            identifier:
              type: string
              nullable: true
              description: The free-form job identifier of this invoice
            address:
              type: string
              nullable: true
              description: The address component of the job address
            city:
              type: string
              nullable: true
              description: The city component of the job address
            state:
              type: string
              nullable: true
              description: The state component of the job address
            zip:
              type: string
              nullable: true
              description: The zip code component of the job address
        parentQuoteId:
          type: string
          nullable: true
          description: The unique ID of the quote that this invoice was created from if
            available
        parentQuoteNumber:
          type: number
          description: The quote number of the quote that this invoice was created from if
            available
        dealId:
          type: string
          nullable: true
          description: The unique ID of the deal associated with this invoice
        quoteTypeId:
          type: string
          nullable: true
          deprecated: true
          description: This field is deprecated. Use quoteType.id instead
        quoteType:
          type: object
          additionalProperties: false
          description: The Invoice Type of this invoice
          properties:
            id:
              type: string
              nullable: true
              description: The unique ID of the Invoice Type
            value:
              type: string
              nullable: true
              deprecated: true
              description: This field is deprecated. Use quoteType.id instead
            label:
              type: string
              nullable: true
              description: The text used to describe this Invoice Type
        quoteTemplateId:
          type: string
          nullable: true
          deprecated: true
          description: This field is deprecated. Use quoteTemplate.id instead
        quoteTemplate:
          type: object
          additionalProperties: false
          description: The Invoice Template that was made to use this invoice
          properties:
            id:
              type: string
              nullable: true
              description: The unique ID of the Invoice Template
            value:
              type: string
              nullable: true
              deprecated: true
              description: This field is deprecated. Use quoteTemplate.id instead
            label:
              type: string
              nullable: true
              description: The label of the Invoice Template
        items:
          type: array
          description: The items that make up this invoice
          items:
            $ref: "#/components/schemas/InvoiceItem"
        payments:
          type: array
          description: Payments applied to this invoice
          items:
            $ref: "#/components/schemas/Payment"
        totalAdjustment:
          type: object
          additionalProperties: false
          description: The manual total adjustment applied to the invoice
          properties:
            rate:
              type: number
              description: The percentage of the adjustment. Omitted if the adjustment is not
                a percentage
            total:
              type: number
              description: The calculated amount of the adjustment of the sub-total
            description:
              type: string
              nullable: true
              description: The description of the adjustment
        discount:
          type: object
          additionalProperties: false
          description: The discount applied to the invoice
          properties:
            rate:
              type: number
              description: The percentage of the discount. Omitted if the discount is not a
                percentage
            total:
              type: number
              description: The calculated amount of the discount of the sub-total
            description:
              type: string
              nullable: true
              description: The description of the discount
        tax:
          type: object
          additionalProperties: false
          description: The tax applied to the invoice
          properties:
            rate:
              type: number
              description: The percentage rate of tax
            total:
              type: number
              description: The total amount of tax applied
            description:
              type: string
              nullable: true
              description: The description of the tax
            details:
              type: array
              description: The detailed tax breakdown by rate
              items:
                type: object
                additionalProperties: false
                properties:
                  rate:
                    type: number
                    description: The percentage rate of tax
                  total:
                    type: number
                    description: The total amount of tax applied at this rate
                  description:
                    type: string
                    nullable: true
                    description: The description of the tax at this rate
        terms:
          type: string
          nullable: true
          description: The terms/contract associated with this invoice
        estimatorNotes:
          type: string
          nullable: true
          description: The estimator notes associated with this invoice
        clientNote:
          type: string
          nullable: true
          description: The client note associated with this invoice
        crewNote:
          type: string
          nullable: true
          description: The crew note associated with this invoice
        totals:
          type: object
          additionalProperties: false
          description: The totals of the invoice
          properties:
            price:
              type: number
              description: The sub-total price of the invoice
            laborPrice:
              type: number
              description: The labor component of the sub-total
            materialsPrice:
              type: number
              description: The materials component of the sub-total
            additionalWorkLaborPrice:
              type: number
              description: The additional work labor component of the total
            additionalWorkMaterialsPrice:
              type: number
              description: The additional work materials component of the total
            afterAdjustment:
              type: number
              description: The price after sub-total adjustment of the invoice
            afterDiscount:
              type: number
              description: The price after discount of the invoice
            afterTax:
              type: number
              description: The after tax price of the invoice
            hours:
              type: number
              description: The number of hours of the invoice
        urls:
          type: object
          additionalProperties: false
          description: Customer-View Links to this invoice and work order
          properties:
            invoice:
              type: string
              description: A link to this invoice
            workOrder:
              type: string
              description: A link to this work order
        source:
          $ref: "#/components/schemas/Source"
        owner:
          $ref: "#/components/schemas/Owner"
        timestamp:
          $ref: "#/components/schemas/Timestamp"
        tags:
          type: array
          description: Tags associated with this Invoice
          items:
            type: string
        tagDetails:
          type: array
          description: Detailed tag information associated with this Quote
          items:
            $ref: "#/components/schemas/TagDetail"
      example:
        id: abcd1234-abcd-1234-abcd-abcd1234abcd
        number: 234
        hourlyRate: 65.5
    InvoiceUpdate:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          nullable: false
          description: A unique ID for the Invoice. Ignored when creating & updating
            invoices.
        number:
          type: number
          description: The Number of the Invoice
        status:
          type: string
          nullable: true
          description: The status of this invoice
        hourlyRate:
          type: number
          description: The Hourly Rate of the Invoice
        contactId:
          type: string
          nullable: true
          deprecated: true
          description: This field is deprecated. Use contact.id instead
        contact:
          $ref: "#/components/schemas/Contact"
        billingContact:
          $ref: "#/components/schemas/Contact"
        dates:
          type: object
          additionalProperties: false
          description: important dates about this invoice
          properties:
            quote:
              type: number
              description: The date the invoice was created
            sent:
              type: number
              description: The date the invoice was most recently sent
            viewed:
              type: number
              description: The date the invoice was most recently viewed
            accepted:
              type: number
              description: The date the invoice was accepted
            declined:
              type: number
              description: The date the invoice was declined
        jobAddress:
          type: object
          additionalProperties: false
          description: The Job Address/Identifier of this invoice
          properties:
            identifier:
              type: string
              nullable: true
              description: The free-form job identifier of this invoice
            address:
              type: string
              nullable: true
              description: The address component of the job address
            city:
              type: string
              nullable: true
              description: The city component of the job address
            state:
              type: string
              nullable: true
              description: The state component of the job address
            zip:
              type: string
              nullable: true
              description: The zip code component of the job address
        parentQuoteId:
          type: string
          nullable: true
          description: The unique ID of the quote that this invoice was created from if
            available
        parentQuoteNumber:
          type: number
          description: The quote number of the quote that this invoice was created from if
            available
        dealId:
          type: string
          nullable: true
          description: The unique ID of the deal associated with this invoice
        quoteTypeId:
          type: string
          nullable: true
          deprecated: true
          description: This field is deprecated. Use quoteType.id instead
        quoteType:
          type: object
          additionalProperties: false
          description: The Invoice Type of this invoice
          properties:
            id:
              type: string
              nullable: true
              description: The unique ID of the Invoice Type
            value:
              type: string
              nullable: true
              deprecated: true
              description: This field is deprecated. Use quoteType.id instead
            label:
              type: string
              nullable: true
              description: The text used to describe this Invoice Type
        quoteTemplateId:
          type: string
          nullable: true
          deprecated: true
          description: This field is deprecated. Use quoteTemplate.id instead
        quoteTemplate:
          type: object
          additionalProperties: false
          description: The Invoice Template that was made to use this invoice
          properties:
            id:
              type: string
              nullable: true
              description: The unique ID of the Invoice Template
            value:
              type: string
              nullable: true
              deprecated: true
              description: This field is deprecated. Use quoteTemplate.id instead
            label:
              type: string
              nullable: true
              description: The label of the Invoice Template
        items:
          type: array
          description: The items that make up this invoice
          items:
            $ref: "#/components/schemas/InvoiceItem"
        totalAdjustment:
          type: object
          additionalProperties: false
          description: The manual total adjustment applied to the invoice
          properties:
            rate:
              type: number
              description: The percentage of the adjustment. Omitted if the adjustment is not
                a percentage
            total:
              type: number
              description: The calculated amount of the adjustment of the sub-total
            description:
              type: string
              nullable: true
              description: The description of the adjustment
        discount:
          type: object
          additionalProperties: false
          description: The discount applied to the invoice
          properties:
            rate:
              type: number
              description: The percentage of the discount. Omitted if the discount is not a
                percentage
            total:
              type: number
              description: The calculated amount of the discount of the sub-total
            description:
              type: string
              nullable: true
              description: The description of the discount
        tax:
          type: object
          additionalProperties: false
          description: The tax applied to the invoice
          properties:
            rate:
              type: number
              description: The percentage rate of tax
            total:
              type: number
              description: The total amount of tax applied
            description:
              type: string
              nullable: true
              description: The description of the tax
            details:
              type: array
              description: The detailed tax breakdown by rate
              items:
                type: object
                additionalProperties: false
                properties:
                  rate:
                    type: number
                    description: The percentage rate of tax
                  total:
                    type: number
                    description: The total amount of tax applied at this rate
                  description:
                    type: string
                    nullable: true
                    description: The description of the tax at this rate
        terms:
          type: string
          nullable: true
          description: The terms/contract associated with this invoice
        estimatorNotes:
          type: string
          nullable: true
          description: The estimator notes associated with this invoice
        clientNote:
          type: string
          nullable: true
          description: The client note associated with this invoice
        crewNote:
          type: string
          nullable: true
          description: The crew note associated with this invoice
        totals:
          type: object
          additionalProperties: false
          description: The totals of the invoice
          properties:
            price:
              type: number
              description: The sub-total price of the invoice
            laborPrice:
              type: number
              description: The labor component of the sub-total
            materialsPrice:
              type: number
              description: The materials component of the sub-total
            additionalWorkLaborPrice:
              type: number
              description: The additional work labor component of the total
            additionalWorkMaterialsPrice:
              type: number
              description: The additional work materials component of the total
            afterAdjustment:
              type: number
              description: The price after sub-total adjustment of the invoice
            afterDiscount:
              type: number
              description: The price after discount of the invoice
            afterTax:
              type: number
              description: The after tax price of the invoice
            hours:
              type: number
              description: The number of hours of the invoice
        urls:
          type: object
          additionalProperties: false
          description: Customer-View Links to this invoice and work order
          properties:
            invoice:
              type: string
              description: A link to this invoice
            workOrder:
              type: string
              description: A link to this work order
        source:
          $ref: "#/components/schemas/Source"
        owner:
          $ref: "#/components/schemas/Owner"
        timestamp:
          $ref: "#/components/schemas/Timestamp"
        tags:
          type: array
          description: Tags associated with this Invoice
          items:
            type: string
        tagDetails:
          type: array
          description: Detailed tag information associated with this Quote
          items:
            $ref: "#/components/schemas/TagDetail"
    InvoiceItem:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          description: Unique identifier for the invoice item
        name:
          type: string
          description: The title/name for this item
        quoteType:
          type: string
          description: The quote type this item applies to
        description:
          type: string
          description: The plain text description for this item
        descriptionHtml:
          type: string
          description: The HTML formatted description for this item
        price:
          type: number
          description: The total price for this item
        hours:
          type: number
          description: The estimated hours for this item
        quantity:
          type: number
          description: The quantity of this item
        pricePerUnit:
          type: number
          description: The price per unit if quantity-based pricing
        crewNote:
          type: string
          description: Notes for the crew working on this item
        crewNoteHtml:
          type: string
          description: HTML formatted notes for the crew
        clientNote:
          type: string
          description: Notes visible to the client
        clientNoteHtml:
          type: string
          description: HTML formatted notes visible to the client
        files:
          type: array
          description: Files attached to this item
          items:
            type: object
            properties:
              key:
                type: string
                description: Unique identifier for the file
              src:
                type: string
                description: URL or path to the file
              title:
                type: string
                description: Title of the file
              caption:
                type: string
                description: Caption or description of the file
        source:
          type: object
          description: External source information if item is from external system
          properties:
            provider:
              type: string
              description: The provider/system name
            id:
              type: string
              description: External system ID
            value:
              type: string
              description: External system value
            label:
              type: string
              description: External system label
        section:
          type: string
          enum:
            - bid
            - options
            - archived
            - additional
            - pending
          description: The section this item belongs to
          default: bid
      required:
        - name
        - price
      example:
        name: Interior Wall Painting
        quoteType: interior
        description: Professional interior wall painting with premium paint
        descriptionHtml: <p>Professional interior wall painting with <strong>premium
          paint</strong></p>
        price: 1245.5
        hours: 8.5
        quantity: 1
        crewNote: Use Benjamin Moore paint from storage room
        clientNote: Work will be completed during business hours
        files: []
        source:
          provider: paintscout
          id: rate-001
          value: interior-walls
          label: Interior Wall Painting Rate
    InvoiceItemCreate:
      type: object
      additionalProperties: false
      properties:
        name:
          type: string
          description: The title/name for this item
        quoteType:
          type: string
          description: The quote type this item applies to
        description:
          type: string
          description: The plain text description for this item
        descriptionHtml:
          type: string
          description: The HTML formatted description for this item
        price:
          type: number
          description: The total price for this item
        hours:
          type: number
          description: The estimated hours for this item
        quantity:
          type: number
          description: The quantity of this item
        pricePerUnit:
          type: number
          description: The price per unit if quantity-based pricing
        crewNote:
          type: string
          description: Notes for the crew working on this item
        crewNoteHtml:
          type: string
          description: HTML formatted notes for the crew
        clientNote:
          type: string
          description: Notes visible to the client
        clientNoteHtml:
          type: string
          description: HTML formatted notes visible to the client
        files:
          type: array
          description: Files attached to this item
          items:
            type: object
            properties:
              key:
                type: string
                description: Unique identifier for the file
              src:
                type: string
                description: URL or path to the file
              title:
                type: string
                description: Title of the file
              caption:
                type: string
                description: Caption or description of the file
        source:
          type: object
          description: External source information if item is from external system
          properties:
            provider:
              type: string
              description: The provider/system name
            id:
              type: string
              description: External system ID
            value:
              type: string
              description: External system value
            label:
              type: string
              description: External system label
        section:
          type: string
          enum:
            - bid
            - options
            - archived
            - additional
            - pending
          description: The section this item belongs to
          default: bid
      required:
        - name
        - price
      example:
        name: Interior Wall Painting
        quoteType: interior
        description: Professional interior wall painting with premium paint
        descriptionHtml: <p>Professional interior wall painting with <strong>premium
          paint</strong></p>
        price: 1245.5
        hours: 8.5
        quantity: 1
        crewNote: Use Benjamin Moore paint from storage room
        clientNote: Work will be completed during business hours
        files: []
        source:
          provider: paintscout
          id: rate-001
          value: interior-walls
          label: Interior Wall Painting Rate
    InvoiceItemUpdate:
      type: object
      additionalProperties: false
      properties:
        name:
          type: string
          description: The title/name for this item
        quoteType:
          type: string
          description: The quote type this item applies to
        description:
          type: string
          description: The plain text description for this item
        descriptionHtml:
          type: string
          description: The HTML formatted description for this item
        price:
          type: number
          description: The total price for this item
        hours:
          type: number
          description: The estimated hours for this item
        quantity:
          type: number
          description: The quantity of this item
        pricePerUnit:
          type: number
          description: The price per unit if quantity-based pricing
        crewNote:
          type: string
          description: Notes for the crew working on this item
        crewNoteHtml:
          type: string
          description: HTML formatted notes for the crew
        clientNote:
          type: string
          description: Notes visible to the client
        clientNoteHtml:
          type: string
          description: HTML formatted notes visible to the client
        files:
          type: array
          description: Files attached to this item
          items:
            type: object
            properties:
              key:
                type: string
                description: Unique identifier for the file
              src:
                type: string
                description: URL or path to the file
              title:
                type: string
                description: Title of the file
              caption:
                type: string
                description: Caption or description of the file
        source:
          type: object
          description: External source information if item is from external system
          properties:
            provider:
              type: string
              description: The provider/system name
            id:
              type: string
              description: External system ID
            value:
              type: string
              description: External system value
            label:
              type: string
              description: External system label
        section:
          type: string
          enum:
            - bid
            - options
            - archived
            - additional
            - pending
          description: The section this item belongs to
      example:
        price: 1500
        quantity: 2
        description: Updated description for the item
        crewNote: Updated crew instructions
    InvoiceSearchResult:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          nullable: false
          description: A unique ID for the Invoice.
        number:
          type: number
          description: The Number of the Invoice
        status:
          type: string
          description: The status of this invoice
        hourlyRate:
          type: number
          description: The Hourly Rate of the Invoice
        contactId:
          type: string
          deprecated: true
          description: This field is deprecated. Use contact.id instead
        contact:
          $ref: "#/components/schemas/Contact"
        billingContact:
          $ref: "#/components/schemas/Contact"
        dates:
          type: object
          additionalProperties: false
          description: important dates about this invoice
          properties:
            quote:
              type: number
              description: The date the invoice was create
            sent:
              type: number
              description: The date the invoice was most recently sent
            viewed:
              type: number
              description: The date the invoice was most recently viewed
            accepted:
              type: number
              description: The date the invoice was accepted
            declined:
              type: number
              description: The date the invoice was declined
        jobAddress:
          type: object
          additionalProperties: false
          description: The Job Address/Identifier of this invoice
          properties:
            identifier:
              type: string
              description: The free-form job identifier of this invoice
            address:
              type: string
              description: The address component of the job address
            city:
              type: string
              description: The city component of the job address
            state:
              type: string
              description: The state component of the job address
            zip:
              type: string
              description: The zip code component of the job address
        parentQuoteId:
          type: string
          description: The unique ID of the quote that this invoice was created from if
            available
        parentQuoteNumber:
          type: number
          description: The quote number of the quote that this invoice was created from if
            available
        dealId:
          type: string
          description: The unique ID of the deal associated with this invoice
        quoteType:
          type: object
          additionalProperties: false
          description: The Invoice Type of this invoice
          properties:
            id:
              type: string
              description: The unique ID of the Invoice Type
            label:
              type: string
              description: The text used to describe this Invoice Type
        quoteTemplate:
          type: object
          additionalProperties: false
          description: The Invoice Template that was made to use this invoice
          properties:
            id:
              type: string
              description: The unique ID of the Invoice Template
            label:
              type: string
              description: The label of the Invoice Template
        totalAdjustment:
          type: object
          additionalProperties: false
          description: The manual total adjustment applied to the invoice
          properties:
            rate:
              type: number
              description: The percentage of the adjustment. Omitted if the adjustment is not
                a percentage
            total:
              type: number
              description: The calculated amount of the adjustment of the sub-total
            description:
              type: string
              description: The description of the adjustment
        discount:
          type: object
          additionalProperties: false
          description: The discount applied to the invoice
          properties:
            rate:
              type: number
              description: The percentage of the discount. Omitted if the discount is not a
                percentage
            total:
              type: number
              description: The calculated amount of the discount of the sub-total
            description:
              type: string
              description: The description of the discount
        tax:
          type: object
          additionalProperties: false
          description: The tax applied to the invoice
          properties:
            rate:
              type: number
              description: The percentage rate of tax
            total:
              type: number
              description: The total amount of tax applied
            description:
              type: string
              description: The description of the tax
        totals:
          type: object
          additionalProperties: false
          description: The totals of the invoice
          properties:
            price:
              type: number
              description: The sub-total price of the invoice
            laborPrice:
              type: number
              description: The labor component of the sub-total
            materialsPrice:
              type: number
              description: The materials component of the sub-total
            additionalWorkLaborPrice:
              type: number
              description: The additional work labor component of the total
            additionalWorkMaterialsPrice:
              type: number
              description: The additional work materials component of the total
            afterAdjustment:
              type: number
              description: The price after sub-total adjustment of the invoice
            afterDiscount:
              type: number
              description: The price after discount of the invoice
            afterTax:
              type: number
              description: The after tax price of the invoice
            hours:
              type: number
              description: The number of hours of the invoice
        source:
          $ref: "#/components/schemas/Source"
        owner:
          $ref: "#/components/schemas/Owner"
        timestamp:
          $ref: "#/components/schemas/Timestamp"
        tags:
          type: array
          description: Tags associated with this Invoice
          items:
            type: string
      example:
        id: abcd1234-abcd-1234-abcd-abcd1234abcd
        number: 234
        hourlyRate: 65.5
    User:
      type: object
      additionalProperties: false
      properties:
        userId:
          type: string
          description: The unique user ID from Auth0
        companyId:
          type: string
          description: The company ID this user belongs to
        email:
          type: string
          description: The email address of the user
        firstName:
          type: string
          description: The first name of the user
        lastName:
          type: string
          description: The last name of the user
        phoneNumber:
          type: string
          description: The phone number of the user
        active:
          type: boolean
          description: Whether the user account is active
        timestamp:
          $ref: "#/components/schemas/UserTimestamp"
      required:
        - userId
        - companyId
        - email
        - active
      example:
        userId: auth0|617545b5181e16506a050fa5
        companyId: company_abc123
        email: bob.johnson@example.com
        firstName: Bob
        lastName: Johnson
        phoneNumber: "15551234567"
        active: true
        timestamp:
          created: 1672531200
          updated: 1672617600
          lastLogin: 1672704000
    Owner:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          description: The unique user ID
        firstName:
          type: string
          description: The first name of the user
        lastName:
          type: string
          description: The last name of the user
        title:
          type: string
          description: The job title of the user
        email:
          type: string
          description: The email address of the user
        phoneNumber:
          type: string
          description: The phone number of the user
        phoneExtension:
          type: string
          description: The phone extension of the user
      example:
        id: user123
        firstName: Bob
        lastName: Johnson
        title: Project Manager
        email: bob.johnson@example.com
        phoneNumber: "15551234567"
        phoneExtension: "123"
    QuoteType:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          description: The unique ID of the quote type.
        label:
          type: string
          description: The display label of the quote type.
        active:
          type: boolean
          description: Whether this quote type is active & usable
        defaultHourlyRate:
          type: number
          description: The default hourly rate for this quote type
        defaultTerms:
          type: string
          description: The default terms template for this quote type
        defaultAreaType:
          type: string
          description: The default area type for this quote type
        defaultPresentation:
          type: string
          description: The default presentation template for this quote type
        overrideCompanyOptions:
          type: boolean
          description: Whether this quote type overrides global company options
        companyOptions:
          type: object
          description: Custom company options for this quote type
          additionalProperties: true
      required:
        - id
        - label
      example:
        id: interior
        label: Interior
        active: true
        defaultHourlyRate: 65
        defaultTerms: standard
        defaultAreaType: room
        defaultPresentation: default
        overrideCompanyOptions: false
        companyOptions:
          name: Interior Paint Co.
    AreaLabel:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          description: The unique ID of the area label.
        label:
          type: string
          description: The display name of the area label.
        active:
          type: boolean
          description: Whether this area label is active & usable
        quoteTypes:
          type: array
          items:
            type: string
          description: The quote types this area label applies to
      required:
        - id
        - label
      example:
        id: living-room
        label: Living Room
        active: true
        quoteTypes:
          - interior
          - residential
    EventType:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          description: The unique ID of the event type.
        name:
          type: string
          description: The name of the event type.
      required:
        - id
        - name
      example:
        id: consultation
        name: Consultation
    LeadSource:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          description: The unique ID of the lead source.
        name:
          type: string
          description: The name of the lead source.
      required:
        - id
        - name
      example:
        id: charity-event
        name: Charity Event
    LineItem:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          description: The unique ID of the line item.
        active:
          type: boolean
          description: Whether this line item is active & usable
        label:
          type: string
          description: The label of the line item
        description:
          type: string
          description: The description of the line item
        crewNote:
          type: string
          description: The crew note of the line item
        clientNote:
          type: string
          description: The client note of the line item
        calculateBy:
          type: string
          enum:
            - none
            - hourlyRate
            - quantity
          description: The calculation type of this line item
        quantity:
          type: number
          description: The quantity use if this is a quantity calculated line item
        hours:
          type: number
          description: The hours of this line item
        hourlyRate:
          type: number
          description: The hourly rate used if using an hourly-rate based calculation
        pricePerUnit:
          type: number
          description: The price per unit if using a quantity-based calculation
        price:
          type: number
          description: The price of this line item
      required:
        - id
      example:
        id: abcd1234-abcd-1234-abcd-abcd1234abcd
        active: true
        label: My Great Line Item
        description: This is an example line item
        crewNote: This is a note that would show to the crew
        clientNote: This is a note that would show only to the client
        calculateBy: quantity
        quantity: 5
        hours: 30.5
        pricePerUnit: 150
        price: 900
    Pipeline:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          description: The unique ID of the pipeline.
        name:
          type: string
          description: The name of the pipeline.
      required:
        - id
        - name
      example:
        id: sales-pipeline
        name: Sales Pipeline
    QuoteTemplate:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          description: The unique ID of the quote template.
          readOnly: true
        label:
          type: string
          description: The display label of the quote template.
        active:
          type: boolean
          description: Whether this quote template is active & usable
        quoteTypes:
          type: array
          items:
            type: string
          description: The quote types this template applies to
      required:
        - id
        - label
      example:
        id: standard-interior
        label: Standard Interior Template
        active: true
        quoteTypes:
          - interior
          - residential
    Product:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          description: The unique ID of the product.
        label:
          type: string
          description: The display label of the product.
        active:
          type: boolean
          description: Whether this product is active & usable
        coverageRate:
          type: number
          description: Square feet coverage per gallon (sqft/gal)
        lnftCoverage:
          type: number
          description: Linear feet coverage
        quantityCoverage:
          type: number
          description: Quantity coverage
        pricePerUnit:
          type: number
          description: Unit price per gallon ($/gal)
        unit:
          type: string
          description: Measurement unit label
        quoteTypes:
          type: array
          items:
            type: string
          description: Quote types this product applies to
      required:
        - id
        - label
        - coverageRate
        - lnftCoverage
        - quantityCoverage
      example:
        id: premium-paint
        label: Premium Interior Paint
        active: true
        coverageRate: 400
        lnftCoverage: 0
        quantityCoverage: 1
        pricePerUnit: 65.99
        unit: gallon
        quoteTypes:
          - interior
          - residential
    RateCategory:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          description: The unique ID of the rate category.
        label:
          type: string
          description: The display label of the rate category.
        active:
          type: boolean
          description: Whether this rate category is active & usable
        quoteTypes:
          type: array
          items:
            type: string
          description: Quote types this rate category applies to
      required:
        - id
        - label
      example:
        id: preparation
        label: Preparation Work
        active: true
        quoteTypes:
          - interior
          - exterior
    Rate:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          description: The unique ID of the rate.
        name:
          type: string
          description: The unique name of the rate (same as id).
        quoteType:
          type: string
          description: The quote type this rate applies to
        label:
          type: string
          description: The display label of the rate.
        clientLabel:
          type: string
          description: The label shown to clients
        custom:
          type: boolean
          description: Whether this is a custom rate
        rateType:
          type: string
          description: The type of rate calculation (e.g., sqftWalls, lnft, etc.)
        calculationType:
          type: string
          description: How the rate is calculated (e.g., amountPerHour)
        rateSection:
          type: string
          description: The rate category/section this rate belongs to
        defaultApps:
          type: number
          description: Default number of applications/coats
        maxApps:
          type: number
          description: Maximum possible applications/coats
        reportText:
          type: string
          description: Text shown in reports
        areaReportText:
          type: string
          description: Text shown in area reports
        values:
          type: array
          items:
            type: number
          description: Array of rate values for different applications
        caption:
          type: string
          description: Caption or description for the rate
        useApps:
          type: boolean
          description: Whether this rate uses coat/application calculations
        active:
          type: boolean
          description: Whether this rate is active & usable
        coverage:
          type: string
          description: Coverage information or notes
        hourlyRate:
          type: number
          description: Hourly rate if applicable
        overrideHourlyRate:
          type: boolean
          description: Whether this rate overrides the default hourly rate
      required:
        - id
        - name
        - label
        - rateType
        - calculationType
        - rateSection
        - values
      example:
        id: interior-walls-paint
        name: interior-walls-paint
        quoteType: interior
        label: Interior Wall Painting
        clientLabel: Wall Painting
        custom: false
        rateType: sqftWalls
        calculationType: amountPerHour
        rateSection: painting
        defaultApps: 2
        maxApps: 3
        reportText: Interior wall painting with premium paint
        areaReportText: Wall painting
        values:
          - 0.15
          - 0.12
          - 0.1
          - 0.08
        caption: Per square foot
        useApps: true
        active: true
        coverage: 400 sqft per gallon
        hourlyRate: 65
        overrideHourlyRate: false
    TaxRate:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          description: The unique ID of the tax rate.
        description:
          type: string
          description: The description of the tax rate.
        rate:
          type: number
          description: The tax rate percentage (e.g., 20 for 20%).
        isDefault:
          type: boolean
          description: Indicates if this is included on new quotes by default.
      required:
        - id
        - rate
      example:
        id: standard-tax
        description: Standard Tax
        rate: 5
        isDefault: true
    TaxRateCreate:
      type: object
      additionalProperties: false
      properties:
        description:
          type: string
          description: The description of the tax rate.
        rate:
          type: number
          description: The tax rate percentage (e.g., 20 for 20%).
        isDefault:
          type: boolean
          description: Indicates if this is included on new quotes by default.
      required:
        - rate
      example:
        description: Standard Tax
        rate: 5
        isDefault: true
    Stage:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          description: The unique ID of the pipeline stage.
        name:
          type: string
          description: The name of the pipeline stage. (Pipeline - Stage)
      required:
        - id
        - name
      example:
        id: sales-pipeline-stage-1
        name: Sales Pipeline - First Stage
    Tag:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          description: The unique ID of the tag.
        label:
          type: string
          description: The display label of the tag.
        color:
          type: string
          description: The color of the tag (hex code)
      required:
        - id
        - label
        - color
      example:
        id: urgent
        label: Urgent
        color: "#ff0000"
    Source:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          nullable: true
          description: The ID of the entity on the other side
        provider:
          type: string
          nullable: true
          description: The name of the provider this entity came from
      example:
        id: "12345"
        provider: myOtherIntegratedApp
    Webhook:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          description: A unique ID for the Webhook. Ignored when creating & updating
            webhooks.
        url:
          type: string
          description: The URL of the webhook, which will receive requests with data for
            any events fired that fall within the events of the Webhook.
        events:
          type: array
          additionalProperties: false
          description: "A list of events covering events the Webhook is subscripted to.
            Allowed values: company-created, company-tags-changed,
            contact-created, contact-tags-changed, deal-created,
            deal-tags-changed, deal-stage-changed, event-created, task-created,
            task-completed, quote-created, invoice-created, quote-sent,
            invoice-sent, send-work-order, quote-accepted,
            quote-additional-work-accepted, quote-declined,
            quote-status-changed, quote-owner-changed, quote-tags-changed,
            quote-viewed, invoice-viewed"
          items:
            type: string
            enum:
              - company-created
              - company-tags-changed
              - contact-created
              - contact-tags-changed
              - deal-created
              - deal-tags-changed
              - deal-stage-changed
              - event-created
              - task-created
              - task-completed
              - quote-created
              - invoice-created
              - quote-sent
              - invoice-sent
              - send-work-order
              - quote-accepted
              - quote-additional-work-accepted
              - quote-declined
              - quote-status-changed
              - quote-owner-changed
              - quote-tags-changed
              - quote-viewed
              - invoice-viewed
          example:
            - quote-status-changed
        params:
          type: object
          nullable: true
          additionalProperties: false
          description: An optional object of key-value pairs used to customize webhook
            trigger behavior.
          properties:
            isInvoice:
              type: boolean
              description: Whether or not the quote webhook is only to toggle for invoices.
                Only applicable for quote-related webhooks.
            quoteTypes:
              type: array
              description: A list of quote types (by Id or Label) to filter quote-related
                webhooks. Only applicable for quote-related webhooks.
              items:
                type: string
            quoteStatus:
              type: array
              description: A list of quote statuses to filter quote-related webhooks. Only
                applicable for quote or invoice related webhooks.
              items:
                type: string
            eventTypes:
              type: array
              description: A list of event types (by Id or Label) to filter event-created
                webhooks. Only applicable for event-created webhooks.
              items:
                type: string
            stageIds:
              type: array
              description: A list of Deal Stage Ids to filter deal-stage-changed webhooks.
              items:
                type: string
            tagsAdded:
              type: array
              description: A list of tags, if any of these tags are added to the entity, the
                webhook will trigger.
              items:
                type: string
            tagsRemoved:
              type: array
              description: A list of tags, if any of these tags are removed from the entity,
                the webhook will trigger.
              items:
                type: string
        token:
          type: string
          description: A string used to hash the webhook body for verification.
        enabled:
          type: boolean
          description: Whether or not the Webhook is enabled/active.
        timestamp:
          $ref: "#/components/schemas/Timestamp"
      required:
        - url
        - events
      example:
        id: "42"
        url: https://sweet-webhooks.com/my/webhook/endpoint
        events:
          - quote-status-changed
          - quote-created
        token: "123456"
        enabled: true
        timestamp:
          created: 1490737206
          updated: 1490737206
    Task:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          nullable: false
          description: The ID of the Task. Ignored when creating & updating tasks.
        title:
          type: string
          nullable: false
          description: The title of the Task.
        dealId:
          type: string
          nullable: false
          description: The deal ID this task is associated with
        owner:
          type: object
          nullable: false
          $ref: "#/components/schemas/Owner"
        notes:
          type: string
          nullable: true
          description: A note about this task
        completed:
          type: boolean
          nullable: true
          description: Whether the task has been completed
        timestamp:
          type: object
          nullable: false
          $ref: "#/components/schemas/TaskTimestamp"
      example:
        title: Make the call
        dealId: abcd1234-abcd-1234-abcd-abcd1234abcd
        notes: Call the client to see how everything is going.
        owner:
          id: ownerid1234
          firstName: John
          lastName: Doe
          email: johndoefake@fakemail.com
        timestamp:
          start: 1672531200
    TaskSearchResult:
      $ref: "#/components/schemas/Task"
    Timestamp:
      type: object
      additionalProperties: false
      properties:
        created:
          type: number
          description: The timestamp when this entity was created
        updated:
          type: number
          description: The timestamp when this entity was last updated
      example:
        created: 1234567890
        updated: 1234567890
    UserTimestamp:
      type: object
      additionalProperties: false
      properties:
        created:
          type: number
          description: The timestamp when this entity was created
        updated:
          type: number
          description: The timestamp when this entity was last updated
        lastLogin:
          type: number
          description: The timestamp when this user last logged in
      example:
        created: 1234567890
        updated: 1234567890
        lastLogin: 1234567890
    TaskTimestamp:
      type: object
      additionalProperties: false
      properties:
        created:
          type: number
          description: The timestamp when this entity was created
        updated:
          type: number
          description: The timestamp when this entity was last updated
        start:
          type: number
          description: The timestamp when this task is scheduled to start
        completed:
          type: number
          description: The timestamp when this task was completed
      example:
        created: 1234567890
        updated: 1234567890
        start: 1234567890
        completed: 1234567890
    Error:
      type: object
      additionalProperties: false
      properties:
        errors:
          type: array
          items:
            type: string
          description: Array of error messages
      example:
        errors:
          - Record not found
    Payment:
      type: object
      additionalProperties: false
      properties:
        type:
          type: string
          nullable: true
          description: The type of payment method
        amount:
          type: number
          description: The amount paid on this payment
        date:
          type: number
          description: The date the payment was made
        note:
          type: string
          nullable: true
          description: The note associated with this payment
        deposit:
          type: boolean
          description: Whether this payment is a deposit or not
      example:
        type: credit_card
        amount: 150
        date: 1625247600
        note: Initial deposit for the project
        deposit: true
    TagDetail:
      type: object
      additionalProperties: false
      properties:
        name:
          type: string
          description: The id of the tag
        label:
          type: string
          description: The label of the tag
        deleted:
          type: boolean
          description: Whether the tag has been deleted
        updated:
          type: number
          description: The last updated timestamp of the tag
      example:
        name: urgent
        label: Urgent
        deleted: false
        updated: 1625247600
    File:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          description: The unique ID of the File
        title:
          type: string
          nullable: true
          description: The title of the File
        src:
          type: string
          nullable: true
          description: The URL of the File
        type:
          type: string
          nullable: true
          description: The MIME type of the File (e.g. image/jpeg, application/pdf)
        format:
          type: string
          nullable: true
          description: The file format/extension (e.g. jpg, pdf, png)
        visibility:
          type: string
          nullable: true
          description: The visibility of the File
          enum:
            - visible
            - customer
            - crew
            - hidden
        timestamp:
          $ref: "#/components/schemas/Timestamp"
      example:
        id: abcd1234-abcd-1234-abcd-abcd1234abcd
        title: Site Photo
        src: https://example.com/files/photo.jpg
        type: image/jpeg
        format: jpeg
        visibility: visible
        timestamp:
          created: 1672531200
          updated: 1672617600
    FileCreate:
      type: object
      additionalProperties: false
      required:
        - files
      properties:
        files:
          type: array
          description: Array of files to upload
          items:
            type: object
            additionalProperties: false
            required:
              - url
            properties:
              url:
                type: string
                description: The URL of the file to download and upload
              title:
                type: string
                description: Optional title for the file
              visibility:
                type: string
                description: The visibility of the file
                enum:
                  - visible
                  - customer
                  - crew
                  - hidden
      example:
        files:
          - url: https://example.com/photo.jpg
            title: Site Photo
            visibility: visible
    Note:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          description: The unique ID of the Note. Ignored when creating notes
        note:
          type: string
          nullable: true
          description: The content of the Note
        owner:
          type: object
          nullable: true
          $ref: "#/components/schemas/Owner"
        timestamp:
          $ref: "#/components/schemas/Timestamp"
      example:
        id: abcd1234-abcd-1234-abcd-abcd1234abcd
        note: This is a note content.
        owner:
          id: user_abc123
          name: Alice Smith
        timestamp:
          created: 1672531200
          updated: 1672617600
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
security:
  - BearerAuth: []
