openapi: 3.0.0
info:
  title: 'Agencyzoom API'
  description: "Agencyzoom API enables third party applications to integrate with\n Agencyzoom to manage lead, customer, policy, and tasks. The management operations\n include actions such as creation, retrieval, updating, and deletion. \n\n Currently, Agencyzoom has a rate limit of **30** calls per minute during the day, 60 calls per\n minutes from 10PM CT to 4AM CT, as of Nov 21, 2023.\n\n# Getting Started\nUsing authentication endpoints as described below, the integrator can function on hehalf \nof the logged in user. The login endpoint returns a JWT token. Subsequent calls need \npass the token as HTTP header bearer token.\n```\nAuthorization: Bearer <token>\n```\nPlease note, the permissions afforded to the caller are the same as those for the logged\nin user. Therefore, the user name used for the integration has to be the agency owner\nif the integrated applications would like to access all the functionalities.\n\n# Versioning\nAgencyzoom API is backward compatible. Currently there is only one version. \n\n# Change Logs\n- ### 2023.11.07 \n    - POST v1/api/leads/list. Fixed bug in sort by `lastActivityDate`. Added 2 additional filters: lastActivityEarliestDate,lastActivityLatestDate\n    - Increased rate limite for nightly API calls\n    - POST v1/api/leads/{leadId}/quotes. Fixed bug of missing `Quote ID` response payload\n- ### 2023.11.21\n    - Increased rate limite for daily API calls to 30 per minute\n    - POST /v1/api/leads/{leadId}/notes. Fixed bug in processing line breaks\n- ### 2024.01.10\n    - New API for contact management - Batch Create Contacts POST `v1/api/contact/batch-create`\n    - Added the following new fields for PUT `v1/api/customers/{customerId}`\n    `contactFirstname` `contactLastname` `contactMiddlename` `numberOfEmployees` `annualRevenue` `totalPayroll` `tagNamesbirthday` `csrId` `agentId` `customFields`\n- ### 2024.01.18\n    - New API for Customer management - Get AMS policies for a specific customer `GET: v1/api/customers/{customerId}/ams-policies`\n    - New API for Customer management - Get policies for a specific customer `GET: v1/api/customers/{customerId}/policies`\n    - New API for Customer management - Update tags for a specific policy `POST: v1/api/policies/update-tags`\n\n- ### 2024.01.18\n    - POST `/v1/api/leads/create`. Edit request params `pipelineId` `stageId` as required.\n- ### 2024.03.10\n    - Added two new fields `licenseNumber` `stateLicensed` for POST `v1/api/opportunities/{opportunityId}/driver`  GET `v1/api/opportunities/drivers/{driverId}`  PUT `v1/api/opportunities/drivers/{driverId}`\n\nHappy coding!"
  termsOfService: 'https://agencyzoom.com/tos/'
  contact:
    email: support@agencyzoom.com
  license:
    name: 'Propriety license'
  version: 1.0.0
servers:
  -
    url: 'https://api.agencyzoom.com'
    description: 'Mobile test server'
paths:
  /v1/api/auth/login:
    post:
      tags:
        - Authentication
      summary: 'Log the user in'
      operationId: Auth-Login
      requestBody:
        description: 'Dashboard data request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LoginRequest'
      responses:
        '200':
          description: 'JWT Token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LoginResponse'
        '400':
          description: 'Invalid user name and/or password'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v1/api/auth/ssologin:
    post:
      tags:
        - Authentication
      summary: 'V4 SSO Log the user in'
      operationId: Auth-Ssologin
      requestBody:
        description: 'Dashboard data request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LoginRequest'
      responses:
        '200':
          description: 'JWT Token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LoginResponse'
        '400':
          description: 'Invalid user name and/or password'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v1/api/auth/logout:
    post:
      tags:
        - Authentication
      summary: 'Log the user out'
      operationId: Auth-Logout
      responses:
        '200':
          description: 'A generic success message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid user name and/or password'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v1/api/contact/batch-create:
    post:
      tags:
        - 'Contact Management'
      summary: 'Batch create contact'
      description: 'Batch create contacts. Please note, maximum 5 contacts can be created in a single call. Contacts can be associated with either customers (via customerId) or leads (via leadId).'
      operationId: batchCreateContact
      requestBody:
        description: 'Contact create request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchContactDataRequest'
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/customers:
    post:
      tags:
        - 'Customer Management'
      summary: 'Search Customers'
      description: '![Search Customers](https://assets.agencyzoom.com/images/openapi/customersearch.png)'
      operationId: getCustomerList
      requestBody:
        description: 'Customer search request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerSearchRequest'
      responses:
        '200':
          description: 'A list of customer'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerSearchResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/customers/{customerId}':
    get:
      tags:
        - 'Customer Management'
      summary: 'Get the customer details'
      operationId: getCustomer
      parameters:
        -
          name: customerId
          in: path
          description: 'ID of the customer'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: 'Customer Detailed Information ![Search Customers](https://assets.agencyzoom.com/images/openapi/customerdetail.png)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerDetail'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
    put:
      tags:
        - 'Customer Management'
      summary: 'Update customer'
      operationId: updateCustomer
      parameters:
        -
          name: customerId
          in: path
          description: 'ID of the customer'
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: 'Customer update request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerUpdateRequest'
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
    delete:
      tags:
        - 'Customer Management'
      summary: 'Delete a customer'
      operationId: deleteCustomer
      parameters:
        -
          name: customerId
          in: path
          description: 'ID of the customer'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: 'Confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/customers/{customerId}/tasks':
    get:
      tags:
        - 'Customer Management'
      summary: 'Get the customer tasks'
      operationId: getCustomerTasks
      parameters:
        -
          name: customerId
          in: path
          description: 'ID of the customer'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: 'Retrieved successfully'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Task'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/customers/{customerId}/policies/{policyId}':
    delete:
      tags:
        - 'Customer Management'
      summary: 'Delete a customer policy'
      operationId: deleteCustomerPolicy
      parameters:
        -
          name: customerId
          in: path
          description: 'ID of the customer'
          required: true
          schema:
            type: integer
            format: int64
        -
          name: policyId
          in: path
          description: 'ID of the policy'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: 'Confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/customers/{customerId}/files/{fileId}':
    delete:
      tags:
        - 'Customer Management'
      summary: 'Delete a customer file'
      operationId: deleteCustomerFile
      parameters:
        -
          name: customerId
          in: path
          description: 'ID of the customer'
          required: true
          schema:
            type: integer
            format: int64
        -
          name: fileId
          in: path
          description: 'ID of the file'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: 'Confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/customers/{customerId}/notes':
    post:
      tags:
        - 'Customer Management'
      summary: 'Create a customer note'
      operationId: addCustomerNote
      parameters:
        -
          name: customerId
          in: path
          description: 'ID of the customer'
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: 'Customer add note data request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NoteRequest'
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/customers/{customerId}/ams-policies':
    get:
      tags:
        - 'Customer Management'
      summary: 'Get AMS policies for a customer'
      operationId: AmsPolicies
      parameters:
        -
          name: customerId
          in: path
          description: 'ID of the customer'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: 'AMS policies Information ![AMS Policy](https://assets.agencyzoom.com/images/openapi/amspolicy.png)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AmsPolicy'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/customers/{customerId}/policies':
    get:
      tags:
        - 'Customer Management'
      summary: 'Get policies for a customer'
      operationId: WrittenPolicies
      parameters:
        -
          name: customerId
          in: path
          description: 'ID of the customer'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: 'The list of policies'' information ![Get policies for a customer](https://assets.agencyzoom.com/images/openapi/customer-policy.png)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WrittenPolicy'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/customers/create:
    post:
      tags:
        - 'Customer Management'
      summary: 'Create customer'
      operationId: createCustomer
      requestBody:
        description: 'Customer create request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerCreateRequest'
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/email-thread/list:
    post:
      tags:
        - Thread
      summary: 'Search Email Threads'
      operationId: searchEmailThreadList
      requestBody:
        description: 'notification search request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchThreadRequest'
      responses:
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '200':
          description: 'Retrieved successfully'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchThreadResponse'
      security:
        -
          bearer: []
  /v1/api/email-thread/unread-thread:
    post:
      tags:
        - Thread
      summary: 'Unread Thread'
      operationId: unreadEmailThread
      requestBody:
        description: 'unread thread request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UnreadThreadRequest'
      responses:
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '200':
          description: 'Retrieved successfully'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnreadThreadResponse'
      security:
        -
          bearer: []
  /v1/api/email-thread/delete-thread:
    post:
      tags:
        - Thread
      summary: 'Delete Thread'
      operationId: deleteEmailThread
      requestBody:
        description: 'unread thread request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteThreadRequest'
      responses:
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '200':
          description: 'delete successfully'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
      security:
        -
          bearer: []
  /v1/api/email-thread/email-thread-detail:
    post:
      tags:
        - Thread
      summary: 'Get thread details'
      operationId: searchEmailThreadDetail
      requestBody:
        description: 'messages search request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchMessageRequest'
      responses:
        '200':
          description: 'Thread Detailed Information'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchMessageResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/email-thread/delete-message:
    post:
      tags:
        - Thread
      summary: 'Delete Message'
      operationId: deleteMessage
      requestBody:
        description: 'delete message request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteMessageRequest'
      responses:
        '200':
          description: 'Thread Detailed Information'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchMessageResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/leads/list:
    post:
      tags:
        - 'Lead Management'
      summary: 'Search leads'
      operationId: getLeadList
      requestBody:
        description: 'Lead search request <br>  ![Get policies for a customer](https://assets.agencyzoom.com/images/openapi/leads-search.png)'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LeadSearchRequest'
      responses:
        '200':
          description: 'Retrieved successfully <br>  ![Get policies for a customer](https://assets.agencyzoom.com/images/openapi/search-lead-response.png)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeadSearchResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/leads/pipeline-count:
    post:
      tags:
        - 'Lead Management'
      summary: 'Search leads count'
      operationId: getLeadsCount
      requestBody:
        description: 'Lead search request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LeadSearchRequest'
      responses:
        '200':
          description: 'Retrieved successfully'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeadsCountResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/leads/{leadId}/opportunities':
    get:
      tags:
        - 'Lead Management'
      summary: 'Get the opportunities for a lead '
      operationId: getLeadOpportunities
      parameters:
        -
          name: leadId
          in: path
          description: 'ID of the lead'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: 'A list of lead opportunities'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Opportunity'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
    put:
      tags:
        - 'Lead Management'
      summary: 'update a lead opportunity'
      operationId: updateLeadOpportunity
      parameters:
        -
          name: leadId
          in: path
          description: 'ID of the lead'
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: 'Lead update opportunity data request'
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LeadOpportunityUpdateRequest'
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
    post:
      tags:
        - 'Lead Management'
      summary: 'Create a lead opportunity'
      operationId: createLeadOpportunity
      parameters:
        -
          name: leadId
          in: path
          description: 'ID of the lead'
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: 'Lead add opportunity data request'
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LeadOpportunityCreateRequest'
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/leads/files:
    post:
      tags:
        - 'Lead Management'
      summary: 'Get lead files'
      operationId: getLeadFiles
      requestBody:
        description: 'Lead search request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LeadFilesRequest'
      responses:
        '200':
          description: 'Retrieved successfully'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/File'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/leads/{leadId}/files/{fileId}':
    delete:
      tags:
        - 'Lead Management'
      summary: 'Delete a lead file'
      operationId: deleteLeadFile
      parameters:
        -
          name: leadId
          in: path
          description: 'ID of the lead'
          required: true
          schema:
            type: integer
            format: int64
        -
          name: fileId
          in: path
          description: 'ID of the file'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: 'Confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/leads/{leadId}/rename':
    put:
      tags:
        - 'Lead Management'
      summary: 'update a lead file name'
      operationId: renameLeadFile
      parameters:
        -
          name: leadId
          in: path
          description: 'ID of the lead'
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: 'Rename request'
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RenameLeadFileRequest'
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/leads/{leadId}/opportunities/{opportunityId}':
    delete:
      tags:
        - 'Lead Management'
      summary: 'Delete a lead opportunity'
      operationId: DeleteLeadOpportunity
      parameters:
        -
          name: leadId
          in: path
          description: 'ID of the lead'
          required: true
          schema:
            type: integer
            format: int64
        -
          name: opportunityId
          in: path
          description: 'ID of the opportunityId'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: 'Confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/leads/{leadId}/quotes':
    get:
      tags:
        - 'Lead Management'
      summary: 'Get lead quotes'
      operationId: getLeadQuotes
      parameters:
        -
          name: leadId
          in: path
          description: 'ID of the lead'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: 'A list of quotes'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Quote'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
    put:
      tags:
        - 'Lead Management'
      summary: 'update a lead quote'
      operationId: updateLeadQuote
      parameters:
        -
          name: leadId
          in: path
          description: 'ID of the lead'
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: 'Lead update quote data request'
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LeadQuoteUpdateRequest'
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
    post:
      tags:
        - 'Lead Management'
      summary: 'Create a lead quote'
      operationId: createLeadQuote
      parameters:
        -
          name: leadId
          in: path
          description: 'ID of the lead'
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: 'Lead add quote data request'
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LeadQuoteCreateRequest'
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/leads/{leadId}/quotes/{quoteId}':
    delete:
      tags:
        - 'Lead Management'
      summary: 'Delete a lead quote'
      operationId: DeleteLeadQuote
      parameters:
        -
          name: leadId
          in: path
          description: 'ID of the lead'
          required: true
          schema:
            type: integer
            format: int64
        -
          name: quoteId
          in: path
          description: 'ID of the quoteId'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: 'Confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/leads/{leadId}/update-biz-lead':
    put:
      tags:
        - 'Lead Management'
      summary: 'Update a commercial lead'
      description: 'Update commercial lead - If no parameter is provided, the existing data will be deleted.'
      operationId: updateBizLead
      parameters:
        -
          name: leadId
          in: path
          description: 'ID of the lead'
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: 'Update a lead data request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BizLeadDataRequest'
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/leads/create-biz-lead:
    post:
      tags:
        - 'Lead Management'
      summary: 'Create a commercial lead'
      description: 'Create a commercial lead'
      operationId: createBizLead
      requestBody:
        description: 'Lead create request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BizLeadDataRequest'
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/leads/{leadId}':
    get:
      tags:
        - 'Lead Management'
      summary: 'Get the lead details'
      operationId: getLead
      parameters:
        -
          name: leadId
          in: path
          description: 'ID of the lead'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: 'Lead Detailed Information ![lead detail](https://assets.agencyzoom.com/images/openapi/lead-details.png)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeadDetail'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
    put:
      tags:
        - 'Lead Management'
      summary: 'Update lead'
      description: 'Update a personal lead - If no parameter is provided, the existing data will be deleted.'
      operationId: updateLead
      parameters:
        -
          name: leadId
          in: path
          description: 'ID of the lead'
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: 'Update a lead data request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LeadDataRequest'
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/leads/{leadId}/tasks':
    get:
      tags:
        - 'Lead Management'
      summary: 'Get lead tasks'
      operationId: getLeadTasks
      parameters:
        -
          name: leadId
          in: path
          description: 'ID of the lead'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: 'A list of lead tasks'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Task'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/leads/{leadId}/notes':
    get:
      tags:
        - 'Lead Management'
      summary: 'Get lead notes'
      operationId: getLeadNotes
      parameters:
        -
          name: leadId
          in: path
          description: 'ID of the lead'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: 'A list of lead notes'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Note'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
    post:
      tags:
        - 'Lead Management'
      summary: 'Create a lead note'
      operationId: addLeadNote
      parameters:
        -
          name: leadId
          in: path
          description: 'ID of the lead'
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: 'Lead add note data request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NoteRequest'
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/leads/{leadId}/status':
    put:
      tags:
        - 'Lead Management'
      summary: 'Change status for lead'
      operationId: changeLeadStatus
      parameters:
        -
          name: leadId
          in: path
          description: 'ID of the lead'
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: 'Lead change status request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LeadChangeStatusRequest'
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/leads/{leadId}/stage':
    put:
      tags:
        - 'Lead Management'
      summary: 'Change status for lead'
      operationId: changeStage
      parameters:
        -
          name: leadId
          in: path
          description: 'ID of the lead'
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: 'Lead change status request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LeadChangeStatusRequest'
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/leads/{leadId}/sold':
    post:
      tags:
        - 'Lead Management'
      summary: 'Move lead to sold'
      operationId: soldLead
      parameters:
        -
          name: leadId
          in: path
          description: 'ID of the lead'
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: 'Lead sold request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LeadSoldRequest'
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeadSoldResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/leads/create:
    post:
      tags:
        - 'Lead Management'
      summary: 'Create lead'
      description: 'Create a personal lead'
      operationId: createLead
      requestBody:
        description: 'Lead create request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LeadDataRequest'
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/leads/batch-create:
    post:
      tags:
        - 'Lead Management'
      summary: 'Batch create lead'
      description: 'Batch create a personal lead. Please note, maximum 5 leads can be created'
      operationId: batchCreateLead
      requestBody:
        description: 'Batch lead create request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchLeadDataRequest'
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/leads/{leadId}/delete-lead':
    post:
      tags:
        - 'Lead Management'
      summary: 'Delete a Lead'
      operationId: deleteLead
      parameters:
        -
          name: leadId
          in: path
          description: 'ID of the lead'
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: 'lead delete request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LeadDeleteRequest'
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/life:
    post:
      tags:
        - 'Life and Health Lead Management'
      summary: 'Search life and health leads'
      operationId: searchLifeHealthLead
      requestBody:
        description: 'Life and health lead search request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LifeSearchRequest'
      responses:
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '200':
          description: 'Retrieved successfully'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LifeSearchResponse'
      security:
        -
          bearer: []
  '/v1/api/opportunities/{opportunityId}/driver':
    post:
      tags:
        - 'Opportunity Management'
      summary: 'Create a driver for an opportunity'
      operationId: createLeadOpportunityDriver
      parameters:
        -
          name: opportunityId
          in: path
          description: 'ID of the opportunity'
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: 'Create opportunity driver request'
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDriverRequest'
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/opportunities/drivers/{driverId}':
    get:
      tags:
        - 'Opportunity Management'
      summary: 'Get the Driver details'
      operationId: getDriverDetail
      parameters:
        -
          name: driverId
          in: path
          description: 'ID of the Driver'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: 'Driver Detailed Information'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDriverDto'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
    put:
      tags:
        - 'Opportunity Management'
      summary: 'Update a driver''s details'
      operationId: editLeadOpportunityDriver
      parameters:
        -
          name: driverId
          in: path
          description: 'ID of the opportunity driver'
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: 'Edit opportunity driver request'
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DriverRequest'
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
    delete:
      tags:
        - 'Opportunity Management'
      summary: 'Delete a driver'
      operationId: deleteDriver
      parameters:
        -
          name: driverId
          in: path
          description: 'ID of the Driver'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/opportunities/{opportunityId}/vehicle':
    post:
      tags:
        - 'Opportunity Management'
      summary: 'Create a vehicle for an opportunity'
      operationId: createLeadOpportunityVehicle
      parameters:
        -
          name: opportunityId
          in: path
          description: 'ID of the opportunity'
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: 'Create opportunity vehicle request'
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VehicleRequest'
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/opportunities/vehicles/{vehicleId}':
    get:
      tags:
        - 'Opportunity Management'
      summary: 'Get the Vehicle details'
      operationId: getVehicleDetail
      parameters:
        -
          name: vehicleId
          in: path
          description: 'ID of the Vehicle'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: 'Vehicle Detailed Information'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetVehicleDto'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
    put:
      tags:
        - 'Opportunity Management'
      summary: 'Update a vehicle''s details'
      operationId: editLeadOpportunityVehicle
      parameters:
        -
          name: vehicleId
          in: path
          description: 'ID of the opportunity vehicle'
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: 'Edit opportunity vehicle request'
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VehicleRequest'
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
    delete:
      tags:
        - 'Opportunity Management'
      summary: 'Delete a vehicle'
      operationId: deleteVehicle
      parameters:
        -
          name: vehicleId
          in: path
          description: 'ID of the vehicle'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/opportunities/{opportunityId}':
    get:
      tags:
        - 'Opportunity Management'
      summary: 'Get the Opportunity details'
      operationId: getOpportunityDetail
      parameters:
        -
          name: opportunityId
          in: path
          description: 'ID of the opportunity'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: 'Opportunity Detailed Information'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Opportunity'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
    put:
      tags:
        - 'Opportunity Management'
      summary: 'Update an opportunity'
      operationId: updateOpportunity
      parameters:
        -
          name: opportunityId
          in: path
          description: 'ID of the opportunity'
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: 'Lead add opportunity data request'
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOpportunityRequest'
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
    delete:
      tags:
        - 'Opportunity Management'
      summary: 'Delete an opportunity'
      operationId: DeleteOpportunity
      parameters:
        -
          name: opportunityId
          in: path
          description: 'ID of the opportunityId'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: 'Confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/opportunities/{opportunityId}/drivers':
    get:
      tags:
        - 'Opportunity Management'
      summary: 'Get a list of drivers for an opportunity'
      operationId: getDriverList
      parameters:
        -
          name: opportunityId
          in: path
          description: 'ID of the opportunity'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: 'A list of drivers'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GetDriverDto'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/opportunities/{opportunityId}/link-driver/{driverId}':
    put:
      tags:
        - 'Opportunity Management'
      summary: 'link a driver to opportunity'
      operationId: linkDriver
      parameters:
        -
          name: opportunityId
          in: path
          description: 'ID of the opportunity'
          required: true
          schema:
            type: integer
            format: int64
        -
          name: driverId
          in: path
          description: 'ID of the driver'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/opportunities/{opportunityId}/unlink-driver/{driverId}':
    put:
      tags:
        - 'Opportunity Management'
      summary: 'Unlink a driver from opportunity'
      operationId: unlinkDriver
      parameters:
        -
          name: opportunityId
          in: path
          description: 'ID of the opportunity'
          required: true
          schema:
            type: integer
            format: int64
        -
          name: driverId
          in: path
          description: 'ID of the driver'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/opportunities/{opportunityId}/vehicles':
    get:
      tags:
        - 'Opportunity Management'
      summary: 'Get a list of vehicles for an opportunity'
      operationId: getVehicleList
      parameters:
        -
          name: opportunityId
          in: path
          description: 'ID of the opportunity'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: 'A list of vehicles'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GetVehicleDto'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/opportunities/{opportunityId}/unlink-vehicle/{vehicleId}':
    put:
      tags:
        - 'Opportunity Management'
      summary: 'Unlink a vehicle from opportunity'
      operationId: unlinkVehicle
      parameters:
        -
          name: opportunityId
          in: path
          description: 'ID of the opportunity'
          required: true
          schema:
            type: integer
            format: int64
        -
          name: vehicleId
          in: path
          description: 'ID of the vehicle'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/opportunities/{opportunityId}/link-vehicle/{vehicleId}':
    put:
      tags:
        - 'Opportunity Management'
      summary: 'link a vehicle to opportunity'
      operationId: linkVehicle
      parameters:
        -
          name: opportunityId
          in: path
          description: 'ID of the opportunity'
          required: true
          schema:
            type: integer
            format: int64
        -
          name: vehicleId
          in: path
          description: 'ID of the vehicle'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/opportunities:
    post:
      tags:
        - 'Opportunity Management'
      summary: 'Create an opportunity'
      operationId: createOpportunity
      requestBody:
        description: 'Lead add opportunity data request'
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOpportunityRequest'
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/policies/create:
    post:
      tags:
        - 'Customer Management'
      summary: 'Create policy'
      description: 'Create policy. '
      operationId: createPolicy
      parameters:
        -
          name: X-Api-Token
          in: header
          description: 'API token required to access this endpoint'
          required: true
          schema:
            type: string
      requestBody:
        description: 'policy create request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Enterprise_PolicyCreateRequest'
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/policies/{policyId}':
    put:
      tags:
        - 'Customer Management'
      summary: 'Update a policy'
      operationId: updatePolicy
      parameters:
        -
          name: policyId
          in: path
          description: 'ID of the policy'
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: 'Policy update request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PolicyUpdateRequest'
      responses:
        '200':
          description: 'Confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/policies/update-tags:
    post:
      tags:
        - 'Customer Management'
      summary: 'Update tags for a policy'
      description: 'Tag a policy'
      operationId: TagPolicyDataRequest
      requestBody:
        description: 'Policy add tag request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TagPolicyDataRequest'
      responses:
        '200':
          description: 'Confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/policies/update-status:
    post:
      tags:
        - 'Customer Management'
      summary: 'Update status for a policy'
      description: 'Update a policy'
      operationId: PolicyUpdateStatusRequest
      requestBody:
        description: 'Policy update status request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Enterprise_PolicyUpdateStatusRequest'
      responses:
        '200':
          description: 'Confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/policies/endorse:
    post:
      tags:
        - 'Customer Management'
      summary: 'Create an endorsement for a policy'
      description: 'Create an endorsement for a policy'
      operationId: PolicyEndorse
      requestBody:
        description: 'Policy endorsement create request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PolicyEndorseRequest'
      responses:
        '200':
          description: 'Confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/profile/my:
    put:
      tags:
        - 'User Management'
      summary: 'Update My Profile'
      operationId: updateMyProfile
      requestBody:
        description: 'Profile update request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateProfileRequest'
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/product-categories:
    get:
      tags:
        - 'Configuration and Settings'
      summary: 'Get a list of product categories (policy categories)'
      operationId: productCategories
      responses:
        '200':
          description: 'Retrieved successfully'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ProductCategory'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/product-lines:
    get:
      tags:
        - 'Configuration and Settings'
      summary: 'Get a list of product lines (policy types)'
      operationId: productLines
      responses:
        '200':
          description: 'Retrieved successfully'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ProductLine'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/employees:
    get:
      tags:
        - 'Configuration and Settings'
      summary: 'Get a list of employees'
      operationId: getEmployees
      responses:
        '200':
          description: 'Retrieved successfully'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Employee'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/life-professionals:
    get:
      tags:
        - 'Configuration and Settings'
      summary: 'Get a list of life professionals'
      operationId: getLifeProfessionals
      responses:
        '200':
          description: 'Retrieved successfully'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LifeProfessional'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/lead-sources:
    get:
      tags:
        - 'Configuration and Settings'
      summary: 'Get a list of lead sources'
      operationId: getLeadSources
      responses:
        '200':
          description: 'Retrieved successfully'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LeadSource'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/lead-source-categories:
    get:
      tags:
        - 'Configuration and Settings'
      summary: 'Get a list of lead source categories'
      operationId: getLeadSourceCategories
      responses:
        '200':
          description: 'Retrieved successfully'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LeadSourceCategory'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/service-categories:
    get:
      tags:
        - 'Configuration and Settings'
      summary: 'Get a list of service categories'
      operationId: getServiceCategories
      responses:
        '200':
          description: 'Retrieved successfully'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ServiceCategory'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/service-priorities:
    get:
      tags:
        - 'Configuration and Settings'
      summary: 'Get a list of service priorities'
      operationId: getServicePriorities
      responses:
        '200':
          description: 'Retrieved successfully'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ServicePriority'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/service-resolutions:
    get:
      tags:
        - 'Configuration and Settings'
      summary: 'Get a list of service resolutions'
      operationId: getServiceResolutions
      responses:
        '200':
          description: 'Retrieved successfully'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ServiceResolution'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/assign-groups:
    get:
      tags:
        - 'Configuration and Settings'
      summary: 'Get a list of assign groups'
      operationId: getAssignGroups
      responses:
        '200':
          description: 'Retrieved successfully'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AssignGroup'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/locations:
    get:
      tags:
        - 'Configuration and Settings'
      summary: 'Get a list of locations'
      operationId: getLocations
      responses:
        '200':
          description: 'Retrieved successfully'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Location'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/carriers:
    get:
      tags:
        - 'Configuration and Settings'
      summary: 'Get a list of carriers'
      operationId: getCarriers
      responses:
        '200':
          description: 'Retrieved successfully'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Carrier'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/loss-reasons:
    get:
      tags:
        - 'Configuration and Settings'
      summary: 'Get a list of loss reasons'
      operationId: getLossReasons
      responses:
        '200':
          description: 'Retrieved successfully'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LossReason'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/{leadId}/recycle-events':
    get:
      tags:
        - 'Configuration and Settings'
      summary: 'Get a list of recycle events'
      operationId: getRecycleEvents
      parameters:
        -
          name: leadId
          in: path
          description: 'ID of the lead'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: 'Retrieved successfully'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecycleEvents'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/custom-fields:
    get:
      tags:
        - 'Configuration and Settings'
      summary: 'Get a list of custom fields'
      operationId: getCustomFieldDefs
      responses:
        '200':
          description: 'Retrieved successfully'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CustomFieldDef'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/department-groups:
    post:
      tags:
        - 'Department and Groups'
      summary: 'Get departments, groups'
      operationId: getDepartmentGroups
      requestBody:
        description: 'Customer search request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DepartmentGroupsRequest'
      responses:
        '200':
          description: 'Retrieved successfully'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DepartmentGroups'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/pipelines:
    get:
      tags:
        - Pipeline
      summary: 'Get a list of pipelines by type'
      operationId: getPipelines
      parameters:
        -
          name: type
          in: query
          description: 'Pipeline type'
          required: true
          schema:
            type: string
            enum:
              - lead
              - service
      responses:
        '200':
          description: 'Retrieved successfully'
          content:
            application/json:
              schema:
                type: array
                items:
                  properties: { id: { description: 'Pipeline ID', type: integer }, name: { description: 'Pipeline name', type: string } }
                  type: object
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/pipelines-and-stages:
    get:
      tags:
        - Pipeline
      summary: 'Get a list of pipelines and stages'
      operationId: pipelines
      responses:
        '200':
          description: 'Retrieved successfully'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Workflow'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/end-stages:
    get:
      tags:
        - Pipeline
      summary: 'Get list of endStages'
      operationId: endStages
      parameters:
        -
          name: type
          in: query
          description: 'Pipeline type'
          required: false
          schema:
            type: string
            enum:
              - lead
              - service
      responses:
        '200':
          description: 'Retrieved successfully'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/WorkflowStage'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/csrs:
    get:
      tags:
        - 'Configuration and Settings'
      summary: 'Get a list of csrs'
      operationId: getCsrs
      responses:
        '200':
          description: 'Retrieved successfully'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CsrResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/get-classifications:
    post:
      tags:
        - 'Business Classifications'
      summary: 'Search Business Classifications'
      operationId: getClassifications
      requestBody:
        description: 'Search Business search request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BusinessClassificationRequest'
      responses:
        '200':
          description: 'Retrieved successfully'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BusinessClassificationResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/tasks/list:
    post:
      tags:
        - 'Task Management'
      summary: 'Search tasks'
      operationId: searchTasks
      requestBody:
        description: 'Task search request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskSearchRequest'
      responses:
        '200':
          description: 'Retrieved successfully'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskSearchResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/tasks:
    post:
      tags:
        - 'Task Management'
      summary: 'Create Task'
      operationId: createTask
      requestBody:
        description: 'Task create request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskCreateRequest'
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/tasks/{taskId}':
    get:
      tags:
        - 'Task Management'
      summary: 'Get the task details'
      operationId: getTask
      parameters:
        -
          name: taskId
          in: path
          description: 'ID of the task'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: 'Task Detailed Information'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
    put:
      tags:
        - 'Task Management'
      summary: 'Update task'
      operationId: updateTask
      parameters:
        -
          name: taskId
          in: path
          description: 'ID of the task'
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: 'Lead data request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskUpdateRequest'
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
    delete:
      tags:
        - 'Task Management'
      summary: 'Delete a task'
      operationId: deleteTask
      parameters:
        -
          name: taskId
          in: path
          description: 'ID of the task'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: 'Confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/tasks/{taskId}/completed':
    put:
      tags:
        - 'Task Management'
      summary: 'Complete task'
      operationId: completeTask
      parameters:
        -
          name: taskId
          in: path
          description: 'ID of the task'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/tasks/batch-delete:
    post:
      tags:
        - 'Task Management'
      summary: 'Batch Delete Task'
      operationId: batchDeleteTask
      requestBody:
        description: 'Task create request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskBatchDeleteRequest'
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/tasks/{taskId}/reopened':
    put:
      tags:
        - 'Task Management'
      summary: 'Reopen a task'
      operationId: reopenTask
      parameters:
        -
          name: taskId
          in: path
          description: 'ID of the task'
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: 'Task create request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskReopenRequest'
      responses:
        '200':
          description: 'A confirmation message'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/text-thread/list:
    post:
      tags:
        - Thread
      summary: 'Search SMS Threads'
      operationId: searchTextThreadList
      requestBody:
        description: 'notification search request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchThreadRequest'
      responses:
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '200':
          description: 'Retrieved successfully'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchThreadResponse'
      security:
        -
          bearer: []
  /v1/api/text-thread/producer:
    get:
      tags:
        - Thread
      summary: 'Get a list of producer'
      operationId: producers
      responses:
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '200':
          description: 'Retrieved successfully'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProducersResponse'
      security:
        -
          bearer: []
  /v1/api/text-thread/unread-thread:
    post:
      tags:
        - Thread
      summary: 'Unread Thread'
      operationId: unreadThread
      requestBody:
        description: 'unread thread request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UnreadThreadRequest'
      responses:
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '200':
          description: 'Retrieved successfully'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnreadThreadResponse'
      security:
        -
          bearer: []
  /v1/api/text-thread/delete-thread:
    post:
      tags:
        - Thread
      summary: 'Delete Thread'
      operationId: deleteThread
      requestBody:
        description: 'unread thread request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteThreadRequest'
      responses:
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '200':
          description: 'delete successfully'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
      security:
        -
          bearer: []
  /v1/api/text-thread/text-thread-detail:
    post:
      tags:
        - Thread
      summary: 'Text Detail Thread'
      operationId: searchTextThreadDetail
      requestBody:
        description: 'messages search request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchMessageRequest'
      responses:
        '200':
          description: 'Thread Detailed Information'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchMessageResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/v4sso/get-auth-params:
    post:
      tags:
        - 'V4SSO Authentication'
      summary: 'Get authUrl for v4sso'
      operationId: V4sso-Auth-Params
      responses:
        '200':
          description: 'JWT Token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V4ssoAuthResponse'
        '400':
          description: 'Invalid user name and/or password'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v1/api/v4sso/sso-login:
    post:
      tags:
        - 'V4SSO Authentication'
      summary: 'Log the user in'
      operationId: V4sso-Auth-Login
      requestBody:
        description: 'Dashboard data request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/V4ssoLoginRequest'
      responses:
        '200':
          description: 'JWT Token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LoginResponse'
        '400':
          description: 'Invalid user name and/or password'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v1/api/serviceTicket/service-tickets/list:
    post:
      tags:
        - 'Service Center'
      summary: 'Service Ticket List'
      operationId: list
      requestBody:
        description: 'Service ticket search request.'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchServiceTicketsRequest'
      responses:
        '200':
          description: 'Retrieved successfully'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchServiceTicketResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  /v1/api/serviceTicket/service-tickets/create:
    post:
      tags:
        - 'Service Center'
      summary: 'Create Service Ticket'
      operationId: create
      requestBody:
        description: 'Service ticket creation request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ServiceTicketCreateRequest'
      responses:
        '200':
          description: 'Service ticket created successfully'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/serviceTicket/service-tickets/{id}':
    put:
      tags:
        - 'Service Center'
      summary: 'Update Service Ticket'
      operationId: updateServiceTicket
      parameters:
        -
          name: id
          in: path
          description: 'ID of the service ticket'
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: 'Service ticket update request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ServiceTicketUpdateRequest'
      responses:
        '200':
          description: 'Service ticket updated successfully'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: 'Service ticket not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
  '/v1/api/serviceTicket/service-tickets/{id}/complete':
    post:
      tags:
        - 'Service Center'
      summary: 'Complete Service Ticket'
      operationId: completeServiceTicket
      parameters:
        -
          name: id
          in: path
          description: 'ID of the service ticket'
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: 'Service ticket complete request'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ServiceTicketCompleteRequest'
      responses:
        '200':
          description: 'Service ticket completed successfully'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '400':
          description: 'Invalid request parameter(s)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: 'Service ticket not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 'Internal processing error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        -
          bearer: []
components:
  schemas:
    EmailRequest:
      description: 'Send email request.'
    EmailTo:
      description: 'Send email tos infos'
      properties:
        linkedId:
          description: 'linked id, customer or lead'
          type: integer
        linkedType:
          description: 'linked type, customer or lead'
          type: string
        emails:
          description: 'List of emails'
          type: array
          items:
            type: string
            example: example@email.com
      type: object
    BaseSearchRequest:
      properties:
        pageSize:
          description: 'Page size:  number of results returned. The maximum is 500'
          type: integer
          default: 20
          example: 20
        page:
          description: 'The page being returned. Start with 0'
          type: integer
          default: 0
          example: 0
        sort:
          description: 'Field name used for sorting'
          type: string
          example: id
        order:
          type: string
          enum:
            - asc
            - desc
        location:
          description: 'Location ID'
          type: string
      type: object
    BaseSearchRequestNoComments: {  }
    BaseSearchRequestWithLimitedPageSize:
      properties:
        pageSize:
          description: 'Page size:  number of results returned. The maximum is 100'
          type: integer
          default: 20
          example: 20
        page:
          description: 'The page being returned. Start with 0'
          type: integer
          default: 0
          example: 0
        sort:
          description: 'Field name used for sorting'
          type: string
          example: id
        order:
          type: string
          enum:
            - asc
            - desc
        location:
          description: 'Location ID'
          type: string
      type: object
    BaseSearchRequestWithSort:
      properties:
        pageSize:
          description: 'Page size:  number of results returned. The maximum is 100'
          type: integer
          default: 20
          example: 20
        page:
          description: 'The page being returned. Start with 0'
          type: integer
          default: 0
          example: 0
        sort:
          description: 'Field name used for sorting, not in enum, or empty, default value is lastEnterStageDate'
          type: string
          default: lastEnterStageDate
          enum:
            - firstname
            - lastname
            - lastEnterStageDate
            - lastActivityDate
          example: lastEnterStageDate
        order:
          type: string
          enum:
            - asc
            - desc
        location:
          description: 'Location ID'
          type: string
      type: object
    DeviceRegisterRequest:
      properties:
        deviceToken:
          description: 'The device token'
          type: string
          example: SDSDOLPPBJETOTWNC324MBFD2084
        deviceType:
          description: 'The device type: ios or android, others'
          type: string
          example: ios
        osVersion:
          description: 'The OS version'
          type: string
          example: '12.1'
        uuid:
          description: 'The uuid'
          type: string
          example: 7946DA4E-8429-423C-B405-B3FC77914E3E
      type: object
    EmailAttachmentDTO:
      properties:
        name:
          description: 'The file name'
          type: string
          example: 'Yang Liu'
        desc:
          description: 'The store path'
          type: string
          example: /path/to/store/attachmentfile
      type: object
    LoginRequest:
      description: 'Login request model'
      required:
        - username
        - password
      properties:
        username:
          description: 'The user name, which is the user''s email'
          type: string
        password:
          description: 'The user''s password'
          type: string
        version:
          description: 'login version'
          type: string
      type: object
    ResetPasswordRequest:
      description: 'Forget Password request model'
      required:
        - email
      properties:
        email:
          description: 'The user''s email for reset password.'
          type: string
      type: object
    V4ssoLoginRequest:
      description: 'Login request model'
      required:
        - username
        - password
      properties:
        code:
          description: 'Code from v4sso callback'
          type: string
      type: object
    DepartmentGroupsRequest:
      description: 'Department and Group request model'
      properties:
        agencyNumber:
          description: 'agency number'
          type: string
      type: object
    DisconnectRequest:
      description: 'Disconnect request model'
      properties:
        vendorAccountId:
          description: 'ams agencyId'
          type: string
      type: object
    SwitchApiDeleteDataRequest:
      description: 'SwitchApiDeleteData request model'
      properties:
        vendorAccountId:
          description: 'ams agencyId'
          type: string
        apiVersion:
          description: 'hs apiVersion'
          type: string
      type: object
    AnalyticsRequest:
      description: 'Analytics request model'
      properties:
        startDate:
          description: 'Data start date'
          type: string
          example: '2019-01-01'
        endDate:
          description: 'Data end date'
          type: string
          example: '2019-01-31'
        producerId:
          description: 'Producer ID'
          type: integer
        leadSourceCategoryId:
          description: 'Lead Source Category ID. If leadSourceCategoryId filter is 0, return ''Other'' category data.'
          type: integer
        leadSourceId:
          description: 'Lead Source ID'
          type: integer
        period:
          description: 'Date range'
          type: string
          enum:
            - mtd
            - ytd
            - lastmonth
            - lastweek
          example: mtd
      type: object
    BusinessClassificationRequest:
      description: 'Business Classification Request model'
      allOf:
        -
          $ref: '#/components/schemas/BaseSearchRequest'
        -
          properties:
            searchText:
              description: 'Searching words'
              type: string
    CreateDriverRequest:
      required:
        - firstName
        - lastName
      allOf:
        -
          $ref: '#/components/schemas/DriverRequest'
        -
          properties:
            createContact:
              description: 'Default to true. if true, create a contact from the driver information.'
              type: boolean
    CreateOpportunityRequest:
      required:
        - customerReferralId
        - productLineId
      properties:
        carrierId:
          description: 'The Carrier ID. Optional if standardCarrierCode is provided.'
          type: integer
        standardCarrierCode:
          description: 'The standard code of carrier.'
          type: string
        productLineId:
          description: 'The policy type id. Optional if standardProductLineCode is provided.'
          type: integer
        standardProductLineCode:
          description: 'The standard code of product Line.'
          type: string
        customerReferralId:
          description: 'The lead id'
          type: integer
        items:
          description: 'The number of items'
          type: integer
          default: 1
          example: 1
        premium:
          description: 'The premium amount'
          type: integer
          example: 300
        expiryDate:
          description: 'The expiration date, date format is MM/dd/YYYY'
          type: string
          example: 03/29/1999
        assignTo:
          description: 'Assigned to producer/agent ID'
          type: integer
        customFields:
          description: 'A list of custom fields. If the field value is date type, use format MM/dd/YYYY.'
          type: array
          items:
            $ref: '#/components/schemas/CustomField'
        property:
          $ref: '#/components/schemas/PropertyAddress'
      type: object
    DriverRequest:
      required:
        - firstName
        - lastName
      properties:
        firstName:
          description: 'First Name'
          type: string
        middleName:
          description: 'Middle Name'
          type: string
        lastName:
          description: 'Last Name'
          type: string
        birthday:
          description: 'Date of Birth, date format is MM/dd/YYYY'
          type: string
          example: 12/31/1990
        relationship:
          description: 'Relationship. ''IN'': ''Named Insured'', ''SP'': ''Spouse'', ''PA'': ''Parent'', ''CH'': ''Child'', OT: ''Other'' '
          type: string
          enum:
            - IN
            - SP
            - PA
            - CH
            - OT
          example: IN
        gender:
          description: 'Gender. ''M'':''Male'',  ''F'':''Female'', ''U'':''Unknown'', ''X'':''Non-Binary'' '
          type: string
          enum:
            - M
            - F
            - U
            - X
          example: M
        maritalStatus:
          description: 'Marital Status. 1:''Single'', 2:''Married'', 3:''Widowed'', 4:''Separated'', 5:''Divorced'', 6:''Domestic Partner'', 7:''Civil Union'', 8:''Fiancé / Fiancée'', 9:''Unknown'', 10:''Other'' '
          type: integer
          enum:
            - 1
            - 2
            - 3
            - 4
            - 5
            - 6
            - 7
            - 8
            - 9
            - 10
          example: '1'
        stateLicensed:
          description: 'State Licensed. New York : NY'
          type: string
          example: NY
        licenseNumber:
          description: 'Driver license number'
          type: string
          example: string
      type: object
    NoteRequest:
      description: 'Add note data request model'
      required:
        - note
      properties:
        note:
          description: Note
          type: string
      type: object
    PipelinesRequest:
      description: 'Pipeline list'
      required:
        - type
      properties:
        type:
          description: 'pipeline type'
          type: string
      type: object
    StagesRequest:
      description: 'Stage list'
      properties:
        pipelineId:
          description: 'pipeline id'
          type: integer
      type: object
    UpdateOpportunityRequest:
      description: 'Required params depends on My Agency > System Settings > Required Data > Opportunity'
      properties:
        carrierId:
          description: 'The Carrier ID. Optional if standardCarrierCode is provided.'
          type: integer
        standardCarrierCode:
          description: 'The standard code of carrier.'
          type: string
        productLineId:
          description: 'The product Line ID. Optional if standardProductLineCode is provided.'
          type: integer
        standardProductLineCode:
          description: 'The standard code of product Line.'
          type: string
        items:
          description: 'The number of items'
          type: integer
          default: 1
          example: 1
        premium:
          description: 'The premium amount'
          type: integer
          example: 300
        expiryDate:
          description: 'The expiration date'
          type: string
          example: 09/19/1999
        assignTo:
          description: 'Assigned to producer/agent ID'
          type: integer
        customFields:
          description: 'A list of custom fields. If the field value is date, use format 01/01/1999'
          type: array
          items:
            $ref: '#/components/schemas/CustomField'
        property:
          $ref: '#/components/schemas/PropertyAddress'
      type: object
    UpdateProfileRequest:
      description: 'User profile update request model'
      required:
        - firstname
        - lastname
        - email
      properties:
        firstname:
          description: 'First name'
          type: string
        lastname:
          description: 'Last name'
          type: string
        email:
          description: Email
          type: string
        phone:
          description: Phone
          type: string
      type: object
    UploadFileInfo:
      description: 'upload file info model'
      properties:
        url:
          description: 'The file url'
          type: string
        name:
          description: 'The file name'
          type: string
        contentType:
          description: 'The file type'
          type: string
        size:
          description: 'The file size'
          type: integer
        tempName:
          description: 'The file temp name'
          type: string
        attachSourceType:
          description: 'Uploaded attachment''s source, ''file'' is from local, ''id'' is from Nylas'
          type: string
      type: object
    VehicleRequest:
      required:
        - make
      properties:
        vin:
          description: 'VIN Number'
          type: string
          example: 19UDE2F70M
        make:
          description: Make
          type: string
          example: ACURA
        year:
          description: Year
          type: integer
          example: 2021
        model:
          description: Model
          type: string
          example: 'ILX PREMIUM'
        ownership:
          description: 'Ownership Owned, Financed, Leased Default: If empty, it is Owned'
          type: string
          enum:
            - Owned
            - Financed
            - Leased
          example: Owned
      type: object
    BatchContactDataRequest:
      description: 'Batch contact creation request model. Max 5 contacts'
      required:
        - firstname
        - lastname
      properties:
        contactDataRequests:
          description: 'A list of contacts'
          type: array
          items:
            $ref: '#/components/schemas/ContactDataRequest'
      type: object
    ContactDataRequest:
      description: 'Contact creation or update request model'
      required:
        - firstname
        - lastname
      properties:
        customerId:
          description: 'Customer ID'
          type: integer
        leadId:
          description: 'Lead ID'
          type: integer
        firstname:
          description: 'Contact first name'
          type: string
        lastname:
          description: 'Contact last name'
          type: string
        middlename:
          description: 'Contact middle name'
          type: string
        birthday:
          description: 'birthday mm/dd/yy'
          type: string
        email:
          description: 'Contact email'
          type: string
        phone:
          description: 'Contact phone number'
          type: string
        address1:
          description: 'Street address'
          type: string
        city:
          description: city
          type: string
        state:
          description: state
          type: string
        zip:
          description: 'Postal code'
          type: string
        country:
          description: country
          type: string
      type: object
    DeleteMessageRequest:
      description: 'Delete Message'
      allOf:
        -
          $ref: '#/components/schemas/BaseSearchRequest'
        -
          properties:
            messageId:
              description: 'message id'
              type: string
    DeleteThreadRequest:
      description: 'Delete Thread'
      allOf:
        -
          $ref: '#/components/schemas/BaseSearchRequest'
        -
          properties:
            threadId:
              description: 'thread id'
              type: string
    EmailInfo:
      description: 'Send email request.'
      properties:
        email:
          description: 'The email address'
          type: string
        name:
          description: 'The email name'
          type: string
      type: object
    EmailSendingRequest:
      properties:
        threadId:
          description: 'Operation email thread id'
          type: string
        linkId:
          description: 'Linked id'
          type: integer
        linkType:
          description: 'Linked type'
          type: string
        from:
          description: 'sender''s name'
          type: string
        tos:
          description: tos
          type: array
          items:
            $ref: '#/components/schemas/EmailTo'
        subject:
          description: 'email subject'
          type: string
        message:
          description: 'email content'
          type: string
        signature:
          description: 'email signature'
          type: string
        attachments:
          description: 'upload file list'
          type: array
          items:
            $ref: '#/components/schemas/UploadFileInfo'
        isSyncToSend:
          description: 'send type (0: sync, 1: async)'
          type: boolean
          enum:
            - 0
            - 1
        replyMessageId:
          description: 'email reply id'
          type: string
      type: object
    MarkAllThreadsRequest:
      description: 'Mark Thread as Read or Unread'
      allOf:
        -
          $ref: '#/components/schemas/SearchThreadRequest'
        -
          properties:
            markUnread:
              description: 'mark unread'
              type: boolean
    SearchMessageRequest:
      description: 'search messages list model'
      allOf:
        -
          $ref: '#/components/schemas/BaseSearchRequest'
        -
          properties:
            threadId:
              description: 'thread id'
              type: string
            searchTerm:
              description: 'search param'
              type: string
            status:
              description: 'Lead status (0: all status, 2: all except trash, 100: trash,)'
              type: integer
              enum:
                - 0
                - 2
                - 100
            lastDateUTC:
              description: 'message last date by UTC'
              type: string
              example: '2019-01-01'
    SearchThreadRequest:
      description: 'Search Thread'
      allOf:
        -
          $ref: '#/components/schemas/BaseSearchRequest'
        -
          properties:
            searchTerm:
              description: 'search term'
              type: string
            from:
              description: 'from filter'
              type: string
            agentSelect:
              description: 'agent filter'
              type: string
            status:
              description: status
              type: integer
            lastDateUTC:
              description: 'last date'
              type: string
            accountId:
              description: accountId
              type: string
            isIncludeEmptyThreads:
              description: 'whether include empty threads'
              type: boolean
            unreadOnly:
              description: 'whether unread only'
              type: boolean
    UnreadThreadCountRequest:
      description: 'unread thread count request model'
    UnreadThreadRequest:
      description: 'Unread Thread'
      properties:
        threadId:
          description: 'thread id'
          type: string
        markUnread:
          description: 'mark unread'
          type: boolean
      type: object
    CustomerAnalyticsRequest:
      description: 'Customer analytics request model'
      required:
        - groupBy
      allOf:
        -
          $ref: '#/components/schemas/AnalyticsRequest'
        -
          properties:
            carrierId:
              description: 'Carrier ID'
              type: integer
            productLineId:
              description: 'Product Line ID'
              type: integer
            location:
              description: 'Location ID'
              type: string
            zipcode:
              description: 'Postal code'
              type: integer
            groupBy:
              description: 'Grouping of metrics'
              type: string
              enum:
                - producer
                - carrier
                - productLine
                - zipCode
                - leadSource
                - location
    CustomerCreateRequest:
      description: 'customer creation request model'
      required:
        - firstname
        - email
        - agentId
      allOf:
        -
          $ref: '#/components/schemas/CustomerUpdateRequest'
    CustomerSearchRequest:
      description: 'Customer search request model'
      allOf:
        -
          $ref: '#/components/schemas/BaseSearchRequestWithLimitedPageSize'
        -
          properties:
            state:
              description: 'Two-letter abbreviation of the U.S. state where the customer resides, e.g., ''CA'' for California or ''TX'' for Texas. Used to filter customers by state.'
              type: string
            city:
              description: 'The name of the city where the customer is located.'
              type: string
            email:
              description: 'The customer''s email address.'
              type: string
            phone:
              description: 'The customer''s phone number.'
              type: string
            startDate:
              description: 'The starting date for filtering customers by their creation date. Must be in ISO 8601 format, e.g., ''2024-01-01''.'
              type: string
            endDate:
              description: 'The end date for filtering customers by their creation date. Must be in ISO 8601 format, e.g., ''2024-12-31''.'
              type: string
            leadSourceId:
              description: 'The ID of the lead source that brought in the customer. Used for filtering by specific marketing or acquisition channels.'
              type: integer
            firstname:
              description: 'The customer''s first name. Supports partial match filtering for flexible searches.'
              type: string
            lastname:
              description: 'The customer''s last name. Supports partial match filtering for flexible searches.'
              type: string
            fullName:
              description: 'Full name'
              type: string
            location:
              description: 'Unique identifier of the customer''s location. Often used to filter customers within a specific branch.'
              type: string
            policyType:
              description: 'The ID of the policy type associated with the customer.'
              type: integer
            standardProductLineCode:
              description: 'The standard code of the policy type. Applicable only to enterprise users.'
              type: string
            policyNumber:
              description: 'The policy number to search for. Searches both written policies and AMS-synced policies.'
              type: string
            agentId:
              description: 'The unique identifier of the agent assigned to the policy.'
              type: integer
            status:
              description: 'The status of the customer: 1 for active, 0 for inactive, and -1 for all. The default is -1 if no filter is applied'
              type: integer
    CustomerUpdateRequest:
      description: 'Customer creation request model'
      properties:
        firstname:
          description: 'Customer first name'
          type: string
        lastname:
          description: 'Customer last name'
          type: string
        email:
          description: 'Customer email'
          type: string
        phone:
          description: 'Customer phone number'
          type: string
        secondaryEmail:
          description: 'Customer secondary email'
          type: string
        secondaryPhone:
          description: 'Customer secondary phone number'
          type: string
        streetAddress:
          description: 'Street address'
          type: string
        city:
          description: City
          type: string
        state:
          description: state
          type: string
        country:
          description: country
          type: string
        zip:
          description: 'Postal code'
          type: string
        createDate:
          description: 'Customer creation date'
          type: string
          example: '2019-01-01 10:12:30'
        bizCustomer:
          description: isBizCustomer
          type: integer
          example: '1 or 0'
        contactFirstname:
          description: 'The firstname of primary contact'
          type: string
        contactLastname:
          description: 'The lastname of primary contact'
          type: string
        contactMiddlename:
          description: 'The middle name of primary contact'
          type: string
        numberOfEmployees:
          description: 'The number of employees. Only applicable for commercial customer only.'
          type: integer
        annualRevenue:
          description: 'The annual revenue. Only applicable for commercial customer only.'
          type: number
        totalPayroll:
          description: 'The total payroll. Only applicable for commercial customer only.'
          type: integer
        tagNames:
          description: 'Tag names, can be multiple string seperated by ;'
          type: string
        birthday:
          description: 'Date of Birth, date format is MM/dd/YYYY'
          type: string
          example: 12/31/1990
        csrId:
          description: 'The CSR''s ID'
          type: integer
        agentId:
          description: 'The producer''s ID'
          type: integer
        customFields:
          description: 'A list of custom fields. If the field value is date type, use format MM/dd/YYYY.'
          type: array
          items:
            $ref: '#/components/schemas/CustomField'
      type: object
    FilterCriteria:
      description: 'Customer filter request model'
      properties:
        name:
          description: 'Customer Name'
          type: string
          example: 'David Fincher'
        customerType:
          description: 'Customer type'
          type: integer
        lifecycleStage:
          description: 'Lifecycle stage'
          type: integer
        policyCount:
          description: 'Policy count'
          type: integer
        hasTheseActivePolicies:
          description: 'Has these active policies'
          type: array
          items:
            type: integer
            example: 2834
        doesntHaveThesePolicies:
          description: 'Doesn''t have these active policies'
          type: array
          items:
            type: integer
            example: 2834
        policyNumber:
          description: 'Policy number to search for'
          type: string
        producers:
          description: Producers
          type: array
          items:
            type: integer
            example: 2834
        producersLevel:
          description: 'Producer search level'
          type: integer
        csr:
          description: CSRs
          type: array
          items:
            type: integer
            example: 2834
        csrLevel:
          description: 'CSR search level'
          type: integer
        leadSources:
          description: 'Lead sources'
          type: array
          items:
            type: integer
            example: 2834
        carriers:
          description: Carriers
          type: array
          items:
            type: integer
            example: 2834
        surveyScores:
          description: 'Survey scores'
          type: array
          items:
            type: integer
            example: 2834
        minRenewalDate:
          description: 'Min renewal date'
          type: string
          example: '2019-01-01'
        maxRenewalDate:
          description: 'Max renewal date'
          type: string
          example: '2019-01-31'
        minCreateDate:
          description: 'Min create date'
          type: string
          example: '2019-01-01'
        maxCreateDate:
          description: 'Max create date'
          type: string
          example: '2019-01-31'
        status:
          description: 'customer status'
          type: integer
          example: '1'
        location:
          description: Location
          type: string
          example: A0A0001
        batchId:
          description: batchId
          type: string
          example: '2021020202'
        fullName:
          description: fullName
          type: string
          example: 'John simth'
      type: object
    PolicyUpdateRequest:
      required:
        - carrierId
        - soldDate
        - agentId
        - policyType
        - premium
        - items
        - agencyNumber
        - effectiveDate
        - expiryDate
        - leadSourceId
      properties:
        insuredName:
          description: 'The insured name(s)'
          type: string
          example: 'Michael Jordan'
        carrierId:
          description: 'The ID of the carrier. Optional if standardCarrierCode is provided.'
          type: integer
          example: 91
        soldDate:
          description: 'The sold date'
          type: string
          example: 08/29/2019
        agentId:
          description: 'The producer ID'
          type: integer
          example: 6818
        policyType:
          description: 'The ID of the  policy type. Optional if standardProductLineCode is provided.'
          type: integer
          example: 25
        policyNumber:
          description: 'The policy number'
          type: string
        premium:
          description: 'The policy premium amount in cents'
          type: integer
          example: 34
        brokerFee:
          description: 'The policy broker fee in cents'
          type: integer
          example: 34
        items:
          description: 'The number of items'
          type: integer
          example: 1
        leadSourceId:
          description: 'The lead source id'
          type: integer
          example: 10703
        agencyNumber:
          description: 'The location number'
          type: string
          example: A0A0070
        effectiveDate:
          description: 'Effective date'
          type: string
          example: 08/29/2019
        expiryDate:
          description: 'Expiry date'
          type: string
          example: 08/29/2020
        priorCarrierName:
          description: 'Prior insurance company'
          type: string
        priorPolicyNumber:
          description: 'Prior policy number'
          type: string
        priorExpiryDate:
          description: 'Prior expiry date'
          type: string
        departmentCode:
          description: 'Department code'
          type: string
        groupCode:
          description: 'Group code'
          type: string
        csrId:
          description: 'The csr ID'
          type: integer
          example: 6818
        tagNames:
          description: 'Tag names, can be multiple string seperated by ;'
          type: string
        standardProductLineCode:
          description: 'The standard code of product Line.'
          type: string
        standardCarrierCode:
          description: 'The standard code of carrier.'
          type: string
      type: object
    DashboardDataRequest:
      description: 'Dashboard data request model'
      properties:
        period:
          description: 'Date range: today, yesterday, thisweek, lastweek, lastmonth, mtd, qtd, ytd, 2020-06-01|2020-06-30'
          type: string
          default: mtd
          example: mtd
        startDate:
          description: 'Start date'
          type: string
          example: '2019-01-01'
        endDate:
          description: 'End date'
          type: string
          example: '2019-12-31'
        loc:
          description: 'Agency Location Code.'
          type: string
          example: AOA0001
        lsp:
          description: 'Target Producer ID'
          type: integer
        insco:
          description: 'Carrier ID'
          type: integer
      type: object
    DocintakeRequest:
      description: 'service mailin create request model'
      properties:
        subject:
          description: 'email subject'
          type: string
        fromEmail:
          description: 'email from, '
          type: string
          example: abc@gmail.com
        ccEmail:
          description: 'email cc'
          type: string
          example: 'email:a@outlook.com,name:d@outlook.com'
        toEmail:
          description: 'email to'
          type: string
          example: 'email:a@outlook.com,name:d@outlook.com'
        sendDate:
          description: 'email send date, format is Y-m-d H:i:s'
          type: string
        description:
          description: 'email body'
          type: string
        fullName:
          description: 'email sender''s name'
          type: string
        requestBody:
          description: 'json string of this whole object'
          type: string
        attachments:
          description: 'json string of attachments'
          type: string
          example: '''name''=>''filename'', ''type''=>''contentType'', ''fileUrl''=>''url of aws'', ''size''=>''file size'''
        parsingError:
          description: error
          type: string
        emailThreadId:
          description: 'email thread id'
          type: string
        nylasAccountId:
          description: 'Nylas account id'
          type: string
        csr:
          description: 'csr id'
          type: string
      type: object
    Enterprise_CustomerBatchCreateRequest:
      description: 'Batch customer creation request model.'
      required:
        - customerCreateRequests
      properties:
        customerCreateRequests:
          description: 'A list of customer'
          type: array
          items:
            $ref: '#/components/schemas/Enterprise_CustomerCreateRequest'
      type: object
    Enterprise_CustomerBatchDeleteRequest:
      description: 'customer delete request model'
      required:
        - customerIds
      properties:
        customerIds:
          description: 'A list of customer Ids'
          type: array
          items:
            type: integer
        deleteContact:
          description: 'Delete the contacts?'
          type: boolean
      type: object
    Enterprise_CustomerBatchUpdateRequest:
      description: 'Batch customer update request model.'
      required:
        - customerUpdateRequests
      properties:
        customerUpdateRequests:
          description: 'A list of customer'
          type: array
          items:
            $ref: '#/components/schemas/Enterprise_CustomerUpdateRequest'
      type: object
    Enterprise_CustomerCreateRequest:
      description: 'customer creation request model'
      required:
        - firstname
        - email
        - agentId
      allOf:
        -
          $ref: '#/components/schemas/CustomerUpdateRequest'
        -
          properties:
            meta:
              description: 'A list of key-value pairs. You can store custom data with them. The metadata will be passed to the webhook along with the generated IDs.'
              type: object
              additionalProperties: true
    Enterprise_CustomerUpdateRequest:
      description: 'customer update request model'
      required:
        - customerId
        - firstname
      allOf:
        -
          $ref: '#/components/schemas/CustomerUpdateRequest'
        -
          properties:
            customerId:
              description: 'Customer Id'
              type: integer
    Enterprise_BizLeadBatchCreateRequest:
      description: 'Batch commerical lead creation request model.'
      required:
        - leadCreateRequests
      properties:
        leadCreateRequests:
          description: 'A list of commerical lead'
          type: array
          items:
            $ref: '#/components/schemas/Enterprise_BizLeadCreateRequest'
      type: object
    Enterprise_BizLeadBatchUpdateRequest:
      description: 'Batch commerical lead update request model. '
      required:
        - leadUpdateRequests
      properties:
        leadUpdateRequests:
          description: 'A list of commerical lead'
          type: array
          items:
            $ref: '#/components/schemas/Enterprise_BizLeadUpdateRequest'
      type: object
    Enterprise_BizLeadCreateRequest:
      description: 'Commerical lead creation request model'
      allOf:
        -
          $ref: '#/components/schemas/BizLeadDataRequest'
        -
          properties:
            meta:
              description: 'A list of key-value pairs. You can store custom data with them. The metadata will be passed to the webhook along with the generated IDs.'
              type: object
              additionalProperties: true
    Enterprise_BizLeadUpdateRequest:
      description: 'Commerical lead update request model'
      required:
        - leadId
        - firstname
        - email
        - leadSourceId
        - assignTo
        - country
        - pipelineId
        - stageId
      allOf:
        -
          $ref: '#/components/schemas/BizLeadDataRequest'
        -
          properties:
            leadId:
              description: 'Lead Id'
              type: integer
    Enterprise_LeadBatchCreateQuotesRequest:
      description: 'quote update request model'
      required:
        - leadCreateQuoteRequests
      properties:
        leadCreateQuoteRequests:
          description: 'A list of quotes'
          type: array
          items:
            $ref: '#/components/schemas/Enterprise_LeadCreateQuoteRequest'
      type: object
    Enterprise_LeadBatchCreateRequest:
      description: 'Batch lead creation request model.'
      required:
        - leadCreateRequests
      properties:
        leadCreateRequests:
          description: 'A list of lead'
          type: array
          items:
            $ref: '#/components/schemas/Enterprise_LeadCreateRequest'
      type: object
    Enterprise_LeadBatchDeleteQuotesRequest:
      description: 'quote delete request model'
      required:
        - quoteIds
      properties:
        quoteIds:
          description: 'A list of quotes'
          type: array
          items:
            type: integer
      type: object
    Enterprise_LeadBatchDeleteRequest:
      description: 'Batch lead delete request model. '
      required:
        - leadIds
      properties:
        leadIds:
          description: 'A list of lead Ids'
          type: array
          items:
            type: integer
        deleteContact:
          description: 'Delete the contacts?'
          type: boolean
      type: object
    Enterprise_LeadBatchMoveToSoldRequest:
      description: 'lead move to sold request model'
      required:
        - leadMoveToSoldRequests
      properties:
        leadMoveToSoldRequests:
          description: 'A list of sold information'
          type: array
          items:
            $ref: '#/components/schemas/Enterprise_LeadMoveToSoldRequest'
      type: object
    Enterprise_LeadBatchUpdateQuotesRequest:
      description: 'quote update request model'
      required:
        - leadUpdateQuoteRequests
      properties:
        leadUpdateQuoteRequests:
          description: 'A list of quotes'
          type: array
          items:
            $ref: '#/components/schemas/Enterprise_LeadUpdateQuoteRequest'
      type: object
    Enterprise_LeadBatchUpdateRequest:
      description: 'Batch lead update request model. '
      required:
        - leadUpdateRequests
      properties:
        leadUpdateRequests:
          description: 'A list of lead'
          type: array
          items:
            $ref: '#/components/schemas/Enterprise_LeadUpdateRequest'
      type: object
    Enterprise_LeadCreateQuoteRequest:
      description: 'quote creation request model'
      required:
        - leadId
        - carrierId
        - productLineId
        - items
        - premium
      allOf:
        -
          $ref: '#/components/schemas/LeadQuoteCreateRequest'
        -
          properties:
            leadId:
              description: 'Lead Id'
              type: integer
            meta:
              description: 'A list of key-value pairs. You can store custom data with them. The metadata will be passed to the webhook along with the generated IDs.'
              type: object
              additionalProperties: true
    Enterprise_LeadCreateRequest:
      description: 'lead creation request model'
      required:
        - firstname
        - email
        - leadSourceId
        - assignTo
        - country
        - pipelineId
        - stageId
      allOf:
        -
          $ref: '#/components/schemas/LeadDataRequest'
        -
          properties:
            meta:
              description: 'A list of key-value pairs. You can store custom data with them. The metadata will be passed to the webhook along with the generated IDs.'
              type: object
              additionalProperties: true
    LeadDeleteRequest:
      description: 'lead delete request model. '
      properties:
        deleteContact:
          description: 'Delete the contacts?'
          type: boolean
      type: object
    Enterprise_LeadMoveToSoldRequest:
      description: 'lead move to sold request model'
      required:
        - leadId
        - soldProducts
      allOf:
        -
          $ref: '#/components/schemas/LeadSoldRequest'
        -
          properties:
            leadId:
              description: 'Lead Id'
              type: integer
    Enterprise_LeadUpdateQuoteRequest:
      description: 'quote update request model'
      required:
        - carrierId
        - productLineId
        - items
        - premium
      allOf:
        -
          $ref: '#/components/schemas/LeadQuoteUpdateRequest'
    Enterprise_LeadUpdateRequest:
      description: 'lead update request model'
      required:
        - leadId
        - firstname
        - email
        - leadSourceId
        - assignTo
        - country
        - pipelineId
        - stageId
      allOf:
        -
          $ref: '#/components/schemas/LeadDataRequest'
        -
          properties:
            leadId:
              description: 'Lead Id'
              type: integer
    Enterprise_PolicyBatchCreateRequest:
      description: 'Batch policy creation request model.'
      required:
        - policyCreateRequests
      properties:
        policyCreateRequests:
          description: 'A list of policies'
          type: array
          items:
            $ref: '#/components/schemas/Enterprise_PolicyCreateRequest'
      type: object
    Enterprise_PolicyBatchDeleteRequest:
      description: 'Batch policy deletion request model.'
      required:
        - policyIds
      properties:
        policyIds:
          description: 'A list of policy Ids'
          type: array
          items:
            type: integer
      type: object
    Enterprise_PolicyBatchUpdateRequest:
      description: 'Batch policy creation request model.'
      required:
        - policyUpdateRequests
      properties:
        policyUpdateRequests:
          description: 'A list of policies'
          type: array
          items:
            $ref: '#/components/schemas/Enterprise_PolicyUpdateRequest'
      type: object
    Enterprise_PolicyBatchUpdateStatusRequest:
      description: 'Batch update status for policies request model. '
      required:
        - policyUpdateStatusRequests
      properties:
        policyUpdateStatusRequests:
          description: 'A list of statuses'
          type: array
          items:
            $ref: '#/components/schemas/Enterprise_PolicyUpdateStatusRequest'
      type: object
    Enterprise_PolicyCreateRequest:
      description: 'policy creation request model'
      required:
        - customerId
        - carrierId
        - soldDate
        - agentId
        - policyType
        - premium
        - items
        - agencyNumber
        - effectiveDate
        - expiryDate
        - leadSourceId
      allOf:
        -
          $ref: '#/components/schemas/PolicyUpdateRequest'
        -
          properties:
            customerId:
              description: 'The customer ID'
              type: integer
              example: 1000
            meta:
              description: 'A list of key-value pairs. You can store custom data with them. The metadata will be passed to the webhook along with the generated IDs.'
              type: object
              additionalProperties: true
    Enterprise_PolicyUpdateRequest:
      description: 'policy update request model'
      required:
        - policyId
        - productCategoryId
        - carrierId
        - soldDate
        - agentId
        - policyType
        - premium
        - items
        - agencyNumber
        - effectiveDate
        - expiryDate
        - leadSourceId
      allOf:
        -
          $ref: '#/components/schemas/PolicyUpdateRequest'
        -
          properties:
            policyId:
              description: 'Policy Id'
              type: integer
    Enterprise_PolicyUpdateStatusRequest:
      description: 'policy update status request model'
      required:
        - policyId
        - status
      properties:
        policyId:
          description: 'Policy Id'
          type: integer
        status:
          description: 'Policy''s status. 0: Cancelled, 1: Active, 10: Active-New, 11: Active-Renewed, 12: Active-Reinstated, 13: Active-Rewritten'
          type: integer
          enum:
            - 0
            - 1
            - 10
            - 11
            - 12
            - 13
      type: object
    Enterprise_UnsubscriptionCreateRequest:
      description: 'Unsubscription create requests model'
      required:
        - optoutList
        - type
      properties:
        optoutList:
          description: 'List of emails or phones to unsubscribe'
          type: array
          items:
            type: string
        type:
          description: 'Type of unsubscription: email or phone'
          type: string
          enum:
            - email
            - phone
      type: object
    Enterprise_UnsubscriptionListRequest:
      description: 'Unsubscription list requests model'
      required:
        - type
      properties:
        type:
          description: 'Type of Unsubscription: email, phone, or all'
          type: string
          enum:
            - email
            - phone
            - all
      type: object
    BatchLeadDataRequest:
      description: 'Batch lead creation request model. Max 5 leads'
      required:
        - firstname
        - email
        - leadSourceId
        - assignTo
        - country
      properties:
        leadDataRequests:
          description: 'A list of lead'
          type: array
          items:
            $ref: '#/components/schemas/LeadDataRequest'
      type: object
    BizLeadDataRequest:
      description: 'Lead data request, include business lead.'
      allOf:
        -
          $ref: '#/components/schemas/LeadDataRequest'
        -
          properties:
            name:
              description: 'Business name.'
              type: string
            contactName:
              description: 'Business contact First Name and Last Name.'
              type: string
            fein:
              description: 'Fein number'
              type: string
            businessEntity:
              description: 'Business Entity'
              type: string
            businessClassification:
              description: 'Business Classisification'
              type: string
            businessClassificationId:
              description: 'Business Classisification Id'
              type: integer
            yearBusinessStarted:
              description: 'Year Business Started'
              type: integer
            numberOfEmployees:
              description: 'Number of Employees'
              type: integer
            annualRevenue:
              description: 'Annual Revenue'
              type: integer
            payroll:
              description: 'Total Payroll'
              type: integer
            dba:
              description: DBA
              type: string
    LeadAddNoteRequest:
      properties:
        id:
          description: 'The customer referral id'
          type: integer
        note:
          description: 'The comments'
          type: string
      type: object
    LeadAnalyticsRequest:
      description: 'lead analytics request model'
      required:
        - groupBy
        - conversionType
      allOf:
        -
          $ref: '#/components/schemas/AnalyticsRequest'
        -
          properties:
            groupBy:
              description: 'Grouping of metrics'
              type: string
              enum:
                - producer
                - leadSource
                - month
            conversionType:
              description: 'Lead Conversion Type. n2s: new to sold, q2s: quote to sold, n2q: new to quote'
              type: string
              enum:
                - n2s
                - q2s
                - n2q
            workflowId:
              description: 'The ID of the workflow'
              type: integer
    LeadChangeStatusRequest:
      description: 'lead change status request model'
      required:
        - status
      properties:
        workflowId:
          description: 'Workflow Id'
          type: integer
        workflowStageId:
          description: 'Workflow stage Id'
          type: integer
        status:
          description: 'Lead status (0: ACTIVE, 2: WON, 3: LOST, 5: XDATED)'
          type: integer
          enum:
            - 0
            - 2
            - 3
            - 5
        date:
          description: 'If the status is xDated, date is the time when the lead is brought back to be active. Otherwise, it is contact or quoted date'
          type: string
          example: '2019-10-10'
        lossReasonId:
          description: 'lossReasonId is foreign key, related to table leadLossReason'
          type: integer
        xDateType:
          description: 'X-date recycle event name'
          type: string
        changeLeadSourceTo:
          description: 'changeLeadSourceTo is foreign key, related to table leadSource'
          type: integer
        recycleToStage:
          description: 'Recycle to stage ID'
          type: integer
        recycleToPipeline:
          description: 'Recycle to pipeline ID'
          type: integer
        toStageId:
          description: 'To workflow stage ID'
          type: integer
        tagIds:
          description: 'Tag IDs'
          type: array
          items:
            type: integer
            example: 1
      type: object
    LeadDataRequest:
      description: 'lead creation or update request model'
      required:
        - firstname
        - email
        - leadSourceId
        - assignTo
        - country
        - pipelineId
        - stageId
      properties:
        firstname:
          description: 'Lead first name'
          type: string
        lastname:
          description: 'Lead last name'
          type: string
        email:
          description: 'Lead email'
          type: string
        phone:
          description: 'Lead phone number'
          type: string
        secondaryEmail:
          description: 'Lead secondary email'
          type: string
        secondaryPhone:
          description: 'Lead secondary phone number'
          type: string
        notes:
          description: notes
          type: string
        pipelineId:
          description: 'Pipeline Id'
          type: integer
        stageId:
          description: 'Stage Id'
          type: integer
        contactDate:
          description: 'Last Lead Contact date'
          type: string
          example: '2019-01-01'
        soldDate:
          description: 'Lead Sold date'
          type: string
          example: '2019-01-01'
        leadSourceId:
          description: 'Lead source ID'
          type: integer
        assignmentGroupId:
          description: 'Assignment Group ID'
          type: integer
        xDate:
          description: 'Xdate date'
          type: string
          example: '2019-01-01'
        quoteDate:
          description: 'Lead quoted date'
          type: string
          example: '2019-01-01'
        assignTo:
          description: 'Assigned to producer/agent ID'
          type: integer
        csrId:
          description: 'Customer Service ID'
          type: integer
        streetAddress:
          description: 'Street address'
          type: string
        streetAddressLine2:
          description: 'Street address Line2'
          type: string
        city:
          description: City
          type: string
        state:
          description: state
          type: string
        country:
          description: country
          type: string
        zip:
          description: 'Postal code'
          type: string
        agencyNumber:
          description: 'Location code'
          type: string
        departmentCode:
          description: 'Department code'
          type: string
        groupCode:
          description: 'Group code'
          type: string
        customFields:
          description: 'A list of custom fields'
          type: array
          items:
            $ref: '#/components/schemas/CustomField'
        birthday:
          description: 'birthday mm/dd/yy'
          type: string
        nickname:
          description: Nickname
          type: string
        maritalStatus:
          description: 'Marital status'
          type: integer
        tagNames:
          description: 'Tag names, can be multiple string seperated by ;'
          type: string
        middlename:
          description: 'lead middlename ;'
          type: string
        nextExpirationDate:
          description: 'next expiration date mm/dd/yy'
          type: string
        otherProducers:
          description: 'List of other assigned to producer/agent ID'
          type: array
          items:
            type: integer
            example: 1234
        otherCsrs:
          description: 'List of other customer service ID'
          type: array
          items:
            type: integer
            example: 1234
      type: object
    LeadDetailRequest:
      description: 'Lead detail request model'
      properties:
        id:
          description: 'The customer referral id'
          type: integer
      type: object
    LeadFilesRequest:
      description: 'Lead files request model'
      allOf:
        -
          $ref: '#/components/schemas/BaseSearchRequest'
        -
          properties:
            customerReferralId:
              description: 'The customer referral id'
              type: integer
            fileType:
              description: 'The file type, (1: for quotes only)'
              type: integer
    LeadOpportunityCreateRequest:
      required:
        - carrierId
        - productLineId
        - premium
        - items
      properties:
        carrierId:
          description: 'The Carrier ID. Optional if standardCarrierCode is provided.'
          type: integer
        standardCarrierCode:
          description: 'The standard code of carrier.'
          type: string
        productLineId:
          description: 'The product Line ID. Optional if standardProductLineCode is provided.'
          type: integer
        standardProductLineCode:
          description: 'The standard code of product Line.'
          type: string
        items:
          description: 'The number of items'
          type: integer
          default: 1
          example: 1
        premium:
          description: 'The premium amount'
          type: integer
          example: 300
        expiryDate:
          description: 'The expiration date, date format is MM/dd/YYYY'
          type: string
          example: 03/29/1999
        assignTo:
          description: 'Assigned to producer/agent ID'
          type: integer
        customFields:
          description: 'A list of custom fields. If the field value is date type, use format MM/dd/YYYY.'
          type: array
          items:
            $ref: '#/components/schemas/CustomField'
      type: object
    LeadOpportunityUpdateRequest:
      required:
        - id
        - carrierId
        - productLineId
        - premium
        - items
      properties:
        id:
          description: 'The Opportunity ID'
          type: integer
        carrierId:
          description: 'The Carrier ID. Optional if standardCarrierCode is provided.'
          type: integer
        standardCarrierCode:
          description: 'The standard code of carrier.'
          type: string
        productLineId:
          description: 'The product Line ID. Optional if standardProductLineCode is provided.'
          type: integer
        standardProductLineCode:
          description: 'The standard code of product Line.'
          type: string
        items:
          description: 'The number of items'
          type: integer
          default: 1
          example: 1
        premium:
          description: 'The premium amount'
          type: integer
          example: 300
        expiryDate:
          description: 'The expiration date, date format is MM/dd/YYYY'
          type: string
          example: 03/29/1999
        assignTo:
          description: 'Assigned to producer/agent ID'
          type: integer
        customFields:
          description: 'A list of custom fields. If the field value is date, use format 01/01/1999'
          type: array
          items:
            $ref: '#/components/schemas/CustomField'
      type: object
    LeadQuoteCreateRequest:
      required:
        - carrierId
        - productLineId
        - items
        - premium
      properties:
        carrierId:
          description: 'The ID of the carrier. Optional if standardCarrierCode is provided.'
          type: integer
        productLineId:
          description: 'The ID of the  product Line. Optional if standardProductLineCode is provided.'
          type: integer
        items:
          description: 'The number of items'
          type: integer
          example: 1
        premium:
          description: 'The premium amount'
          type: integer
          example: 300
        customFields:
          description: 'A list of custom fields'
          type: array
          items:
            $ref: '#/components/schemas/CustomField'
        standardProductLineCode:
          description: 'The standard code of product Line.'
          type: string
        standardCarrierCode:
          description: 'The standard code of carrier.'
          type: string
      type: object
    LeadQuoteUpdateRequest:
      required:
        - id
        - carrierId
        - productLineId
        - items
        - premium
      properties:
        id:
          description: 'The Quote ID'
          type: integer
        carrierId:
          description: 'The ID of the carrier. Optional if standardCarrierCode is provided.'
          type: integer
        standardCarrierCode:
          description: 'The standard code of carrier.'
          type: string
        productLineId:
          description: 'The ID of the  product Line. Optional if standardProductLineCode is provided.'
          type: integer
        standardProductLineCode:
          description: 'The standard code of product Line.'
          type: string
        items:
          description: 'The number of items'
          type: integer
          example: 1
        premium:
          description: 'The premium amount'
          type: integer
          example: 300
        customFields:
          description: 'A list of custom fields'
          type: array
          items:
            $ref: '#/components/schemas/CustomField'
      type: object
    LeadSearchRequest:
      description: 'Lead search request model for filtering and retrieving lead records'
      allOf:
        -
          $ref: '#/components/schemas/BaseSearchRequestWithSort'
        -
          properties:
            id:
              description: 'Unique identifier for the lead record'
              type: integer
            assignedTo:
              description: 'Unique identifier of the agent assigned to the lead'
              type: integer
            creator:
              description: 'Unique identifier of the agent who created the lead'
              type: integer
            status:
              description: 'Current status of the lead (0: NEW, 1: QUOTED, 2: WON, 3: LOST, 4: CONTACTED, 5: EXPIRED)'
              type: integer
              enum:
                - 0
                - 1
                - 2
                - 3
                - 4
                - 5
            leadSourceId:
              description: 'Unique identifier of the lead source'
              type: integer
            customerName:
              description: 'Customer name for prefix-based search matching'
              type: string
            customerEmail:
              description: 'Customer email address for prefix-based search matching'
              type: string
            customerPhone:
              description: 'Customer phone number for prefix-based search matching'
              type: string
              example: '(123) 456-7890'
            customerPhoneList:
              description: 'Array of phone numbers for exact matching against lead records'
              type: array
              items:
                type: string
                example: 2834
            startDate:
              description: 'Start date for lead creation date range filter (YYYY-MM-DD format)'
              type: string
              example: '2019-01-01'
            endDate:
              description: 'End date for lead creation date range filter (YYYY-MM-DD format)'
              type: string
              example: '2019-01-01'
            soldPeriod:
              description: 'Predefined date range for sold leads (today, yesterday, thisweek, lastweek, lastmonth, mtd, qtd, ytd, or custom range YYYY-MM-DD|YYYY-MM-DD)'
              type: string
              enum:
                - today
                - yesterday
                - mtd
                - lastmonth
                - ytd
                - lastyear
              example: mtd
            workflowId:
              description: 'Unique identifier of the workflow associated with the lead'
              type: integer
            workflowStageId:
              description: 'Workflow stage identifier(s) for filtering leads by stage (supports multiple stages separated by ''/''，like stg2/stg3/stg5)'
              type: string
            lastActivityEarliestDate:
              description: 'Earliest date for last activity filter (YYYY-MM-DD format)'
              type: string
              example: '2019-01-01'
            lastActivityLatestDate:
              description: 'Latest date for last activity filter (YYYY-MM-DD format)'
              type: string
              example: '2019-01-01'
    LeadSoldRequest:
      description: 'Lead sold request model'
      required:
        - soldProducts
      properties:
        keepOpen:
          description: 'Keep lead open. This open happen when there is unsold lead'
          type: boolean
          default: false
        soldProducts:
          description: 'The list of products sold'
          type: array
          items:
            $ref: '#/components/schemas/SoldProduct'
      type: object
    LeadToContactedRequest:
      description: 'Lead to contacted request model'
      properties:
        id:
          description: 'Lead to quoted id'
          type: integer
        contactDate:
          description: 'The contact date'
          type: string
      type: object
    LeadToQuotedRequest:
      description: 'Lead to quoted request model'
      properties:
        id:
          description: 'The customer referral id'
          type: integer
          example: 2248
        quoteDate:
          description: 'The quote date'
          type: string
          example: 07/18/2019
      type: object
    RenameLeadFileRequest:
      description: 'Rename a lead file request model'
      properties:
        customerReferralId:
          description: 'The customer referral id'
          type: integer
        fileId:
          description: 'The customer referral file id'
          type: integer
        newFileName:
          description: 'New File name'
          type: string
      type: object
    SendEmailRequest:
      properties:
        tos:
          description: 'The recipient''s email addresses. The first address is the lead''s email address.'
          type: string
          example: example1@email.com;example2@email.com
        message:
          description: 'The message body'
          type: string
          example: 'This email is just used for testing purpose'
        subject:
          description: 'The email''s subject'
          type: string
          example: 'Testing Email'
        attachments:
          description: 'The attachments information'
          type: array
          items:
            $ref: '#/components/schemas/EmailAttachmentDTO'
      type: object
    SoldProduct:
      description: 'Product sold  model'
      required:
        - locationId
        - isSold
      properties:
        carrierId:
          description: 'The Carrier ID. Optional if standardCarrierCode is provided.'
          type: integer
        standardCarrierCode:
          description: 'The standard code of carrier.'
          type: string
        productLineId:
          description: 'The product Line ID. Optional if standardProductLineCode is provided.'
          type: integer
        standardProductLineCode:
          description: 'The standard code of product Line.'
          type: string
        premium:
          description: 'The premium amount'
          type: integer
          example: 300
        items:
          description: 'The number of items'
          type: integer
          example: 1
        leadSourceId:
          description: 'The Lead Source ID'
          type: integer
        effectiveDate:
          description: 'Pollicy effective date'
          type: string
        expiryDate:
          description: 'Pollicy expiry date'
          type: string
        soldDate:
          description: 'Pollicy sold date'
          type: string
        locationId:
          description: 'Location where the policy is sold'
          type: string
        policyNumber:
          description: 'Policy number'
          type: string
        isSold:
          description: 'Is Sold?'
          type: boolean
        departmentCode:
          description: 'Department code'
          type: string
        groupCode:
          description: 'Group code'
          type: string
        csrId:
          description: 'The Csr ID'
          type: integer
        quoteId:
          description: 'The corresponding quote ID'
          type: integer
      type: object
    ZapierLeadDataRequest:
      description: 'Zapier lead request model.'
      allOf:
        -
          $ref: '#/components/schemas/LeadDataRequest'
        -
          properties:
            id:
              description: 'Lead Id'
              type: integer
            fein:
              description: 'Fein number'
              type: string
            contactFirstName:
              description: 'Contact First Name'
              type: string
            contactMiddleName:
              description: 'Contact Middle Name'
              type: string
            contactLastName:
              description: 'Contact Last Name'
              type: string
            businessEntity:
              description: 'Business Entity'
              type: string
            businessClassification:
              description: 'Business Classisification'
              type: string
            yearBusinessStarted:
              description: 'Year Business Started'
              type: integer
            numberOfEmployees:
              description: 'Number of Employees'
              type: integer
            annualRevenue:
              description: 'Annual Revenue'
              type: integer
            payroll:
              description: 'Total Payroll'
              type: integer
    LifeSearchRequest:
      description: 'Life data request model'
      allOf:
        -
          $ref: '#/components/schemas/BaseSearchRequest'
        -
          properties:
            agentId:
              description: 'Producer/agent ID who should get the credit'
              type: integer
            efsId:
              description: 'Life & Health professional ID'
              type: integer
            status:
              description: 'A list of status. 0: new, 1: sold, 2: cancelled, 3: no deal, 4: follow up scheduled, 5: no show, 6: not issued, 7: app submitted, 8: quoted'
              type: array
              items:
                type: integer
                enum:
                  - 0
                  - 1
                  - 2
                  - 3
                  - 4
                  - 5
                  - 6
                  - 7
                  - 8
              example:
                - 0
                - 4
            start:
              description: 'Start date'
              type: string
              example: '2019-01-01'
            end:
              description: 'End date'
              type: string
              example: '2019-01-01'
            startCreate:
              description: 'Start creation date'
              type: string
              example: '2019-01-01'
            endCreate:
              description: 'End creation date'
              type: string
              example: '2019-01-01'
            customerLastname:
              description: 'Customer''s last name'
              type: string
            soldStartDate:
              description: 'Sold start date'
              type: string
              example: '2019-01-01'
            soldEndDate:
              description: 'Sold end date'
              type: string
              example: '2019-01-01'
            locationId:
              description: 'The number of the agency'
              type: string
              example: '2019-01-01'
            customerEmail:
              description: 'Customer''s email address'
              type: string
            customerPhone:
              description: 'Customer''s phone number'
              type: string
            keptOnly:
              description: 'Kept only'
              type: boolean
            setOnly:
              description: 'Set only'
              type: boolean
    CancelAccountRequest:
      description: 'Cancel Account'
      properties:
        hrAccountCancel:
          description: 'Cancel hr with agencyzoom account'
          type: boolean
          default: false
        reason:
          description: 'Cancel reason key, referrance: RefData::$cancelReasons'
          type: string
        comments:
          description: Comments
          type: string
      type: object
    ErrorReportRequest:
      properties:
        deviceType:
          description: "The device type:\n     * ios or android, others"
          type: string
          example: ios
        osVersion:
          description: 'The OS version'
          type: string
          example: '12.1'
        appVersion:
          description: 'The application version'
          type: string
          example: 1.0.2.1212
        deviceName:
          description: "The device name. Such as Iphone 11,\n     * we can map this to device type like iPhone XR or iPhone Xs Max"
          type: string
        errorDetail:
          description: 'Error json string'
          type: string
        reportUDID:
          description: 'Error UDID'
          type: string
        isPhysicalDevice:
          description: 'Simulator or real device'
          type: boolean
      type: object
    NotificationSearchRequest:
      properties:
        agentId:
          description: 'The agent id'
          type: integer
        keyword:
          description: 'Keyword for search'
          type: string
      type: object
    PolicyEndorseRequest:
      description: 'Policy endorse request model'
      required:
        - policyId
        - effectiveDate
        - endorsementNumber
        - premiumChange
        - description
      properties:
        policyId:
          description: 'Policy Id'
          type: integer
        effectiveDate:
          description: 'Endorsement Effective Date'
          type: string
          example: 08/29/2024
        endorsementNumber:
          description: 'Endorsement Number'
          type: string
        premiumChange:
          description: 'Premium change amount in cents'
          type: integer
        description:
          description: Description
          type: string
      type: object
    TagPolicyDataRequest:
      description: 'Tag policy request model'
      properties:
        policyId:
          description: 'The policy''s ID.If the AMS policy ID is passed, then this field will be ignored'
          type: integer
        amsPolicyId:
          description: 'The AMS policy''s ID'
          type: integer
        tagNames:
          description: 'Tag names, can be multiple string seperated by'
          type: string
      type: object
    PolicyImportMailinRequest:
      description: 'Policy Import mailin create request model'
      properties:
        subject:
          description: 'email subject'
          type: string
        fromEmail:
          description: 'email from'
          type: string
        ccEmail:
          description: 'email cc'
          type: string
        toEmail:
          description: 'email to'
          type: string
        sendDate:
          description: 'email send date'
          type: string
      type: object
    SearchServiceTicketsRequest:
      description: 'search service tickets request model'
      allOf:
        -
          $ref: '#/components/schemas/BaseSearchRequestWithLimitedPageSize'
        -
          properties:
            fullName:
              description: 'Name of a household'
              type: string
            status:
              description: 'Service ticket status'
              type: integer
              example: 'remove = 0; active = 1; completed = 2'
            category:
              description: 'Service ticket category'
              type: integer
              example: '0 = all;'
            priority:
              description: 'Service ticket priority'
              type: integer
              example: '0 = all;'
            resolution:
              description: 'The id of service ticket resolution'
              type: string
            completeStart:
              description: 'The complete start date of a service ticket'
              type: string
              example: 01/07/12
            completeEnd:
              description: 'The complete end date of a service ticket'
              type: string
              example: 01/07/12
            completePeriod:
              description: 'The complete priorid'
              type: string
              example: 'Customize, Last Month, etc.'
            createStart:
              description: 'The create start date of a service ticket'
              type: string
              example: 01/07/12
            createEnd:
              description: 'The create end date of a service ticket'
              type: string
              example: 01/07/12
            createPeriod:
              description: 'The complete priorid'
              type: string
              example: 'Customize, Last Month, etc.'
            timezone:
              description: 'The timezone of agency'
              type: string
              example: America/Chicago
            workflowId:
              description: 'The id of Pipeline'
              type: integer
              example: '0 = all;'
            workflowStageId:
              description: 'The id of stage'
              type: integer
              example: '0 = all;'
            tags:
              description: 'The id of tags'
              type: string
              example: '1, 2, 3'
            serviceTicketIds:
              description: 'Service ticket Ids'
              type: array
              items:
                type: integer
                example: 1
            policyType:
              description: 'The ids of policy type. Optional if standardProductLineCodes is provided.'
              type: array
              items:
                type: integer
              example:
                - 1
                - 2
                - 3
            standardProductLineCodes:
              description: 'The standard codes of policy type.'
              type: array
              items:
                type: string
              example:
                - code1
                - code2
                - code3
            carrier:
              description: 'The ids of carrier. Optional if standardCarrierCodes is provided.'
              type: array
              items:
                type: integer
              example:
                - 1
                - 2
                - 3
            standardCarrierCodes:
              description: 'The standard codes of carrier.'
              type: array
              items:
                type: string
              example:
                - code1
                - code2
                - code3
            policyNumber:
              description: 'The policy number to search for. Searches both written policies and AMS-synced policies.'
              type: string
              example: POL-2024-001
    ServiceTicketCompleteRequest:
      description: 'Service ticket complete request model'
      required:
        - id
        - resolutionId
      properties:
        id:
          description: 'Service ticket ID'
          type: integer
        resolutionId:
          description: 'Resolution type ID'
          type: integer
        resolutionDesc:
          description: 'Resolution description (optional)'
          type: string
        cancelRelatedTasks:
          description: 'Whether to cancel related tasks (optional, default: false)'
          type: boolean
      type: object
    ServiceTicketCreateRequest:
      description: 'Service ticket creation request model'
      required:
        - customerId
        - workflowId
        - workflowStageId
        - subject
        - csr
        - categoryId
        - priorityId
      properties:
        customerId:
          description: 'Customer ID'
          type: integer
        workflowId:
          description: 'Pipeline ID'
          type: integer
        workflowStageId:
          description: 'Stage ID'
          type: integer
        csr:
          description: 'CSR ID'
          type: integer
        otherCsrs:
          description: 'Array of other CSR/Producer IDs'
          type: array
          items:
            type: integer
        subject:
          description: 'Service ticket summary'
          type: string
        policyIds:
          description: 'Array of policy IDs'
          type: array
          items:
            type: integer
        bizBookIds:
          description: 'Array of AMS policy IDs'
          type: array
          items:
            type: integer
        description:
          description: 'Service ticket description'
          type: string
        priorityId:
          description: 'Priority ID'
          type: integer
        categoryId:
          description: 'Category ID'
          type: integer
        dueDate:
          description: 'Due date (format: YYYY-MM-DD)'
          type: string
          example: '2024-12-31'
        customFields:
          description: 'A list of custom fields. If the field value is date type, use format MM/dd/YYYY.'
          type: array
          items:
            $ref: '#/components/schemas/CustomField'
      type: object
    ServiceTicketRequest:
      description: 'service mailin create request model'
      properties:
        subject:
          description: 'email subject'
          type: string
        fromEmail:
          description: 'email from, '
          type: string
          example: abc@gmail.com
        ccEmail:
          description: 'email cc'
          type: string
          example: 'email:a@outlook.com,name:d@outlook.com'
        toEmail:
          description: 'email to'
          type: string
          example: 'email:a@outlook.com,name:d@outlook.com'
        sendDate:
          description: 'email send date, format is Y-m-d H:i:s'
          type: string
        description:
          description: 'email body'
          type: string
        fullName:
          description: 'email sender''s name'
          type: string
        requestBody:
          description: 'json string of this whole object'
          type: string
        attachments:
          description: 'json string of attachments'
          type: string
          example: '''name''=>''filename'', ''type''=>''contentType'', ''fileUrl''=>''url of aws'', ''size''=>''file size'''
        parsingError:
          description: error
          type: string
        emailThreadId:
          description: 'email thread id'
          type: string
        nylasAccountId:
          description: 'Nylas account id'
          type: string
        csr:
          description: 'csr id'
          type: string
      type: object
    ServiceTicketUpdateRequest:
      description: 'Service ticket update request model'
      required:
        - id
      allOf:
        -
          $ref: '#/components/schemas/ServiceTicketCreateRequest'
        -
          properties:
            id:
              description: 'Service ticket ID'
              type: integer
    SmsMessageRequest:
      description: 'send messages'
      properties:
        linkToType:
          description: 'possible values: household (customer), contact, or lead'
          type: string
        linkToId:
          description: 'The ID of the linked object'
          type: integer
        phoneNumbers:
          description: 'a list of phone numbers. can be empty. if empty, the phone number of the linked object is used'
          type: array
          items:
            type: string
        message:
          description: 'the actual message'
          type: string
        files:
          description: 'upload file list'
          type: array
          items:
            $ref: '#/components/schemas/UploadFileInfo'
      type: object
    SmsToRequest:
      description: 'Send email tos infos'
      properties:
        linkedId:
          description: 'linked id, customer or lead'
          type: integer
        linkedType:
          description: 'linked type, customer or lead'
          type: string
        phone:
          description: 'Phone Number'
          type: string
      type: object
    TaskBatchDeleteRequest:
      description: 'Task batch delete request model'
      properties:
        taskIds:
          description: 'List of task ID''s to be deleted'
          type: array
          items:
            type: integer
            example: 2834
      type: object
    TaskCreateRequest:
      description: 'Task creation request model'
      properties:
        title:
          description: 'Task title'
          type: string
          example: 'Example task'
        dueDatetime:
          description: 'Task due date time'
          type: string
          example: '2020-12-12 00:00:00'
        comments:
          description: 'Task notes'
          type: string
          example: 'This is example comments'
        assigneeId:
          description: 'Assignee ID'
          type: integer
          example: 6818
        lifeProfessionalId:
          description: 'ID of Life & Health Professional'
          type: integer
        contactEmail:
          description: 'Customer/lead email. The email will be used to find the matching lead or customer'
          type: string
        customerId:
          description: 'Customer ID linked the task'
          type: integer
        leadId:
          description: 'Lead ID linked the task'
          type: integer
          example: 240
        duration:
          description: 'Duration in minutes'
          type: integer
          example: 60
        type:
          description: 'Task type. (todo - To Do, email - Send Email, call - Make Call, meeting - Schedule Meeting)'
          type: string
          enum:
            - todo
            - email
            - call
            - meeting
        invitees:
          description: 'List of email of invitees'
          type: array
          items:
            type: string
            example: example@email.com
        timeSpecific:
          description: 'If true, then time is applicable for due date'
          type: boolean
      type: object
    TaskReopenRequest:
      properties:
        comments:
          description: 'The comments'
          type: string
          example: 'Example comments'
      type: object
    TaskSearchRequest:
      description: 'Task search request model'
      allOf:
        -
          $ref: '#/components/schemas/BaseSearchRequestNoComments'
        -
          properties:
            pageSize:
              description: 'Page size:  number of results returned. The maximum is 200'
              type: integer
              default: 20
              example: 20
            page:
              description: 'The page being returned. Start with 0'
              type: integer
              default: 0
              example: 0
            sort:
              description: 'Field name used for sorting'
              type: string
              example: id
            order:
              type: string
              enum:
                - asc
                - desc
            location:
              description: 'Location ID'
              type: string
            startDate:
              description: 'Start date of task created'
              type: string
              example: '2019-01-01'
            endDate:
              description: 'End date of task created'
              type: string
              example: '2019-01-01'
            type:
              description: 'Task type'
              type: string
              enum:
                - sales
                - onboarding
            assigneeId:
              description: 'Assignee ID'
              type: integer
            lifeProfessionalId:
              description: 'ID of Life & Health Professional'
              type: integer
            status:
              description: 'Task status. 0 - open, 1 - completed'
              type: integer
              enum:
                - 0
                - 1
            period:
              description: 'Predefined period'
              type: string
              enum:
                - past-due-rotting
                - past-due
                - remainder-week
                - next-week
                - today
            leadSourceCategoryId:
              description: 'LeadSource category id'
              type: integer
            leadSourceId:
              description: 'LeadSource id'
              type: integer
    TaskUpdateRequest:
      description: 'Task creation request model'
      allOf:
        -
          $ref: '#/components/schemas/TaskCreateRequest'
        -
          properties:
            status:
              description: 'Task status. 0: open, 1: completed'
              type: integer
              enum:
                - 0
                - 1
    WebLeadWebhookRequest:
      description: 'lead webhook create request model'
      properties:
        firstname:
          description: 'Lead first name'
          type: string
        lastname:
          description: 'Lead last name'
          type: string
        businessname:
          description: 'business name'
          type: string
        contactname:
          description: 'contact name'
          type: string
        birthday:
          description: 'contact birthday'
          type: string
        email:
          description: 'Lead email'
          type: string
        phone:
          description: 'Lead phone number'
          type: string
        otherEmail:
          description: 'Lead secondary email'
          type: string
        otherPhone:
          description: 'Lead secondary phone number'
          type: string
        notes:
          description: notes
          type: string
        streetAddress:
          description: 'Street address'
          type: string
        streetAddressLine2:
          description: 'Street address Line 2'
          type: string
        city:
          description: City
          type: string
        state:
          description: state
          type: string
        country:
          description: country
          type: string
        zip:
          description: 'Postal code'
          type: string
        maritalStatus:
          description: 'Marital status'
          type: integer
        middlename:
          description: 'lead middlename'
          type: string
        nextExpirationDate:
          description: 'lead next expiration date'
          type: string
      type: object
    BaseLinkResponse: {  }
    BaseSearchResponse:
      properties:
        totalCount:
          type: integer
          example: 100
        page:
          type: integer
          example: 1
        pageSize:
          type: integer
          example: 50
      type: object
    ErrorResponse:
      description: 'Error response model.'
      properties:
        error:
          description: 'The error message'
          type: string
        fieldErrors:
          description: 'The field errors'
          type: array
          items:
            $ref: '#/components/schemas/FieldError'
      type: object
    FieldError:
      description: 'Form field error model.'
      properties:
        field:
          description: 'The field ID'
          type: string
        error:
          description: 'The error message'
          type: string
      type: object
    GenericSuccessResponse:
      description: 'A generic succss response.'
      properties:
        message:
          description: 'An optional confirmation message'
          type: string
        id:
          description: 'A Model''s id'
          type: integer
        result:
          description: 'whether success, 1: true, 0: false'
          type: boolean
      type: object
    LoginResponse:
      description: 'Login response model. It returns the JWT token'
      properties:
        jwt:
          description: 'The JWT token'
          type: string
        ownerAgent:
          description: 'Is ownerAgent'
          type: boolean
      type: object
    AssignGroup:
      description: 'Assign Group response model'
      allOf:
        -
          $ref: '#/components/schemas/IdNamePair'
    AwsResponse:
      description: 'Aws response model'
      properties:
        key:
          description: key
          type: string
        secret:
          description: secret
          type: string
        proBucketId:
          description: 'production bucket id'
          type: string
        devBucketId:
          description: 'dev bucket id'
          type: string
      type: object
    BusinessClassificationResponse:
      description: 'Business Classification response model'
      properties:
        id:
          description: 'The classification ID'
          type: integer
        code:
          description: 'The classification code'
          type: integer
        description:
          description: 'The classification description'
          type: string
      type: object
    Carrier:
      description: 'Carrier response model'
      allOf:
        -
          $ref: '#/components/schemas/IdNamePair'
        -
          properties:
            standardCarrierCode:
              description: 'standardCarrierCode is the standard industry carrier code used when creating carrier in pulse account.'
              type: string
    CommonResponse:
      description: 'Custom Field Defination'
      properties:
        isError:
          description: 'false is no error, true is error'
          type: boolean
        errorMessage:
          description: 'error message'
          type: string
      type: object
    Csr:
      description: 'Csr model'
      allOf:
        -
          $ref: '#/components/schemas/IdNamePair'
    CsrResponse:
      description: 'Csrs response model'
      properties:
        csrs:
          description: 'list of csr'
          type: array
          items:
            $ref: '#/components/schemas/Csr'
      type: object
    CustomField:
      description: 'Custom Field'
      properties:
        fieldName:
          description: 'Field name. Reference to: https://app.agencyzoom.com/openapi/#tag/Configuration-and-Settings/operation/getCustomFieldDefs'
          type: string
          example: cf1
        fieldValue:
          description: 'Field value. Except multiple options, all data types will have single value'
          type: array
          items:
            type: string
            example: string1
      type: object
    CustomFieldDef:
      description: 'Custom Field Defination'
      properties:
        fieldName:
          description: 'Field name'
          type: string
          example: cf1
        label:
          description: 'The label of the field'
          type: string
          example: 'Example Custom Field'
        dataType:
          description: 'The data type'
          type: string
          enum:
            - number
            - text
            - multipleOptions
            - url
            - singleOption
            - date
          example: singleOption
        options:
          description: 'The options. Only applicable for singleOption and multipleOption.'
          type: array
          items:
            type: string
            example: option1
        targets:
          description: 'The applicable target'
          type: array
          items:
            $ref: '#/components/schemas/CustomFieldTarget'
      type: object
    CustomFieldTarget:
      properties:
        entityType:
          description: 'The entity type'
          type: string
          enum:
            - lead
            - customer
          example: lead
        section:
          description: 'The section'
          type: string
          enum:
            - contact
            - details
            - quote
            - opportunity
          example: details
        isShowInNew:
          description: 'whether show when add lead'
          type: boolean
        isShowInDetails:
          description: 'whether show in lead details'
          type: boolean
      type: object
    Department:
      description: 'Department response model'
      properties:
        departmentCode:
          description: 'The department code'
          type: string
        departmentName:
          description: 'The department name'
          type: string
      type: object
    DepartmentGroups:
      description: 'DepartmentGroups response model'
      properties:
        departments:
          description: 'list of departments'
          type: array
          items:
            $ref: '#/components/schemas/Department'
        groups:
          description: 'list of groups'
          type: array
          items:
            $ref: '#/components/schemas/Group'
      type: object
    Employee:
      description: 'Agencyzoom employee model'
      properties:
        id:
          description: 'The employee ID'
          type: integer
        firstname:
          description: 'First name'
          type: string
        lastname:
          description: 'Last name'
          type: string
        email:
          description: Email
          type: string
        phone:
          description: Phone
          type: string
        isProducer:
          description: 'Is the employee a producer'
          type: boolean
        isActive:
          description: 'is the employee active'
          type: boolean
        isOwner:
          description: 'Is the employee owner agent'
          type: boolean
        userId:
          description: 'The user ID'
          type: integer
        avatar:
          description: 'The avatar url'
          type: string
        externalSystem:
          description: 'External system name from AMS integration settings'
          type: string
        externalIds:
          description: 'Array of external IDs'
          type: array
          items:
            type: string
      type: object
    ExistRecycleEvents:
      description: 'ExistRecycleEvents model'
      properties:
        xDate:
          description: 'Date of X-Date'
          type: string
        xDateType:
          description: 'X-Date type'
          type: string
      type: object
    File:
      description: 'File response model'
      properties:
        id:
          description: 'The file ID'
          type: integer
        title:
          description: 'File title'
          type: string
        mediaType:
          description: 'Media Type'
          type: string
        comments:
          description: Comments
          type: string
        size:
          description: 'The file size in bytes'
          type: integer
        createDate:
          description: 'File creation date'
          type: string
          example: '2020-12-12'
        createdBy:
          description: 'File creator'
          type: string
        modifyDate:
          description: 'File modification date'
          type: string
          example: '2020-12-12'
        modifiedBy:
          description: 'File modifier'
          type: string
        entityId:
          description: 'The entity ID'
          type: integer
        docType:
          description: 'The file type, (1: for quotes)'
          type: integer
      type: object
    GetDriverDto:
      description: Driver
      properties:
        id:
          description: 'The Driver ID'
          type: integer
        firstName:
          description: firstName
          type: string
        middleName:
          description: middleName
          type: string
        lastName:
          description: lastName
          type: string
        birthday:
          description: birthday
          type: string
        gender:
          description: 'Gender. ''M'':''Male'',  ''F'':''Female'', ''U'':''Unknown'', ''X'':''Non-Binary'' '
          type: string
          enum:
            - M
            - F
            - U
            - X
          example: M
        maritalStatus:
          description: 'Marital Status. 1:''Single'', 2:''Married'', 3:''Widowed'', 4:''Separated'', 5:''Divorced'', 6:''Domestic Partner'', 7:''Civil Union'', 8:''Fiancé / Fiancée'', 9:''Unknown'', 10:''Other'' '
          type: integer
          enum:
            - 1
            - 2
            - 3
            - 4
            - 5
            - 6
            - 7
            - 8
            - 9
            - 10
          example: 1
        relationship:
          description: 'Relationship. ''IN'': ''Named Insured'', ''SP'': ''Spouse'', ''PA'': ''Parent'', ''CH'': ''Child'', OT: ''Other'' '
          type: string
          enum:
            - IN
            - SP
            - PA
            - CH
            - OT
          example: IN
        stateLicensed:
          description: 'State Licensed. New York : NY'
          type: string
          example: NY
        licenseNumber:
          description: 'Driver License Number'
          type: string
          example: string
      type: object
    GetVehicleDto:
      description: Driver
      properties:
        id:
          description: 'The Driver ID'
          type: integer
        vin:
          description: vin
          type: string
        year:
          description: year
          type: string
        make:
          description: make
          type: string
        model:
          description: model
          type: string
        ownership:
          description: 'Ownership Owned, Financed, Leased'
          type: string
          enum:
            - Owned
            - Financed
            - Leased
          example: Owned
      type: object
    Group:
      description: 'Group response model'
      properties:
        groupCode:
          description: 'The group code'
          type: string
        groupName:
          description: 'The group name'
          type: string
        departmentCode:
          description: 'The department code'
          type: string
        departmentName:
          description: 'The department name'
          type: string
      type: object
    IdNamePair:
      properties:
        id:
          description: ID
          type: integer
        name:
          description: Name
          type: string
      type: object
    Integration:
      description: 'Integration response model'
      properties:
        integrations:
          description: 'list of integration'
          type: array
          items:
            $ref: '#/components/schemas/Vendor'
      type: object
    KeyValuePair:
      properties:
        key:
          description: Key
          type: string
        value:
          description: Value
          type: string
      type: object
    LeadSource:
      description: 'Lead Source response model'
      allOf:
        -
          $ref: '#/components/schemas/IdNamePair'
        -
          properties:
            excludeAsSales:
              description: 'Are the sales with this lead source NOT counted as actual sales'
              type: boolean
            categoryId:
              description: 'lead source category ID'
              type: integer
    LeadSourceCategory:
      description: 'Lead Source Category response model'
      allOf:
        -
          $ref: '#/components/schemas/IdNamePair'
    LeadWorkflowStage:
      description: 'LeadWorkflowStage response model'
      allOf:
        -
          $ref: '#/components/schemas/WorkflowStage'
        -
          properties:
            asContacted:
              description: 'Contacted Stage'
              type: boolean
            asQuoted:
              description: 'Quoted Stage'
              type: boolean
    LifeProfessional:
      properties:
        id:
          description: 'The life professional ID'
          type: integer
        firstname:
          description: 'First name'
          type: string
        lastname:
          description: 'Last name'
          type: string
        email:
          description: Email
          type: string
        phone:
          description: Phone
          type: string
        isActive:
          description: 'Is the life professional user active'
          type: boolean
      type: object
    Location:
      description: 'Location response model'
      properties:
        id:
          description: ID
          type: string
        name:
          description: Name
          type: string
      type: object
    LossReason:
      description: 'LossReason response model'
      allOf:
        -
          $ref: '#/components/schemas/IdNamePair'
    Note:
      description: 'Note response model'
      properties:
        type:
          description: 'Note type such as email, creation, comments'
          type: string
        createDate:
          description: 'Note creation date'
          type: string
          example: '2019-01-01 10:12:30'
        createdBy:
          description: 'Note taker'
          type: string
        title:
          description: 'Note title'
          type: string
        body:
          description: 'Note body'
          type: string
        attr:
          description: 'Note attr'
          type: object
      type: object
    Opportunities:
      description: 'Custom Field'
      properties:
        id:
          description: 'Opportunity id'
          type: integer
          example: '1'
        productLineId:
          description: 'Product line id'
          type: integer
        carrierId:
          description: 'Carrier id'
          type: integer
        productName:
          description: 'Preoduct name'
          type: string
        carrierName:
          description: 'Carrier name'
          type: string
        premium:
          description: Premium
          type: integer
        items:
          description: Items
          type: integer
        sold:
          description: 'Is or not sold'
          type: boolean
        standardProductLineCode:
          description: 'standardProductLineCode is the policy type id that defined in pulse account.'
          type: integer
        standardCarrierCode:
          description: 'standardCarrierCode is the carrier id that defined in pulse account.'
          type: integer
      type: object
    OpportunityPropertyAddress:
      description: PropertyAddress
      allOf:
        -
          $ref: '#/components/schemas/PropertyAddress'
        -
          properties:
            id:
              description: 'The id of propertyAddress'
              type: integer
            leadOpportunityId:
              description: 'The id of leadOpportunity'
              type: integer
    ProductCategory:
      description: 'Product Category response model'
      allOf:
        -
          $ref: '#/components/schemas/IdNamePair'
    ProductLine:
      description: 'Product line (policy type) response model'
      allOf:
        -
          $ref: '#/components/schemas/IdNamePair'
        -
          properties:
            productCategoryId:
              description: 'Category ID'
              type: integer
            standardProductLineCode:
              description: 'standardProductLineCode is the industry standard code used when creating policy type in pulse account.'
              type: string
    PropertyAddress:
      description: PropertyAddress
      properties:
        zip:
          description: 'zip code'
          type: string
        city:
          description: 'The name of city, exp: Monticello'
          type: string
        state:
          description: 'The code of a state, exp: FL'
          type: string
        country:
          description: 'The code of country, exp: USA'
          type: string
        address1:
          description: address1
          type: string
        address2:
          description: address2
          type: string
        useMailingAddressAsLocation:
          description: '1: true, 0: false. Default is true. For example: If 1, The lead''s address information will be saved as the opportunity''s property address.'
          type: integer
          example: '1: true, 0: false'
      type: object
    RecycleEvents:
      description: 'RecycleEvents model'
      properties:
        existingXDate:
          description: 'A list of exist smart cycle date'
          type: array
          items:
            $ref: '#/components/schemas/ExistRecycleEvents'
        newXDate:
          description: 'A const list of new smart cycle date'
          type: array
          items:
            type: string
            example: X-Date
      type: object
    Refdata:
      properties:
        productCategories:
          description: 'list of product categories'
          type: array
          items:
            $ref: '#/components/schemas/ProductCategory'
        productLines:
          description: 'list of product lines'
          type: array
          items:
            $ref: '#/components/schemas/ProductLine'
        employees:
          description: 'list of employees'
          type: array
          items:
            $ref: '#/components/schemas/Employee'
        leadSourceCategories:
          description: 'list of leadsource categories'
          type: array
          items:
            $ref: '#/components/schemas/LeadSourceCategory'
        leadSources:
          description: 'list of leadsources'
          type: array
          items:
            $ref: '#/components/schemas/LeadSource'
        locations:
          description: 'list of locations'
          type: array
          items:
            $ref: '#/components/schemas/Location'
        carriers:
          description: 'list of carriers'
          type: array
          items:
            $ref: '#/components/schemas/Carrier'
        customFields:
          description: 'list of customFields'
          type: array
          items:
            $ref: '#/components/schemas/CustomFieldDef'
        lifeProfessionals:
          description: 'list of life professionals'
          type: array
          items:
            $ref: '#/components/schemas/LifeProfessional'
        workflows:
          description: 'list of workflows'
          type: array
          items:
            $ref: '#/components/schemas/Workflow'
        systemSettings:
          description: 'list of system settings'
          type: array
          items:
            $ref: '#/components/schemas/SystemSettings'
      type: object
    RequiredData:
      properties:
        email:
          description: 'whether email is required'
          type: boolean
        phone:
          description: 'whether phone is required'
          type: boolean
        zip:
          description: 'whether zip is required'
          type: boolean
        policyNumber:
          description: 'whether policyNumber is required'
          type: boolean
        leadSource:
          description: 'whether leadSource is required'
          type: boolean
        csr:
          description: 'whether csr is required'
          type: boolean
      type: object
    ServiceCategory:
      description: 'Service Category response model'
      allOf:
        -
          $ref: '#/components/schemas/IdNamePair'
    ServicePriority:
      description: 'Service Priority response model'
      allOf:
        -
          $ref: '#/components/schemas/IdNamePair'
    ServiceResolution:
      description: 'Service Resolution response model'
      allOf:
        -
          $ref: '#/components/schemas/IdNamePair'
        -
          properties:
            description:
              description: 'Optional description of the resolution'
              type: string
              nullable: true
    SystemSettings:
      properties:
        pcVisibleToAll:
          description: 'whether leads are visible to all producers'
          type: boolean
        requiredData:
          $ref: '#/components/schemas/RequiredData'
        integration:
          $ref: '#/components/schemas/Integration'
        showRevenueToAll:
          description: 'whether agency show revenue to all agents'
          type: boolean
        isAMS360:
          description: 'whether agency need group and departments'
          type: boolean
        visibleAllSales:
          description: 'whether employees can see all sales metrics'
          type: boolean
      type: object
    Task:
      description: 'Task response model'
      properties:
        id:
          description: 'Task ID'
          type: integer
          example: 2483
        title:
          description: 'Task title'
          type: string
          example: Meeting
        status:
          description: 'Status: 0 - Open, 1 - Done, 2 - Cancelled '
          type: integer
          enum:
            - 0
            - 1
            - 2
          example: 0
        createDate:
          description: 'Task Creation Date'
          type: string
          example: '2020-12-12'
        dueDate:
          description: 'Task Due Date'
          type: string
          example: '2020-12-12'
        taskDateTime:
          description: 'Task Date Time'
          type: string
          example: '2020-12-12'
        duration:
          description: 'Duration in minutes'
          type: integer
          example: 60
        completeDate:
          description: 'Task Compeletion Date'
          type: string
          example: '2020-12-12'
        assignedDate:
          description: 'Task Assigned Date'
          type: string
          example: '2020-12-12'
        comments:
          description: 'Task notes'
          type: string
          example: 'Discuss important things'
        assignees:
          description: 'List of users who are assigned to the task'
          type: array
          items:
            $ref: '#/components/schemas/User'
        completedBy:
          description: 'The ID of user who completed this task'
          type: integer
          example: '2020-12-12'
        isCompletedByEmployee:
          description: 'Was the task completed by employee or affilate'
          type: boolean
          example: true
        timeSpecific:
          description: 'Is the task time specific?'
          type: boolean
          example: true
        customerName:
          description: 'The customer name'
          type: string
          example: 'Michael Jordan'
        customerId:
          description: 'The customer''s ID'
          type: integer
          example: 123
        customerType:
          description: 'The type of customer'
          type: string
          enum:
            - customer
            - lead
          example: customer
      type: object
    TaskSearchResponse:
      description: 'Task search response model'
      allOf:
        -
          $ref: '#/components/schemas/BaseSearchResponse'
        -
          properties:
            tasks:
              description: 'A list of tasks'
              type: array
              items:
                $ref: '#/components/schemas/Task'
            outstandingCount:
              type: integer
              example: 100
    User:
      description: 'Agencyzoom user model'
      properties:
        id:
          description: 'The User ID'
          type: integer
          example: 6818
        firstname:
          description: 'First name'
          type: string
          example: Michael
        lastname:
          description: 'Last name'
          type: string
          example: Jordan
        isEmployee:
          description: 'Is the user an employee or an affiliate'
          type: boolean
          default: true
          example: true
      type: object
    Vendor:
      description: 'Vendor details'
      properties:
        vendor:
          description: 'The name integaration vendor'
          type: string
        active:
          description: Status
          type: boolean
      type: object
    Workflow:
      description: 'Workflow response model'
      properties:
        id:
          description: 'Workflow id'
          type: integer
          example: '1'
        name:
          description: 'Workflow name'
          type: string
        type:
          description: 'workflow type'
          type: string
        seq:
          description: Seq
          type: integer
        status:
          description: Status
          type: integer
        stages:
          description: 'list of stages'
          type: array
          items:
            $ref: '#/components/schemas/WorkflowStage'
      type: object
    WorkflowStage:
      description: 'WorkflowStage response model'
      properties:
        id:
          description: 'Workflow stage id'
          type: integer
          example: '1'
        name:
          description: 'Workflow stage name'
          type: string
        seq:
          description: Seq
          type: integer
        status:
          description: Status
          type: integer
      type: object
    EmailAddressInfo:
      description: 'Email address info'
      properties:
        email:
          description: address
          type: string
        name:
          description: name
          type: string
      type: object
    EmailSignatureResponse:
      description: 'Email Signature Response'
      properties:
        signature:
          description: 'Temail signature'
          type: string
      type: object
    EmailSyncSettingInfo:
      description: 'Email Sync Setting Info'
      properties:
        id:
          description: 'Id of emailSyncSetting'
          type: integer
        accountId:
          description: 'account id'
          type: string
        current:
          description: 'account is active or not'
          type: boolean
        syncStatus:
          description: 'account sync status'
          type: boolean
        agencyId:
          description: 'Id of agency'
          type: integer
        agentId:
          description: 'Id of agent'
          type: integer
        accessToken:
          description: 'access token'
          type: string
        syncEmail:
          description: 'synced email'
          type: string
        emailSyncLabels:
          description: 'synced email folder json string'
          type: string
        lastSyncDateTime:
          description: 'last sync date time'
          type: string
        lastSendRemindDate:
          description: 'last sent remind email date time'
          type: string
        lastSyncCursor:
          description: 'last sync position'
          type: string
        createdBy:
          description: 'created agent''s id'
          type: integer
        createDate:
          description: 'created date'
          type: string
        modifiedBy:
          description: 'modified agent''s id'
          type: integer
        modifyDate:
          description: 'modified date'
          type: string
        provider:
          description: 'provider of email, az or sendgrid or others'
          type: string
        unitType:
          description: 'email folder unit type(label or folder)'
          type: string
        syncBeforeDays:
          description: 'start to sync before days'
          type: integer
        syncType:
          description: '?'
          type: boolean
        startSyncDate:
          description: 'start sync utc time stamp'
          type: integer
        accountStatus:
          description: 'account sync status'
          type: string
        disconnectCount:
          description: 'disconnect count'
          type: integer
        connectionCount:
          description: 'connect count'
          type: integer
        sentErrorCount:
          description: 'send error count'
          type: integer
        lastDisconnection:
          description: 'last disconnect date'
          type: string
        lastConnection:
          description: 'last connect date'
          type: string
        lastError:
          description: 'last error date'
          type: string
        autoSwitchToSystemEmail:
          description: 'is auto switch to system'
          type: boolean
        notifyDisconnect:
          description: 'should send notify email if disconnect'
          type: boolean
      type: object
    FileInfo:
      description: 'file info model'
      properties:
        id:
          description: 'The file id'
          type: integer
        filename:
          description: 'The file name'
          type: string
        size:
          description: 'The file size'
          type: integer
        url:
          description: 'The file url'
          type: string
        vendorId:
          description: 'The vendor id of file(Nylas)'
          type: string
        docFileName:
          description: 'The file name'
          type: string
        docMediaType:
          description: 'The file media type'
          type: string
      type: object
    MessageInfo:
      description: 'message info model'
      properties:
        id:
          description: 'The message id'
          type: integer
        messageId:
          description: 'The synced message id'
          type: string
        threadId:
          description: 'The synced message thread id'
          type: string
        contactId:
          description: 'customerReferral id or household id'
          type: integer
        contactName:
          description: 'customerReferral name or household name'
          type: string
        agentFirstname:
          description: 'agent first name'
          type: string
        agentLastname:
          description: 'agent last name'
          type: string
        outbound:
          description: 'Lead status (0: receive, 1: send'
          type: boolean
          enum:
            - 0
            - 1
        messageDate:
          description: 'message created date'
          type: string
          example: '2019-01-01'
        messageDateUTC:
          description: 'message local date'
          type: string
          example: '2019-01-01'
        status:
          description: 'customerEmail tracking status'
          type: string
        subject:
          description: 'message subject'
          type: string
          example: '<body>hello</body>'
        snippet:
          description: 'message snippet'
          type: string
          example: '<body>hello 1</body>'
        contactType:
          description: 'contact type'
          type: string
          example: 'customer, lead, contact'
        body:
          description: 'message body'
          type: string
          example: '<body>hello</body>'
        senderName:
          description: 'az or other email provider'
          type: string
        contactEmail:
          description: 'contact name'
          type: string
        contactPhone:
          description: 'contact phone'
          type: string
        providerSmsMessageSid:
          description: 'The providerSmsMessageSid'
          type: varchar
        files:
          description: 'A list of files'
          type: array
          items:
            $ref: '#/components/schemas/FileInfo'
        imageFiles:
          description: 'A list of image files'
          type: array
          items:
            $ref: '#/components/schemas/FileInfo'
        froms:
          description: 'A list of email addresses'
          type: array
          items:
            $ref: '#/components/schemas/EmailAddressInfo'
        tos:
          description: 'A list of email addresses'
          type: array
          items:
            $ref: '#/components/schemas/EmailAddressInfo'
        cc:
          description: 'A list of email cc addresses'
          type: array
          items:
            $ref: '#/components/schemas/EmailAddressInfo'
        bcc:
          description: 'A list of email bcc addresses'
          type: array
          items:
            $ref: '#/components/schemas/EmailAddressInfo'
        downloadAllAttUrl:
          description: 'Download all attachments url'
          type: string
      type: object
    ProducerInfo:
      description: 'Text conversation producer model'
      properties:
        id:
          description: 'The agent id'
          type: string
        name:
          description: 'full name'
          type: string
      type: object
    ProducersResponse:
      description: 'conversation producer response model'
      properties:
        producers:
          description: 'The producer list'
          type: array
          items:
            $ref: '#/components/schemas/ProducerInfo'
      type: object
    SearchMessageResponse:
      description: 'messages list model'
      properties:
        messageInfo:
          description: 'The message list'
          type: array
          items:
            $ref: '#/components/schemas/MessageInfo'
        messageCount:
          description: 'The messages count of a thread'
          type: integer
      type: object
    SearchThreadResponse:
      description: 'Search thread response model'
      properties:
        threadInfo:
          description: 'The thread list'
          type: array
          items:
            $ref: '#/components/schemas/ThreadInfo'
      type: object
    ThreadInfo:
      description: 'ThreadInfo model'
      properties:
        id:
          description: 'The thread ID'
          type: string
        subject:
          description: subject
          type: string
        snippet:
          description: snippet
          type: string
        lastMessageDate:
          description: lastMessageDate
          type: string
        lastMessageDateUTC:
          description: lastMessageDateUTC
          type: string
        contactId:
          description: 'contact Id'
          type: integer
        contactName:
          description: 'contact Name'
          type: string
        contactEmail:
          description: 'contact email'
          type: string
        contactType:
          description: 'contact type'
          type: string
        unread:
          description: unread
          type: boolean
        phoneNumber:
          description: phonenumber
          type: string
      type: object
    UnreadThreadCountResponse:
      description: 'Search thread response model'
      properties:
        emailUnreadCount:
          description: 'The email unread count'
          type: integer
        textUnreadCount:
          description: 'The text unread count'
          type: integer
        smsEnable:
          description: 'The text enable'
          type: boolean
      type: object
    UnreadThreadResponse:
      description: 'Unread thread response model'
      properties:
        threadId:
          description: 'thread id'
          type: string
        success:
          description: 'mark unread result'
          type: boolean
      type: object
    AmsPolicy:
      description: 'The AMS policy details'
      properties:
        id:
          description: 'Unique identifier for the AMS policy record within the system'
          type: integer
        leadSourceId:
          description: 'Identifier of the lead source that generated this policy, used for tracking marketing effectiveness and lead attribution'
          type: integer
          example: 1
        carrierId:
          description: 'Unique identifier of the insurance carrier (company) that underwrites and provides coverage for this policy'
          type: integer
        policyTypeName:
          description: 'Human-readable name of the policy type or product line (e.g., ''Auto Insurance'', ''Home Insurance'', ''Life Insurance'')'
          type: string
        policyTypeId:
          description: 'Numeric identifier for the policy type, used for system classification and reporting purposes'
          type: integer
        policyNumber:
          description: 'Official policy number assigned by the insurance carrier, used for identification and claims processing'
          type: string
        premium:
          description: 'Total annual premium amount for the policy expressed in cents (multiply by 100 for dollar amount to avoid floating point precision issues)'
          type: integer
        items:
          description: 'Number of covered items or units under this policy (e.g., vehicles for auto insurance, properties for homeowner''s insurance)'
          type: integer
        soldDate:
          description: 'Date when the policy was successfully sold and finalized, typically in YYYY-MM-DD format'
          type: string
        agentId:
          description: 'Unique identifier of the insurance agent (producer) who sold and manages this policy'
          type: integer
        agentName:
          description: 'Full name of the insurance agent (producer) responsible for this policy''s sales and ongoing management'
          type: string
        csrId:
          description: 'Unique identifier of the Customer Service Representative (CSR) assigned to handle customer inquiries and policy servicing'
          type: integer
        csrName:
          description: 'Full name of the Customer Service Representative (CSR) who provides ongoing customer support for this policy'
          type: string
        effectiveDate:
          description: 'Date when the insurance coverage begins and the policy becomes active, typically in YYYY-MM-DD format'
          type: string
          example: '2019-01-01'
        expiryDate:
          description: 'Date when the insurance coverage ends and the policy expires, typically in YYYY-MM-DD format unless renewed'
          type: string
          example: '2020-01-01'
        tagNames:
          description: 'Comma-separated list of descriptive tags or labels attached to this policy for categorization, filtering, and organizational purposes'
          type: string
        standardProductLineId:
          description: 'standardProductLineId is the policy type id that defined in pulse account.'
          type: integer
        externalSystem:
          description: 'External System'
          type: string
        externalId:
          description: 'External ID'
          type: string
        status:
          description: 'Policy''s status. 0: Inactive, 1: Active, 2: Pending, 3:Upcoming, 11: Voided, 12: Expired, 100: Unknown Status'
          type: integer
          enum:
            - 0
            - 1
            - 2
            - 3
            - 11
            - 12
            - 100
      type: object
    BaseCustomer:
      description: Customer
      properties:
        id:
          description: 'The customer ID'
          type: integer
        businessName:
          description: 'Business name'
          type: string
        firstname:
          description: 'Customer first name'
          type: string
        middlename:
          description: 'Customer middle name'
          type: string
        lastname:
          description: 'Customer last name'
          type: string
        email:
          description: 'The customer''s email address.'
          type: string
        phone:
          description: 'The customer''s phone number.'
          type: string
        secondaryEmail:
          description: 'The secondary customer''s email address.'
          type: string
        secondaryPhone:
          description: 'The secondary customer''s phone number.'
          type: string
        streetAddress:
          description: 'The street portion of the customer’s physical or mailing address.'
          type: string
        city:
          description: 'The name of the city where the customer is located.'
          type: string
        state:
          description: 'Two-letter abbreviation of the U.S. state where the customer resides, e.g., ''CA'' for California or ''TX'' for Texas. Used to filter customers by state.'
          type: string
        country:
          description: 'The country associated with the customer''s address.'
          type: string
        zip:
          description: 'The postal or ZIP code for the customer’s location.'
          type: string
        createDate:
          description: 'Customer creation date'
          type: string
          example: '2019-01-01 10:12:30'
        asCustomerDate:
          description: 'Signup date'
          type: string
          example: '2019-01-01 10:12:30'
        customerType:
          description: 'Customer type (e.g. personal, business)'
          type: string
        customFields:
          description: 'A list of custom fields'
          type: array
          items:
            $ref: '#/components/schemas/CustomField'
      type: object
    BaseCustomerSummary:
      allOf:
        -
          $ref: '#/components/schemas/BaseCustomer'
        -
          $ref: '#/components/schemas/BaseCustomerSummaryTrait'
    BaseCustomerSummaryTrait:
      properties:
        source:
          description: Source
          type: string
        agentId:
          description: 'The id of agent'
          type: integer
        housename:
          description: 'Housename of customer'
          type: string
        agencyNumber:
          description: 'Location name'
          type: string
        policySummary:
          description: 'Policy summary'
          type: string
        welcomeKitEmailedOn:
          description: 'Is welcomekit email on'
          type: string
        welcomeCallAssignedTo:
          description: 'The id of agent'
          type: integer
        agentFirstname:
          description: 'Agent first name'
          type: string
        agentLastname:
          description: 'Agent last name'
          type: string
        lifeAppt:
          description: 'The id of agent'
          type: integer
        csrFirstname:
          description: 'Csr first name'
          type: string
        csrLastname:
          description: 'Csr last name'
          type: string
        vendor:
          description: 'Vendor name'
          type: string
        externalSystem:
          description: 'External System'
          type: string
        externalId:
          description: 'External ID'
          type: string
      type: object
    Customer:
      description: Customer
      allOf:
        -
          $ref: '#/components/schemas/BaseCustomer'
        -
          properties:
            contactFirstName:
              description: 'Contact first name (Deprecated)'
              type: string
              writeOnly: true
              deprecated: true
            contactMiddleName:
              description: 'Contact middle name (Deprecated)'
              type: string
              writeOnly: true
              deprecated: true
            contactLastName:
              description: 'Contact last name (Deprecated)'
              type: string
              writeOnly: true
              deprecated: true
    CustomerAnalyticsResponse:
      description: 'Customer analytics response model'
      properties:
        groupByValue:
          description: 'The value of grouping'
          type: string
        producerId:
          description: 'The producer ID'
          type: integer
        producerFirstName:
          description: 'The producer first name'
          type: string
        producerLastName:
          description: 'The producer last name'
          type: string
        premiums:
          description: 'Premium sold'
          type: integer
        items:
          description: 'Number of items sold'
          type: integer
        policies:
          description: 'Number of policies sold'
          type: integer
        points:
          description: 'Number of points'
          type: integer
        sales:
          description: 'Number of sales'
          type: integer
      type: object
    CustomerDetail:
      allOf:
        -
          $ref: '#/components/schemas/Customer'
        -
          properties:
            policies:
              description: 'List of policies'
              type: array
              items:
                $ref: '#/components/schemas/Policy'
            notes:
              description: 'List of notes'
              type: array
              items:
                $ref: '#/components/schemas/Note'
            tasks:
              description: 'List of tasks'
              type: array
              items:
                $ref: '#/components/schemas/Task'
            files:
              description: 'List of files'
              type: array
              items:
                $ref: '#/components/schemas/File'
            totalPremium:
              description: 'Total premium of policies'
              type: integer
            birthday:
              description: Birthday
              type: string
            externalSystem:
              description: 'External System'
              type: string
            externalId:
              description: 'External ID'
              type: string
    CustomerPolicy:
      allOf:
        -
          $ref: '#/components/schemas/Customer'
        -
          properties:
            policy:
              description: 'A Policy'
              type: array
              items:
                $ref: '#/components/schemas/Policy'
            birthday:
              description: Birthday
              type: string
            nickname:
              description: Nickname
              type: string
            maritalStatus:
              description: 'Marital Status'
              type: string
            fein:
              description: 'Fein number'
              type: string
            businessEntity:
              description: 'Business Entity'
              type: string
            businessClassificationId:
              description: 'Number of classification'
              type: integer
            businessClassificationCode:
              description: 'Business Classisification Code'
              type: string
            businessClassification:
              description: 'Business Classisification Description'
              type: string
            yearBusinessStarted:
              description: 'Year Business Started'
              type: integer
            numberOfEmployees:
              description: 'Number of Employees'
              type: integer
            annualRevenue:
              description: 'Annual Revenue'
              type: integer
            payroll:
              description: 'Total Payroll'
              type: integer
    CustomerPolicyBriefInfo:
      description: 'Policy brief infos for customer list on mobile'
      properties:
        householdId:
          description: 'The household id'
          type: integer
        policyId:
          description: 'The policy ID'
          type: integer
        policyNumber:
          description: 'Policy number'
          type: string
        effectiveDate:
          description: 'Effective date'
          type: string
        expiryDate:
          description: 'Expiry date'
          type: string
        signedDate:
          description: 'Signed date'
          type: string
        policyType:
          description: 'The policy type'
          type: string
        policyCode:
          description: 'The policy code'
          type: string
        standardProductLineCode:
          description: 'standardProductLineCode is the standard code used when creating policy type in pulse account.'
          type: string
      type: object
    CustomerSearchNoDetailResponse:
      description: 'Customer search response'
      allOf:
        -
          $ref: '#/components/schemas/BaseSearchResponse'
        -
          properties:
            customers:
              description: 'List of customers that meet the search criteria'
              type: array
              items:
                $ref: '#/components/schemas/BaseCustomerSummary'
    CustomerSearchResponse:
      description: 'Customer search response'
      allOf:
        -
          $ref: '#/components/schemas/BaseSearchResponse'
        -
          properties:
            customers:
              description: 'List of customers that meet the search criteria'
              type: array
              items:
                $ref: '#/components/schemas/CustomerSummary'
    CustomerSummary:
      allOf:
        -
          $ref: '#/components/schemas/Customer'
        -
          $ref: '#/components/schemas/BaseCustomerSummaryTrait'
        -
          properties:
            taskCount:
              description: 'The number of tasks (Deprecated)'
              type: integer
              writeOnly: true
              deprecated: true
            policyCount:
              description: 'The number of policies (Deprecated)'
              type: integer
              writeOnly: true
              deprecated: true
            totalPremium:
              description: 'Total premium of policies (Deprecated)'
              type: integer
              writeOnly: true
              deprecated: true
            policyInfos:
              description: 'Policies brief informations (Deprecated)'
              type: array
              items:
                $ref: '#/components/schemas/CustomerPolicyBriefInfo'
              writeOnly: true
              deprecated: true
    Policy:
      description: 'An insurance policy'
      properties:
        insuredId:
          description: 'The insured ID'
          type: integer
        policyId:
          description: 'The policy ID'
          type: integer
        insuredName:
          description: 'The insured name(s)'
          type: string
        carrierId:
          description: 'The carrier ID'
          type: integer
        carrierName:
          description: 'The carrier name'
          type: string
        soldDate:
          description: 'The sold date'
          type: string
        agentId:
          description: 'The producer ID'
          type: integer
        csrId:
          description: 'Customer Service ID'
          type: integer
        csrName:
          description: 'Customer Service Name'
          type: string
        policyType:
          description: 'The policy type ID'
          type: integer
        policyTypeName:
          description: 'The policy type name'
          type: string
        policyNumber:
          description: 'The policy number'
          type: string
        premium:
          description: 'The policy premium amount in cents'
          type: integer
        brokerFee:
          description: 'The policy broker fee in cents'
          type: integer
        items:
          description: 'The number of items'
          type: integer
        spp:
          description: 'The SPP items included im the policy'
          type: integer
        points:
          description: 'The calculated points '
          type: integer
        trailer:
          description: 'The SPP items included im the policy'
          type: integer
        streetAddress:
          description: 'Street address for the insured property'
          type: string
        city:
          description: 'city for the insured property'
          type: string
        state:
          description: 'State for the insured property'
          type: string
        postalCode:
          description: 'Postall code for the insured property'
          type: string
        leadSourceId:
          description: 'The lead source id'
          type: integer
          example: 1
        agencyNumber:
          description: 'The location number'
          type: string
          example: A034727
        effectiveDate:
          description: 'Effective date'
          type: string
          example: '2019-01-01'
        expiryDate:
          description: 'Expiry date'
          type: string
          example: '2020-01-01'
        priorPolicyNumber:
          description: 'Prior policy number'
          type: string
        priorExpiryDate:
          description: 'Prior expiry date'
          type: string
        priorCarrierName:
          description: 'Prior carrier name'
          type: string
        productCategoryId:
          description: 'The product ID'
          type: integer
        departmentCode:
          description: 'Department code'
          type: string
        departmentName:
          description: 'Department name'
          type: string
        groupCode:
          description: 'Group code'
          type: string
        groupName:
          description: 'Group name'
          type: string
        locationName:
          description: 'Location name'
          type: string
        standardProductLineCode:
          description: 'The standard code of product Line.'
          type: string
        standardCarrierCode:
          description: 'The standard code of carrier.'
          type: string
        externalSystem:
          description: 'External System'
          type: string
        externalId:
          description: 'External ID'
          type: string
      type: object
    WrittenPolicy:
      description: 'The policy details'
      properties:
        id:
          description: 'Unique identifier for the policy.'
          type: integer
        leadSourceId:
          description: 'Identifier of the lead source associated with this policy.'
          type: integer
          example: 1
        policyTypeName:
          description: 'Descriptive name of the policy type.'
          type: string
        carrierId:
          description: 'Unique identifier for the insurance carrier. Optional if standardCarrierCode is specified.'
          type: integer
        standardCarrierCode:
          description: 'Standardized code representing the insurance carrier.'
          type: string
        policyTypeId:
          description: 'Unique identifier for the policy type. Optional if standardProductLineCode is specified.'
          type: string
        standardProductLineCode:
          description: 'Standardized code representing the policy product line.'
          type: string
        policyNumber:
          description: 'Official policy number assigned by the carrier.'
          type: string
        premium:
          description: 'Total premium amount for the policy, expressed in cents.'
          type: integer
        items:
          description: 'Number of insured items or risks covered under the policy.'
          type: integer
        soldDate:
          description: 'Date when the policy was sold or issued.'
          type: string
        agentId:
          description: 'Unique identifier for the agent or producer responsible for the policy.'
          type: integer
        agentName:
          description: 'Full name of producer.'
          type: string
        csrId:
          description: 'Unique identifier for the customer service representative (CSR) assigned to the policy.'
          type: integer
        csrName:
          description: 'Full name of the customer service representative (CSR).'
          type: string
        effectiveDate:
          description: 'Date when the policy coverage becomes effective.'
          type: string
          example: '2019-01-01'
        expiryDate:
          description: 'Date when the policy coverage expires.'
          type: string
          example: '2020-01-01'
        tagNames:
          description: 'Comma-separated list of tags associated with the policy.'
          type: string
        externalSystem:
          description: 'External System'
          type: string
        externalId:
          description: 'External ID'
          type: string
        status:
          description: 'Policy''s status. 0: Cancelled, 1: Active, 3: Upcoming, 4: Renewed, 10: Active-New, 11: Active-Renewed, 12: Active-Reinstated, 13: Active-Rewritten'
          type: integer
          enum:
            - 0
            - 1
            - 3
            - 4
            - 10
            - 11
            - 12
            - 13
      type: object
    DailyDetailedSalesList:
      description: 'Daily detailed sales of premium, items, policies, and points for a period of time'
      properties:
        premium:
          description: 'The daily sales in premium'
          type: array
          items:
            $ref: '#/components/schemas/DailySales'
        revenue:
          description: 'The daily sales in revenue'
          type: array
          items:
            $ref: '#/components/schemas/DailySales'
        items:
          description: 'The daily sales in number of items'
          type: array
          items:
            $ref: '#/components/schemas/DailySales'
        policies:
          description: 'The daily sales in number of policies'
          type: array
          items:
            $ref: '#/components/schemas/DailySales'
        points:
          description: 'The daily sales in points'
          type: array
          items:
            $ref: '#/components/schemas/DailySales'
        brokerfees:
          description: 'The daily sales in broker fees'
          type: array
          items:
            $ref: '#/components/schemas/DailySales'
        condo:
          description: 'The daily sales in condos'
          type: array
          items:
            $ref: '#/components/schemas/DailySales'
        baseline:
          description: 'The daily sales in baseline'
          type: array
          items:
            $ref: '#/components/schemas/DailySales'
      type: object
    DailySales:
      description: 'Daily sales for a particular metrics'
      properties:
        date:
          description: 'The date'
          type: string
          format: date
        sales:
          description: 'The quantity of the sales'
          type: integer
      type: object
    DashboardData:
      description: 'Dashboard data response model'
      properties:
        goalTypes:
          description: 'Agency primary and secondary goals'
          type: array
          items:
            type: string
            enum:
              - premium
              - items
              - points
              - policies
              - brokerFees
          example:
            - premium
            - items
        agency:
          $ref: '#/components/schemas/SalesProgress'
        agents:
          description: 'Sales progress for eah producer'
          type: array
          items:
            $ref: '#/components/schemas/SalesProgress'
      type: object
    SalesProgress:
      description: 'Sales progress for a producer/agent'
      properties:
        agentId:
          description: 'The producer ID. It can be null if the progress is for the whole agency'
          type: integer
        monthlyGoal:
          description: 'The primary monthly goal for the producer or agency'
          type: integer
        monthlySecondary:
          description: 'The secondary monthly goal for the producer or agency'
          type: integer
        monthlySales:
          description: 'The  monthly sales ( primary goal metrics) for the producer or agency'
          type: integer
        shouldBeAt:
          description: 'The expected monthly sales ( primary goal metrics) for the producer or agency'
          type: integer
        todayGoal:
          description: 'Today''s sales goal (primary goal metrics) for the producer or agency'
          type: integer
        todaySales:
          description: 'Today''s sales ( primary goal metrics) for the producer or agency'
          type: integer
        todayNeeded:
          description: 'Today''s remaining sales goal ( primary goal metrics) for the producer or agency'
          type: integer
        trending:
          description: 'The monthly trending sales number ( primary goal metrics) for the producer or agency'
          type: integer
        pastWeek:
          $ref: '#/components/schemas/DailyDetailedSalesList'
        dailyAccSales:
          description: 'The sales in the past month'
          type: array
          items:
            $ref: '#/components/schemas/DailySales'
        monthlyPremium:
          description: 'The  monthly premium for the producer or agency'
          type: integer
        monthlyItems:
          description: 'The  monthly items for the producer or agency'
          type: integer
        monthlyPolicies:
          description: 'The  monthly policies for the producer or agency'
          type: integer
        monthlyPoints:
          description: 'The  monthly points for the producer or agency'
          type: integer
        monthlyAuto:
          description: 'The  monthly auto for the producer or agency'
          type: integer
        monthlyHome:
          description: 'The  monthly home for the producer or agency'
          type: integer
        monthlyBrokerFees:
          description: 'The  monthly broker fees for the producer or agency'
          type: integer
        monthlyRevenue:
          description: 'The monthly revenue for the producer or agency'
          type: integer
        monthlyCondo:
          description: 'The  monthly condo for the producer or agency'
          type: integer
        monthlyBaselinePolicies:
          description: 'The  monthly baseline for the producer or agency'
          type: integer
      type: object
    Lead:
      description: 'Lead data response model'
      properties:
        id:
          description: 'Unique identifier for the lead.'
          type: integer
        firstname:
          description: 'Lead''s first name.'
          type: string
        middlename:
          description: 'Lead''s middle name.'
          type: string
        lastname:
          description: 'Lead''s last name.'
          type: string
        leadType:
          description: 'Type of the lead (e.g., personal, business).'
          type: string
        email:
          description: 'Primary email address of the lead.'
          type: string
        phone:
          description: 'Primary phone number of the lead.'
          type: string
        secondaryEmail:
          description: 'Secondary email address of the lead.'
          type: string
        secondaryPhone:
          description: 'Secondary phone number of the lead.'
          type: string
        streetAddress:
          description: 'Street address of the lead.'
          type: string
        city:
          description: 'City of the lead''s address.'
          type: string
        state:
          description: 'State of the lead''s address.'
          type: string
        country:
          description: 'Country of the lead''s address.'
          type: string
        zip:
          description: 'Postal or ZIP code of the lead''s address.'
          type: string
        comments:
          description: 'Additional comments or notes about the lead.'
          type: string
        status:
          description: 'Current status of the lead (0: NEW, 1: QUOTED, 2: WON, 3: LOST, 4: CONTACTED, 5: EXPIRED).'
          type: integer
          enum:
            - 0
            - 1
            - 2
            - 3
            - 4
            - 5
        contactDate:
          description: 'Date of last contact with the lead (YYYY-MM-DD).'
          type: string
          example: '2019-01-01'
        soldDate:
          description: 'Date when the lead was marked as sold (YYYY-MM-DD).'
          type: string
          example: '2019-01-01'
        leadSourceId:
          description: 'Unique identifier for the lead source.'
          type: integer
        leadSourceName:
          description: 'Name of the lead source.'
          type: string
        xDate:
          description: 'X-date (expiration or renewal date) for the lead (YYYY-MM-DD).'
          type: string
          example: '2019-01-01'
        quoteDate:
          description: 'Date when the lead was quoted (YYYY-MM-DD).'
          type: string
          example: '2019-01-01'
        createDate:
          description: 'Date when the lead was created (YYYY-MM-DD).'
          type: string
          example: '2019-01-01'
        premium:
          description: 'Total sold premium amount for the lead, in cents.'
          type: integer
        quoted:
          description: 'Total quoted premium amount for the lead, in cents.'
          type: integer
        assignedTo:
          description: 'Unique identifier of the agent assigned to the lead.'
          type: integer
          example: 1
        assignToFirstname:
          description: 'First name of the agent assigned to the lead.'
          type: string
        assignToLastname:
          description: 'Last name of the agent assigned to the lead.'
          type: string
        csrId:
          description: 'Unique identifier for the customer service representative (CSR) assigned to the lead.'
          type: integer
        csrFirstname:
          description: 'First name of the customer service representative (CSR).'
          type: string
        csrLastname:
          description: 'Last name of the customer service representative (CSR).'
          type: string
        creditToFirstname:
          description: 'First name of the person who should get credit for the lead.'
          type: string
        creditToLastname:
          description: 'Last name of the person who should get credit for the lead.'
          type: string
        taskCount:
          description: 'Number of open tasks associated with the lead.'
          type: integer
        contactFirstName:
          description: 'First name of the business contact for the lead.'
          type: string
        contactLastName:
          description: 'Last name of the business contact for the lead.'
          type: string
        locationCode:
          description: 'Location code associated with the lead.'
          type: string
        locationName:
          description: 'Location name associated with the lead.'
          type: string
        departmentCode:
          description: 'Department code associated with the lead.'
          type: string
        departmentName:
          description: 'Department name associated with the lead.'
          type: string
        groupCode:
          description: 'Group code associated with the lead.'
          type: string
        groupName:
          description: 'Group name associated with the lead.'
          type: string
        workflowId:
          description: 'Unique identifier for the workflow associated with the lead.'
          type: integer
        workflowName:
          description: 'Name of the workflow associated with the lead.'
          type: string
        workflowStageId:
          description: 'Unique identifier for the workflow stage associated with the lead.'
          type: integer
        workflowStageName:
          description: 'Name of the workflow stage associated with the lead.'
          type: string
        lastActivityDate:
          description: 'Date of the last activity on the lead (YYYY-MM-DD).'
          type: string
        enterStageDate:
          description: 'Date when the lead entered the current workflow stage (YYYY-MM-DD).'
          type: string
        tagNames:
          description: 'Array of tag names associated with the lead.'
          type: array
          items:
            type: string
            example: 1
        convertedHouseholdId:
          description: 'Unique identifier for the converted household, if applicable.'
          type: integer
        nextExpirationDate:
          description: 'Next expiration date for the lead (YYYY-MM-DD).'
          type: string
        externalSystem:
          description: 'External System'
          type: string
        externalId:
          description: 'External ID'
          type: string
      type: object
    LeadActivityAnalyticsResponse:
      description: 'Lead activity analytics response model'
      properties:
        producerId:
          description: 'The producer ID. Available when groupBy=producer'
          type: integer
        producerFirstName:
          description: 'The producer first name. Available when groupBy=producer'
          type: string
        producerLastName:
          description: 'The producer last name. Available when groupBy=producer'
          type: string
        activityCreated:
          description: 'Number of activity created (new)'
          type: integer
        activityCompleted:
          description: 'Number of activity completed'
          type: integer
        activityEmailSent:
          description: 'Number of activity email sent'
          type: integer
        activityEmailReceived:
          description: 'Number of activity email received'
          type: integer
        textSent:
          description: 'Number of activity text sent'
          type: integer
        textReceived:
          description: 'Number of activity text received'
          type: integer
        callOutbound:
          description: 'Number of activity outbound call'
          type: integer
        callInbound:
          description: 'Number of activity inbound call'
          type: integer
        year:
          description: 'Year. Available when groupBy=month'
          type: integer
        month:
          description: 'Month. Available when groupBy=month'
          type: integer
      type: object
    LeadAnalyticsResponse:
      description: 'Lead analytics response model'
      properties:
        producerId:
          description: 'The producer ID'
          type: integer
        leadSourceId:
          description: 'The lead source ID'
          type: integer
        leadSourceName:
          description: 'The name of lead source'
          type: string
        categoryId:
          description: 'The ID of category'
          type: integer
        categoryName:
          description: 'The name of category'
          type: string
        producerFirstName:
          description: 'The producer first name'
          type: string
        producerLastName:
          description: 'The producer last name'
          type: string
        year:
          description: 'The year of monthly report'
          type: string
        month:
          description: 'The month for monthly report'
          type: string
        leadsCount:
          description: 'A list of leads'
          type: array
          items:
            $ref: '#/components/schemas/LeadCount'
        dividendLeadsCount:
          description: 'A list of dividend leads'
          type: array
          items:
            $ref: '#/components/schemas/LeadCount'
      type: object
    LeadCount:
      description: 'Lead count model'
      properties:
        workflowStageId:
          description: 'id of workflowstage'
          type: string
        count:
          description: 'leads count of a workflowstage'
          type: integer
      type: object
    LeadDetail:
      description: 'Lead detailed data response model'
      allOf:
        -
          $ref: '#/components/schemas/Lead'
        -
          properties:
            customFields:
              description: 'A list of custom fields'
              type: array
              items:
                $ref: '#/components/schemas/CustomField'
            opportunities:
              description: 'A list of opportunities'
              type: array
              items:
                $ref: '#/components/schemas/Opportunities'
            otherProducers:
              description: 'A list of other producers'
              type: array
              items:
                type: object
            quotes:
              description: 'A list of quotes/policies'
              type: array
              items:
                $ref: '#/components/schemas/Opportunities'
            totalOpportunityPremium:
              description: 'Total opportunity premium'
              type: integer
            totalQuotePremium:
              description: 'Total quote premium'
              type: integer
            totalPolicyPremium:
              description: 'Total policy premium'
              type: integer
            lossReason:
              description: 'Loss reason'
              type: string
            xDateType:
              description: 'Smart cycle event type'
              type: string
            birthday:
              description: 'birthday mm/dd/yy'
              type: string
            nickname:
              description: Nickname
              type: string
            maritalStatus:
              description: 'Marital status'
              type: string
            fein:
              description: 'Fein number'
              type: string
            contactFirstName:
              description: 'Contact First Name'
              type: string
            contactMiddleName:
              description: 'Contact Middle Name'
              type: string
            contactLastName:
              description: 'Contact Last Name'
              type: string
            businessEntity:
              description: 'Business Entity'
              type: string
            businessClassification:
              description: 'Name of classification'
              type: string
            businessClassificationId:
              description: 'Id of classification'
              type: integer
            businessClassificationCode:
              description: 'Business Classisification Code'
              type: string
            yearBusinessStarted:
              description: 'Year Business Started'
              type: integer
            numberOfEmployees:
              description: 'Number of Employees'
              type: integer
            annualRevenue:
              description: 'Annual Revenue'
              type: integer
            payroll:
              description: 'Total Payroll'
              type: integer
    LeadSearchResponse:
      description: 'Lead search response model'
      allOf:
        -
          $ref: '#/components/schemas/BaseSearchResponse'
        -
          properties:
            leads:
              description: 'A list of leads'
              type: array
              items:
                $ref: '#/components/schemas/Lead'
            quoteAmount:
              description: 'Quote amount'
              type: integer
    LeadSoldResponse:
      description: 'Lead sold response model'
      properties:
        customerId:
          description: 'The resulting customer ID'
          type: integer
        leadSourceId:
          description: 'The lead source id'
          type: integer
          example: 1
        opportunities:
          description: 'List of opportunities'
          type: array
          items:
            $ref: '#/components/schemas/Opportunity'
      type: object
    LeadsCountResponse:
      description: 'Lead count for pipeline'
      properties:
        leadsCount:
          description: 'A list of leads'
          type: array
          items:
            $ref: '#/components/schemas/LeadCount'
      type: object
    Opportunity:
      description: 'Lead Opportunity response model'
      properties:
        id:
          description: 'The Quote ID'
          type: integer
        carrierId:
          description: 'The Carrier ID. Optional if standardCarrierCode is provided.'
          type: integer
        standardCarrierCode:
          description: 'The standard code of carrier.'
          type: string
        productLineId:
          description: 'The product Line ID. Optional if standardProductLineCode is provided.'
          type: integer
        standardProductLineCode:
          description: 'The standard code of product Line.'
          type: string
        status:
          description: 'Opportunity status. 0: inactive, 1: active'
          type: integer
        premium:
          description: 'The premium amount'
          type: integer
          example: 300
        items:
          description: 'The number of items'
          type: integer
          example: 1
        customFields:
          description: 'A list of custom fields'
          type: array
          items:
            $ref: '#/components/schemas/CustomField'
        propertyAddress:
          description: 'The PropertyAddress'
          type: array
          items:
            $ref: '#/components/schemas/OpportunityPropertyAddress'
      type: object
    Quote:
      description: 'Lead quote response model'
      allOf:
        -
          $ref: '#/components/schemas/Opportunity'
        -
          properties:
            sold:
              description: 'whether the quote is sold'
              type: boolean
            carrierName:
              description: 'The carrier name'
              type: string
            productName:
              description: 'The policy type'
              type: string
            potentialRevenue:
              description: 'The potential revenue'
              type: integer
            effectiveDate:
              description: 'The effective date'
              type: string
    Vendor_LeadSoldResponse:
      description: 'Vendor lead sold response model'
      properties:
        vendorCustomerId:
          description: 'The resulting vendor customer ID'
          type: string
        leadSourceId:
          description: 'The lead source id'
          type: integer
          example: 1
        opportunities:
          description: 'List of opportunities'
          type: array
          items:
            $ref: '#/components/schemas/Opportunity'
      type: object
    AlrapptsSummary:
      description: 'Alrppts and household'
      properties:
        id:
          description: 'The appointments id. (i.e. alrtAppt.id)'
          type: integer
          example: 1
        apptTime:
          description: 'The appointment time'
          type: string
          example: '2019-04-11 00:00:00'
        nextApptTime:
          description: 'Next appointment time'
          type: string
          example: '2019-04-11 00:00:00'
        apptType:
          description: 'Appointment type. 1 - phone, 2 - face to face'
          type: integer
          enum:
            - 1
            - 2
          example: 1
        agentId:
          description: 'The agent''s id'
          type: integer
          example: 1
        householdId:
          description: 'The household''s id'
          type: integer
          example: 1
        ips:
          description: IPS
          type: integer
          example: 1
        productCredit:
          description: 'Product credit'
          type: number
          example: 1
        points:
          description: Points
          type: integer
          example: 1
        efsId:
          description: 'The efs''s id'
          type: integer
          example: 1
        agencyId:
          description: 'The agency''s id'
          type: integer
          example: 1
        agencyName:
          description: 'The agency''s name'
          type: string
          example: AgencyZoom
        assignTo:
          description: 'The assignee''s id'
          type: integer
          example: 1
        location:
          description: 'The location name'
          type: string
          example: Location
        status:
          description: "List of status: 0 - new, 1 - sold, 2 - cancel, 3 - no deal, 4 - follow up,\n    5 - no show, 6 - not issued, 7 - submitted, 8 - quoted, 100 - kept"
          type: array
          items:
            type: integer
            enum:
              - 0
              - 1
              - 2
              - 3
              - 4
              - 5
              - 6
              - 7
              - 8
              - 100
          example:
            - 0
            - 4
        createDate:
          description: 'The creation date'
          type: string
          example: '2019-04-12 02:58:34'
        soldDate:
          description: 'The sold date'
          type: string
          example: '2019-04-12 02:58:34'
        appSubmitDate:
          description: 'The appointment submit date'
          type: string
          example: '2019-04-12'
        soldPolicyType:
          description: 'The sold policy type'
          type: string
          example: VOYA
        trackerCustomerName:
          description: 'Tracker customer name'
          type: string
          example: 'Davi Cooper'
        salesTrackerOnly:
          description: 'Sales tracker only? 1 - yes, 0 - false'
          type: integer
          example: 1
        followUpDate:
          description: 'The follow up date'
          type: string
          example: '2019-04-12'
        kept:
          description: 'Kept or not? 1 - yes, 0 - false'
          type: integer
          example: 1
        insCompanyId:
          description: 'Insurance company id'
          type: integer
          example: 1
        appQuoteDate:
          description: 'The appointment''s quote date'
          type: string
          example: '2019-04-12'
        leadSourceId:
          description: 'The lead source id'
          type: integer
          example: 1
        housename:
          description: 'The house name'
          type: string
          example: 'Davi Cooper'
        customerFirstname:
          description: 'The customer''s first name'
          type: string
          example: Davi
        customerLastname:
          description: 'The customer''s last name'
          type: string
          example: Cooper
        customerPhone:
          description: 'The customer''s phone number'
          type: string
          example: '(111) 111-1111'
        customerEmail:
          description: 'The customer''s email address'
          type: string
          example: example@gmail.com
        agencyNumber:
          description: 'The agency or branch''s assigned id'
          type: string
          example: A0A0001
        agentFirstname:
          description: 'The agent''s first name'
          type: string
          example: Davi
        agentLastname:
          description: 'The agent''s last name'
          type: string
          example: Cooper
        efsFirstname:
          description: 'The efs''s first name'
          type: string
          example: Davi
        efsLastname:
          description: 'The efs''s last name'
          type: string
          example: Cooper
        creatorFirstname:
          description: 'The creator''s first name'
          type: string
          example: Davi
        creatorLastname:
          description: 'The creator''s last name'
          type: string
          example: Cooper
        carrier:
          description: 'The insurance company''s short name'
          type: string
          example: Ace
      type: object
    LifeSearchResponse:
      description: 'Life data response model'
      required:
        - agencyId
        - status
      allOf:
        -
          $ref: '#/components/schemas/BaseSearchResponse'
        -
          properties:
            alrLeads:
              description: 'The appointment list'
              type: array
              items:
                $ref: '#/components/schemas/AlrapptsSummary'
    CancelAccountResponse:
      description: 'Cancel account response'
      properties:
        cancelAtEndOfPeriod:
          description: 'Cancel an account right away or at the end of period'
          type: integer
        periodEnd:
          description: 'The last active date of an account'
          type: string
      type: object
    CancelMyAccountInfoResponse:
      description: 'Before cancel account response model'
      properties:
        agencyId:
          description: 'Agency ID'
          type: integer
        planInterval:
          description: 'The plan interval string, example: year'
          type: string
        subStatus:
          description: 'The subscription status, example: active'
          type: string
        currentPeriodEnd:
          description: 'Current period end date'
          type: string
        planName:
          description: 'Current period end date'
          type: string
        planCode:
          description: 'Current plan code'
          type: string
        cancelReasons:
          description: 'A list of cancel reasons'
          type: array
          items:
            $ref: '#/components/schemas/KeyValuePair'
        hrAccountCancelRespones:
          description: 'A list of hr cancel reasons'
          type: array
          items:
            $ref: '#/components/schemas/KeyValuePair'
        cancelled:
          description: 'Is this agency cancelled'
          type: boolean
          default: false
      type: object
    ErrorReportResponse:
      description: 'Error report data response model'
      properties:
        reportId:
          description: 'The reported error''s id'
          type: string
      type: object
    V4ssoAuthResponse:
      description: 'Get auth url and other required params before v4sso called'
      properties:
        authUrl:
          description: 'The url used to request webview'
          type: string
      type: object
    NotificationSearchResponse:
      description: 'Notification data response model'
      required:
        - agentId
      allOf:
        -
          $ref: '#/components/schemas/BaseSearchResponse'
        -
          properties:
            notifications:
              description: 'The notification list'
              type: array
              items:
                $ref: '#/components/schemas/NotificationSummary'
    NotificationSummary:
      description: NotificationSummary
      properties:
        id:
          description: 'The notification message ID'
          type: integer
        subject:
          description: subject
          type: string
        fullMessage:
          description: 'full message'
          type: string
        deliveryDate:
          description: 'delivery date'
          type: string
        createDate:
          description: 'create date'
          type: string
        type:
          description: 'notify type'
          type: string
        attributes:
          description: attributes
          type: string
      type: object
    EmployeeRingCentral:
      description: 'Agencyzoom employee model with twilio phone number'
      allOf:
        -
          $ref: '#/components/schemas/Employee'
        -
          properties:
            ringCentralPhoneNumberId:
              description: 'The ringCentral phone number ID'
              type: integer
            forwardPhoneNumber:
              description: 'The forward phone number'
              type: string
            forwardActive:
              description: 'The forward active'
              type: boolean
    SearchServiceTicketResponse:
      description: 'Search Threads Result'
      allOf:
        -
          $ref: '#/components/schemas/BaseSearchResponse'
        -
          properties:
            serviceTickets:
              description: 'A list of serviceTickets'
              type: array
              items:
                $ref: '#/components/schemas/ServiceTicketDetail'
            totalCount:
              description: 'Total service tickets'
              type: integer
    ServiceTicketDetail:
      description: 'Service Ticket object'
      properties:
        id:
          description: 'The id of service ticket'
          type: integer
        agencyId:
          description: 'The id of agency'
          type: integer
        householdId:
          description: 'The id of household'
          type: integer
        workflowId:
          description: 'The id of pipeline'
          type: integer
        workflowStageId:
          description: 'The id of pipeline stage'
          type: integer
        status:
          description: 'The status of service ticket'
          type: integer
          example: '0=remove; 2=completed; 1=active;'
        statusDesc:
          description: 'The status description of service ticket'
          type: string
          example: 'Open, Deleted, Completed'
        csr:
          description: 'The id of CSR'
          type: integer
        enterStageTS:
          description: 'The timestamp when enter a stage'
          type: integer
          example: 1727158695
        enrolled:
          description: 'Whether enroll automation'
          type: integer
        createDate:
          description: 'The create date of this ticket'
          type: string
          example: '2021-08-01'
        createdBy:
          description: 'The id of agent'
          type: integer
        modifyDate:
          description: 'Modify date of this ticket'
          type: string
          example: '2021-08-01 23:23:23'
        modifiedBy:
          description: 'The id of agent'
          type: integer
        categoryId:
          description: 'Service ticket category'
          type: integer
          example: '0 = all;'
        priorityId:
          description: 'Service ticket priority'
          type: integer
          example: '0 is all'
        subject:
          description: 'The subject of this ticket'
          type: string
        serviceDesc:
          description: 'The description of this ticket'
          type: string
        dueDate:
          description: 'Due date'
          type: integer
        completeDate:
          description: 'Complete date'
          type: string
        resolutionId:
          description: 'Resolution Id'
          type: integer
        resolutionDesc:
          description: 'Resolution description'
          type: string
        lastActivityDate:
          description: 'Last Activity date'
          type: string
          example: '2019-01-01 01:01:01'
        vendor:
          description: 'Vendor Name'
          type: string
        source:
          description: Source
          type: string
        responseMinutes:
          description: 'Response minutes'
          type: integer
          example: 1
        emailThreadId:
          description: 'Email thread''s id'
          type: integer
        name:
          description: 'Household name'
          type: string
        workflowName:
          description: 'The pipeline name'
          type: string
        workflowStageName:
          description: 'Name of pipeline stage'
          type: string
        phone:
          description: 'Phone of household'
          type: string
        email:
          description: 'Email of household'
          type: string
        csrFirstname:
          description: 'CSR firstname'
          type: string
        csrLastname:
          description: 'CSR lastname'
          type: string
        categoryName:
          description: 'Service ticket category name'
          type: string
        priorityName:
          description: 'Service ticket priority name'
          type: string
        householdFirstname:
          description: 'Household firstname'
          type: string
        householdMiddlename:
          description: 'Household middlename'
          type: string
        householdLastname:
          description: 'Household lastname'
          type: string
        otherProducers:
          description: 'Other producers information'
          type: array
          items:
            properties:
              otherProducerId:
                description: 'Other producer ID'
                type: integer
              otherProducerFirstName:
                description: 'Other producer first name'
                type: string
              otherProducerLastName:
                description: 'Other producer last name'
                type: string
            type: object
        customFields:
          description: 'A list of custom fields'
          type: array
          items:
            $ref: '#/components/schemas/CustomField'
      type: object
    EmployeeForward:
      description: 'Agencyzoom employee model with twilio phone number'
      allOf:
        -
          $ref: '#/components/schemas/Employee'
        -
          properties:
            forwardPhoneNumber:
              description: 'The forward phone number'
              type: string
            forwardActive:
              description: 'The forward active'
              type: boolean
    EmployeeTwilio:
      description: 'Agencyzoom employee model with twilio phone number'
      allOf:
        -
          $ref: '#/components/schemas/Employee'
        -
          properties:
            twilioPhoneNumberId:
              description: 'The twilio phone number ID'
              type: integer
            forwardPhoneNumber:
              description: 'The forward phone number'
              type: string
            forwardActive:
              description: 'The forward active'
              type: boolean
            twilioOutgoingCallerId:
              description: 'The twilio outgoing caller id'
              type: integer
    UnsubscriptionListResponse:
      description: 'Response containing a list of unsubscriptions'
      properties:
        data:
          description: 'A list of unsubscriptions'
          type: array
          items:
            properties:
              type:
                description: 'Type of unsubscription (email or phone)'
                type: string
                example: email
              value:
                description: 'Email address or phone number'
                type: string
                example: some.email@test.com
            type: object
      type: object
    EmployeeZipwhip:
      description: 'Agencyzoom employee model with twilio phone number'
      allOf:
        -
          $ref: '#/components/schemas/Employee'
        -
          properties:
            forwardPhoneNumber:
              description: 'The forward phone number'
              type: string
            forwardActive:
              description: 'The forward active'
              type: boolean
  securitySchemes:
    bearer:
      type: http
      bearerFormat: JWT
      scheme: bearer
tags:
  -
    name: Authentication
    description: 'These endpoints enable the integration to obtain and invalidtate JWT, which must be passed as an HTTP header in order to access the rest of functionalities.'
  -
    name: 'V4SSO Authentication'
    description: 'Use V4 sso code to login.'
