openapi: 3.0.3
info:
  title: Vogent - OpenAPI 3.0
  description: |-
    Test Description
  version: 1.0.11
servers:
  - url: https://api.vogent.ai/api
security:
  - bearerAuth: []
paths:
  /dials:
    post:
      summary: Create a new dial
      description: Creates a one-off dial session, either for phone dials or browser dials.
      operationId: createDial
      requestBody:
        description: Create a new dial
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDialInput'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateDialOutput'
        '400':
          description: Invalid input
        '409':
          description: The idempotency key on this request is already in use
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateDialConflictOutput'
        '422':
          description: Validation exception
  /dials/{id}/hangup:
    post:
      summary: Hangup Dial.
      description: Hangs up an in-progress dial.
      operationId: hangupDial
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ID of the dial.
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HangupDialOutput'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
  /dials/{id}:
    get:
      summary: Get Dial
      description: Gets the details of a dial.
      operationId: getDial
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ID of the dial.
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Dial'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
  /dials/{id}/token:
    post:
      summary: Get Dial Token
      description: Gets a token for a given dial.
      operationId: getDialToken
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ID of the dial.
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DialTokenOutput'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
  /models:
    get:
      summary: List Models
      parameters:
        - in: query
          name: limit
          schema:
            type: integer
            nullable: false
            default: 100
          description: The maximum number of records to fetch.
          required: false
        - in: query
          name: cursor
          schema:
            type: string
          required: false
          description: The pagination cursor returned by the previous request. Feed the result provided by vogent verbatim.
      description: List the models available on your account.
      operationId: listModels
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/AIModel'
                  cursor:
                    type: string
                    nullable: true
                    description: "A cursor you can pass to /agents to fetch the next page. If no next page exists, the cursor will be null."
                required: ["data", "cursor"]
        '400':
          description: Invalid input
        '422':
          description: Validation exception
  /agents:
    get:
      summary: List Agents
      parameters:
        - in: query
          name: limit
          schema:
            type: integer
            nullable: false
            default: 100
          description: The maximum number of records to fetch.
          required: false
        - in: query
          name: cursor
          schema:
            type: string
          required: false
          description: The pagination cursor returned by the previous request. Feed the result provided by vogent verbatim.
      description: List the agents on your account.
      operationId: listAgents
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Agent'
                  cursor:
                    type: string
                    nullable: true
                    description: "A cursor you can pass to /agents to fetch the next page. If no next page exists, the cursor will be null."
                required: ["data", "cursor"]
        '400':
          description: Invalid input
        '422':
          description: Validation exception
    post:
      summary: Create Agent
      description: Creates a new agent.
      operationId: createAgent
      requestBody:
        description: Create a new agent
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAgentInput'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agent'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
  /agents/{id}:
    parameters:
      - in: path
        name: id
        schema:
          type: string
        required: true
        description: ID of the agent.
    get:
      summary: Get Agent
      description: Gets an existing agent.
      operationId: getAgent
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agent'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
    delete:
      summary: Delete Agent
      description: Delete an agent. This action is irreversible, so be careful when using it. Returns the deleted agent.
      operationId: deleteAgent
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agent'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
    put:
      summary: Update Agent
      description: Updates an existing agent.
      operationId: updateAgent
      requestBody:
        description: Updates an agent
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAgentInput'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agent'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
  /agents/{agentId}/versioned_prompts:
    parameters:
      - in: path
        name: agentId
        schema:
          type: string
        required: true
        description: ID of the agent.
    get:
      summary: List versioned prompts
      description: Lists versioned prompts for a given agent.
      operationId: listAgentVersionedPrompts
      parameters:
        - in: query
          name: limit
          schema:
            type: integer
            nullable: false
            default: 100
          description: The maximum number of prompts to list.
          required: false
        - in: query
          name: cursor
          schema:
            type: string
          required: false
          description: The pagination cursor returned by the previous request. Feed the result provided by vogent verbatim.
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/VersionedPrompt'
                  cursor:
                    type: string
                    nullable: true
                    description: "A cursor you can pass to fetch the next page. If no next page exists, the cursor will be null."
                required: ["data", "cursor"]
        '400':
          description: Invalid input
        '422':
          description: Validation exception
    post:
      summary: Create versioned prompt
      description: Creates a versioned prompt for a given agent.
      operationId: createAgentVersionedPrompt
      requestBody:
        description: Creates a versioned prompt
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateVersionedPromptInput'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VersionedPrompt'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
  /agents/{agentId}/extractors:
    parameters:
      - in: path
        name: agentId
        schema:
          type: string
        required: true
        description: ID of the agent.
    get:
      summary: List extractors
      description: List all extractors for a given agent.
      operationId: listAgentExtractors
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  extractors:
                    type: array
                    items:
                      $ref: '#/components/schemas/CallAgentExtractor'
                required: [extractors]
        '400':
          description: Invalid input
        '422':
          description: Validation exception
    post:
      summary: Create extractor
      description: Create a new extractor for a given agent.
      operationId: createAgentExtractor
      requestBody:
        description: Create a new extractor
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCallAgentExtractorInput'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CallAgentExtractor'
        '400':
          description: Invalid input
        '422':
          description: Validation exception

  /agents/{agentId}/extractors/{extractorId}:
    parameters:
      - in: path
        name: agentId
        schema:
          type: string
        required: true
        description: ID of the agent.
      - in: path
        name: extractorId
        schema:
          type: string
        required: true
        description: ID of the extractor.
    get:
      summary: Get extractor
      description: Get an extractor for a given agent.
      operationId: getAgentExtractor
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CallAgentExtractor'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
    put:
      summary: Update extractor
      description: Update an extractor for a given agent.
      operationId: updateAgentExtractor
      requestBody:
        description: Update an extractor
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCallAgentExtractorInput'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CallAgentExtractor'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
  /agents/{agentId}/versioned_prompts/{id}:
    parameters:
      - in: path
        name: agentId
        schema:
          type: string
        required: true
        description: ID of the agent.
      - in: path
        name: id
        schema:
          type: string
        required: true
        description: ID of the versioned prompt.
    get:
      summary: Get versioned prompt
      description: Gets a specific versioned prompt for a given agent.
      operationId: getAgentVersionedPrompt
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VersionedPrompt'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
    put:
      summary: Update versioned prompt
      description: Updates a versioned prompt for a given agent.
      operationId: updateAgentVersionedPrompt
      requestBody:
        description: Updates a versioned prompt
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateVersionedPromptInput'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VersionedPrompt'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
  /phone_numbers:
    get:
      summary: List phone numbers
      description: List phone numbers in your workspace.
      parameters:
        - in: query
          name: limit
          schema:
            type: integer
            nullable: false
            default: 100
          description: The maximum number of phone numbers to list.
          required: false
        - in: query
          name: cursor
          schema:
            type: string
          required: false
          description: The pagination cursor returned by the previous request. Feed the result provided by vogent verbatim.
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/PhoneNumber'
                  cursor:
                    type: string
                    nullable: true
                    description: "A cursor you can pass to fetch the next page. If no next page exists, the cursor will be null."
                required: ["data", "cursor"]
        '400':
          description: Invalid input
        '422':
          description: Validation exception
    post:
      summary: Create a phone number
      description: Creates a phone number of various types (purchase, SIP import, or Vogent SIP).
      operationId: createPhoneNumber
      requestBody:
        description: Create a new phone number
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePhoneNumberInput'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhoneNumber'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
  /phone_number_pools:
    get:
      summary: List phone number pools
      description: List phone number pools in your workspace.
      parameters:
        - in: query
          name: workspaceId
          schema:
            type: string
          required: false
          description: The workspace whose phone number pools should be listed. Defaults to your current workspace.
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PhoneNumberPool'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
    post:
      summary: Create a phone number pool
      description: Creates a pool of phone numbers to use when placing calls.
      operationId: createPhoneNumberPool
      requestBody:
        description: Create a new phone number pool
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePhoneNumberPoolInput'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhoneNumberPool'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
  /phone_number_pools/{id}:
    parameters:
      - in: path
        name: id
        schema:
          type: string
        required: true
    get:
      summary: Retrieve a phone number pool
      description: Get details for a phone number pool.
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhoneNumberPool'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
    put:
      summary: Update a phone number pool
      description: Updates a phone number pool's name or members.
      operationId: updatePhoneNumberPool
      requestBody:
        description: Update a phone number pool
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePhoneNumberPoolInput'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhoneNumberPool'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
  /phone_numbers/{id}:
    parameters:
      - in: path
        name: id
        schema:
          type: string
        required: true
        description: ID of the versioned prompt.
    get:
      summary: Get Phone Number
      operationId: getPhoneNumber
      description: Retrieve a phone number
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhoneNumber'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
    delete:
      summary: Delete Phone Number
      operationId: deletePhoneNumber
      description: Deletes a phone number
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhoneNumber'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
    put:
      summary: Update Phone Number
      description: Update a phone number's properties
      operationId: updatePhoneNumber
      requestBody:
        description: Update phone number properties
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePhoneNumberInput'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhoneNumber'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
  /phone_numbers/search:
    post:
      summary: Search for available numbers
      description: Search for available numbers available to purchase
      operationId: searchPhoneNumbers
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PhoneNumberSearchInput'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PhoneNumberCandidate'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
  /phone_numbers/purchase:
    post:
      summary: Purchase available number (deprecated, use /phone_numbers instead)
      description: Purchase an available phone number.
      operationId: purchasePhoneNumber
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PhoneNumberPurchaseInput'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhoneNumber'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
  /tasks:
    post:
      summary: Create a new dial task
      description: Creates a new dial task for a call agent.
      operationId: createDialTask
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDialTaskInput'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DialTask'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
  /tasks/{taskId}/attempt:
    post:
      summary: Create a task attempt
      description: Creates a new attempt to complete a task by initiating a dial.
      operationId: createTaskAttempt
      parameters:
        - in: path
          name: taskId
          schema:
            type: string
          required: true
          description: ID of the task.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTaskAttemptInput'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateDialOutput'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
  /tasks/{taskId}/complete:
    post:
      summary: Mark a task as complete
      description: Marks a task as complete with the results from a dial.
      operationId: markTaskComplete
      parameters:
        - in: path
          name: taskId
          schema:
            type: string
          required: true
          description: ID of the task.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MarkTaskCompleteInput'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DialTask'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
  /functions:
    get:
      summary: List functions
      description: Lists the functions in your workspace. Functions whose type has no API representation yet (for example knowledge base lookups) are omitted from the results.
      operationId: listFunctions
      parameters:
        - in: query
          name: displayName
          schema:
            type: string
          required: false
          description: Only return functions whose display name matches this value exactly. Ignored when empty.
        - in: query
          name: limit
          schema:
            type: integer
            nullable: false
            default: 100
          required: false
          description: The maximum number of functions to return.
        - in: query
          name: cursor
          schema:
            type: string
          required: false
          description: The pagination cursor returned by the previous request. Feed the result provided by vogent verbatim.
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListFunctionsResponse'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
    post:
      summary: Create a function
      description: Creates a function.
      operationId: createFunction
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateFunctionInput'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Function'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
  /functions/{id}:
    parameters:
      - in: path
        name: id
        schema:
          type: string
        required: true
        description: ID of the function.
    get:
      summary: Get function
      description: Gets a specific function.
      operationId: getFunction
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Function'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
    delete:
      summary: Delete function
      description: Deletes a function, and unlinks it from any agents.
      operationId: deleteFunction
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Function'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
    put:
      summary: Update function
      description: Updates a specific function.
      operationId: updateFunction
      requestBody:
        description: Update function properties
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateFunctionInput'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Function'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
  /concurrent_calls:
    get:
      summary: Get concurrent calls
      description: Gets the concurrent calls in the workspace.
      operationId: getConcurrentCalls
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConcurrentCalls'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
  /tts:
    post:
      summary: Run TTS Model
      description: Runs a text to speech model and generates audio. Bytes will be streamed to the client as they are generated.
      operationId: runTTS
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunTTSInput'
        required: true
      responses:
        '200':
          description: Returns a file with the audio.
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '400':
          description: Invalid input
        '422':
          description: Validation exception
  /tts/multispeaker:
    post:
      summary: Run Multispeaker TTS Model
      description: Runs a multispeaker (conversational) text to speech model and generates audio. Bytes will be streamed to the client as they are generated.
      operationId: runMultispeakerTTS
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunMultispeakerTTSInput'
        required: true
      responses:
        '200':
          description: Returns a file with the audio.
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '400':
          description: Invalid input
        '422':
          description: Validation exception

  /voices:
    get:
      summary: List Voices
      description: Lists the AI voices available to the workspace.
      operationId: listVoices
      parameters:
        - in: query
          name: name
          schema:
            type: string
          required: false
          description: Filter voices by name.
        - in: query
          name: voiceType
          schema:
            type: string
          required: false
          description: The provider (for third party voices), or model type (for Vogent hosted voices).
        - in: query
          name: limit
          schema:
            type: integer
          required: false
          description: The maximum number of voices to return.
        - in: query
          name: cursor
          schema:
            type: string
          required: false
          description: The pagination cursor returned by the previous request. Feed the result provided by vogent verbatim.
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListVoicesResponse'
        '400':
          description: Invalid input
        '422':
          description: Validation exception

  /voices/clone:
    post:
      summary: Clone Voice
      description: Clones a new voice for the workspace.
      operationId: cloneVoice
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CloneVoiceInput'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIVoice'
        '400':
          description: Invalid input
        '422':
          description: Validation exception

  /batch_dial_jobs:
    get:
      summary: List Batch Jobs
      description: Lists batch dial jobs for the workspace.
      operationId: listBatchDialJobs
      parameters:
        - in: query
          name: limit
          schema:
            type: integer
          required: false
          description: The number of jobs to return.
        - in: query
          name: cursor
          schema:
            type: string
          required: false
          description: The cursor for pagination.
        - in: query
          name: status
          schema:
            $ref: '#/components/schemas/BatchDialJobStatus'
          required: false
        - in: query
          name: callAgentId
          schema:
            type: string
          required: false
        - in: query
          name: userId
          schema:
            type: string
          required: false
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchDialJobsResult'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
    post:
      summary: Create Batch Job
      description: Creates a new batch dial job. You must start the job with the `/paused` endpoint for calls to begin.
      operationId: createBatchDialJob
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateBatchDialJobInput'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchDialJob'
        '400':
          description: Invalid input
        '422':
          description: Validation exception

  /batch_dial_jobs/{id}:
    get:
      summary: Get Batch Job
      description: Get metadata for a batch dial job.
      operationId: getBatchDialJob
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ID of the batch dial job.
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchDialJob'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
    put:
      summary: Update Batch Job
      description: Update an existing batch dial job.
      operationId: updateBatchDialJob
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ID of the batch dial job.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateBatchDialJobInput'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchDialJob'
        '400':
          description: Invalid input
        '422':
          description: Validation exception

  /batch_dial_jobs/{id}/queue:
    get:
      summary: List Queued Batch Dials
      description: Lists all rows that are queued as part of the batch job.
      operationId: listBatchDialJobQueue
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ID of the batch dial job.
        - in: query
          name: limit
          schema:
            type: integer
          required: false
          description: The number of specs to return.
        - in: query
          name: cursor
          schema:
            type: string
          required: false
          description: The cursor for pagination.
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListBatchDialSpecsResult'
        '400':
          description: Invalid input
        '422':
          description: Validation exception

  /batch_dial_jobs/{id}/dials:
    get:
      summary: List Batch Dials
      description: Lists completed dials that are associated with the batch job.
      operationId: listBatchDialJobDials
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ID of the batch dial job.
        - in: query
          name: limit
          schema:
            type: integer
          required: false
          description: The number of dials to return.
        - in: query
          name: cursor
          schema:
            type: string
          required: false
          description: The cursor for pagination.
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListBatchDialJobDialsResult'
        '400':
          description: Invalid input
        '422':
          description: Validation exception

  /batch_dial_jobs/{id}/paused:
    post:
      summary: Pause/Resume Batch Job
      description: Sets the paused state of a batch dial job.
      operationId: setBatchDialJobPaused
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ID of the batch dial job.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetBatchDialJobPausedInput'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchDialJob'
        '400':
          description: Invalid input
        '422':
          description: Validation exception

  /eval_configs:
    get:
      summary: List Eval Configs
      description: Lists the AI evaluation configurations in your workspace.
      operationId: listEvalConfigs
      parameters:
        - in: query
          name: limit
          schema:
            type: integer
            nullable: false
            default: 100
          description: The maximum number of configs to fetch.
          required: false
        - in: query
          name: cursor
          schema:
            type: string
          required: false
          description: The pagination cursor returned by the previous request.
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/AIEvalConfig'
                  cursor:
                    type: string
                    nullable: true
                    description: "A cursor you can pass to fetch the next page. If no next page exists, the cursor will be null."
                required: ["data", "cursor"]
        '400':
          description: Invalid input
        '422':
          description: Validation exception
    post:
      summary: Create Eval Config
      description: Creates a new AI evaluation configuration.
      operationId: createEvalConfig
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAIEvalConfigInput'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIEvalConfig'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
  /eval_configs/{id}:
    parameters:
      - in: path
        name: id
        schema:
          type: string
        required: true
        description: ID of the eval config.
    get:
      summary: Get Eval Config
      description: Gets the metadata of an AI evaluation configuration.
      operationId: getEvalConfig
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIEvalConfig'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
    put:
      summary: Update Eval Config
      description: Updates an AI evaluation configuration.
      operationId: updateEvalConfig
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAIEvalConfigInput'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIEvalConfig'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
  /eval_configs/{id}/records:
    post:
      summary: Create Eval Config Record
      description: Creates a new record for an AI evaluation configuration. Either provide a dialId to link an existing dial, or provide prompt fields to create a prompt-based record.
      operationId: createEvalConfigRecord
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ID of the eval config.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAIEvalRecordInput'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIEvalRecord'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
    get:
      summary: List Eval Config Records
      description: Lists the records for an AI evaluation configuration.
      operationId: listEvalConfigRecords
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ID of the eval config.
        - in: query
          name: limit
          schema:
            type: integer
            nullable: false
            default: 100
          description: The maximum number of records to fetch.
          required: false
        - in: query
          name: cursor
          schema:
            type: string
          required: false
          description: The pagination cursor returned by the previous request.
        - in: query
          name: search
          schema:
            type: string
          required: false
          description: Optional search filter for record names or IDs.
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/AIEvalRecord'
                  cursor:
                    type: string
                    nullable: true
                    description: "A cursor you can pass to fetch the next page. If no next page exists, the cursor will be null."
                required: ["data", "cursor"]
        '400':
          description: Invalid input
        '422':
          description: Validation exception
  /eval_configs/{id}/runs:
    post:
      summary: Run Eval
      description: Starts a new evaluation run for an AI evaluation configuration. Optionally specify specific record IDs to evaluate.
      operationId: runEval
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ID of the eval config.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunEvalInput'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIEvalRun'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
    get:
      summary: List Eval Config Runs
      description: Lists the runs for an AI evaluation configuration.
      operationId: listEvalConfigRuns
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ID of the eval config.
        - in: query
          name: limit
          schema:
            type: integer
            nullable: false
            default: 100
          description: The maximum number of runs to fetch.
          required: false
        - in: query
          name: cursor
          schema:
            type: string
          required: false
          description: The pagination cursor returned by the previous request.
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/AIEvalRun'
                  cursor:
                    type: string
                    nullable: true
                    description: "A cursor you can pass to fetch the next page. If no next page exists, the cursor will be null."
                required: ["data", "cursor"]
        '400':
          description: Invalid input
        '422':
          description: Validation exception
  /eval_configs/{id}/records/{recordId}:
    parameters:
      - in: path
        name: id
        schema:
          type: string
        required: true
        description: ID of the eval config.
      - in: path
        name: recordId
        schema:
          type: string
        required: true
        description: ID of the eval record.
    get:
      summary: Get Eval Record
      description: Gets an AI evaluation record.
      operationId: getEvalRecord
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIEvalRecord'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
    put:
      summary: Update Eval Record
      description: Updates an AI evaluation record. Only available for prompt-type records.
      operationId: updateEvalRecord
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAIEvalRecordInput'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIEvalRecord'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
    delete:
      summary: Delete Eval Record
      description: Deletes an AI evaluation record.
      operationId: deleteEvalRecord
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteEvalRecordOutput'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
  /eval_runs/{id}:
    get:
      summary: Get Eval Run
      description: Gets an AI evaluation run.
      operationId: getEvalRun
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ID of the eval run.
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIEvalRun'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
  /eval_runs/{id}/cancel:
    post:
      summary: Cancel Eval Run
      description: Cancels a running or pending evaluation run. Terminates the underlying workflow and sets the status to CANCELLED.
      operationId: cancelEvalRun
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ID of the eval run to cancel.
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIEvalRun'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
  /eval_runs/{id}/results:
    get:
      summary: List Eval Run Results
      description: Lists the results for an AI evaluation run.
      operationId: listEvalRunResults
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ID of the eval run.
        - in: query
          name: limit
          schema:
            type: integer
            nullable: false
            default: 100
          description: The maximum number of results to fetch.
          required: false
        - in: query
          name: cursor
          schema:
            type: string
          required: false
          description: The pagination cursor returned by the previous request.
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/AIEvalResult'
                  cursor:
                    type: string
                    nullable: true
                    description: "A cursor you can pass to fetch the next page. If no next page exists, the cursor will be null."
                required: ["data", "cursor"]
        '400':
          description: Invalid input
        '422':
          description: Validation exception
  /eval_results/{id}:
    get:
      summary: Get Eval Result
      description: Gets an AI evaluation result.
      operationId: getEvalResult
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ID of the eval result.
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIEvalResult'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
  /eval_results/{id}/rerun:
    post:
      summary: Rerun Eval Result
      description: Re-runs the evaluation judge on an existing result's transcript. Only re-evaluates using the judge model - does not re-generate the transcript.
      operationId: rerunEvalResult
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ID of the eval result to re-evaluate.
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIEvalRerunResult'
        '400':
          description: Invalid input
        '422':
          description: Validation exception

components:
  schemas:
    MultispeakerLine:
      type: object
      properties:
        text:
          type: string
          description: "The text to generate."
          nullable: false
        voiceId:
          type: string
          description: "The voice ID to use to generate the text."
          nullable: false
      required: ["text", "voiceId"]

    OutputType:
      type: string
      enum: ["RAW_PCM16", "WAV_PCM16", "MP3"]
      description: "The output format type for audio generation."
      nullable: false

    OutputFormat:
      type: object
      properties:
        outputType:
          $ref: '#/components/schemas/OutputType'
          description: "The type of output format."
          nullable: false
        sampleRate:
          type: integer
          description: "The sample rate for the audio output. Must be one of 8000, 16000, 22050, 24000, 41500, or 48000"
          nullable: false
      required: ["outputType", "sampleRate"]

    RunMultispeakerTTSInput:
      type: object
      properties:
        lines:
          type: array
          items:
            $ref: '#/components/schemas/MultispeakerLine'
          description: "The lines that need to be generated."
        voiceOptionValues:
          type: array
          x-go-type-skip-optional-pointer: true
          items:
            $ref: '#/components/schemas/ModelOptionValue'
          description: "An optional configuration for the voices being used."
        format:
          $ref: '#/components/schemas/OutputFormat'
          description: "The output format for the generated audio. Defaults to WAV_PCM16 at 24000 Hz."
          nullable: false
          default:
            outputType: "WAV_PCM16"
            sampleRate: 24000
      required: ["lines"]
    RunTTSInput:
      type: object
      properties:
        text:
          type: string
          description: "The text to generate."
          nullable: false
        voiceId:
          type: string
          description: "The voice ID to use to generate the text."
          nullable: false
        voiceOptionValues:
          type: array
          x-go-type-skip-optional-pointer: true
          items:
            $ref: '#/components/schemas/ModelOptionValue'
          description: "An optional configuration for the voice being used."
        format:
          $ref: '#/components/schemas/OutputFormat'
          description: "The output format for the generated audio. Defaults to WAV_PCM16 at 24000 Hz."
          nullable: false
          default:
            outputType: "WAV_PCM16"
            sampleRate: 24000
      required: ["text", "voiceId"]
    CloneVoiceInput:
      type: object
      properties:
        name:
          type: string
          description: "The name of the cloned voice."
        clip:
          type: string
          format: binary
          description: "The audio clip to use for cloning."
        model:
          $ref: '#/components/schemas/VoiceModel'
        transcription:
          type: string
          description: "Optional transcription of the audio clip."
      required: ["name", "clip", "model"]
    VoiceModel:
      type: string
      enum: ["CARTESIA", "CSM"]
    VoiceTier:
      type: string
      enum: ["STANDARD", "PREMIUM"]
    AIVoice:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        voiceType:
          type: string
        voiceTier:
          $ref: '#/components/schemas/VoiceTier'
        description:
          type: string
      required: ["id", "name", "voiceType", "voiceTier", "description"]
    ListVoicesResponse:
      type: object
      properties:
        voices:
          type: array
          items:
            $ref: '#/components/schemas/AIVoice'
        cursor:
          type: string
          nullable: true
          description: "A cursor you can pass to /voices to fetch the next page. If no next page exists, the cursor will be null."
      required: ["voices", "cursor"]
    ConcurrentCalls:
      type: object
      properties:
        currentCalls:
          type: integer
          description: "The current number of concurrent calls in the workspace."
          nullable: false
        limit:
          type: integer
          description: "The limit of concurrent calls for the workspace."
          nullable: false
      required: ["currentCalls", "limit"]
    AIModel:
      type: object
      properties:
        id:
          type: string
          nullable: false
        name:
          type: string
          nullable: false
        modelOptions:
          type: array
          items:
            $ref: '#/components/schemas/AIModelOption'
      required: ["id", "name", "modelOptions"]
    AIModelOption:
      type: object
      properties:
        id:
          type: string
          nullable: false
        name:
          type: string
          nullable: false
        valueType:
          type: string
          enum: ["STRING", "INT", "FLOAT"]
          nullable: false
        default:
          type: string
          nullable: false
      required: ["id", "name", "valueType", "default"]
    KVMapping:
      type: object
      properties:
        key:
          type: string
          nullable: false
        value:
          type: string
          nullable: false
      required: ["key", "value"]

    AllowedNumber:
      type: object
      properties:
        number:
          type: string
          nullable: false
          description: "The number in e.164 format."
      required: ["number"]

    BasicUpdateFunctionInput:
      type: object
      properties:
        name:
          type: string
          description: "The name of the function."
          nullable: false
        displayName:
          type: string
          description: "A human readable label for the function, used in the Vogent dashboard instead of the name. Never shown to the model. Set it to an empty string to fall back to the name."
          nullable: false
        description:
          type: string
          description: "A description of what the function does."
          nullable: false
        type:
          type: string
          enum: ["transfer", "api"]
        lifecycleMessages:
          $ref: "#/components/schemas/FunctionLifecycleMessages"
          description: "Messages to display during function execution lifecycle events."
    UpdateTransferFunctionInput:
      type: object
      properties:
        allowedNumbers:
          type: array
          description: "The numbers that the agent is allowed to transfer to."
          items:
            $ref: '#/components/schemas/AllowedNumber'
          nullable: false
        allowAnyNumber:
          type: boolean
          description: "Instead of using a fixed list of allowed numbers, allow the agent to transfer to any number (not recommended)."
      required: ["allowedNumbers"]

    UpdateAPIFunctionInput:
      type: object
      properties:
        apiPath:
          type: string
          description: "The path to the API."
          nullable: false
        headers:
          type: array
          description: "Headers to be sent with the API request"
          items:
            $ref: '#/components/schemas/KVMapping'
          nullable: false
        inputJsonSchema:
          type: string
          description: "The JSON schema for the input to the function. Must be a top level object."
      required: ["apiPath", "headers", "inputJsonSchema"]

    UpdateFunctionInput:
      allOf:
        - $ref: "#/components/schemas/BasicUpdateFunctionInput"
        - oneOf:
          - title: Transfer
            $ref: "#/components/schemas/UpdateTransferFunctionInput"
          - title: API
            $ref: "#/components/schemas/UpdateAPIFunctionInput"
          discriminator:
            propertyName: type
            mapping:
              transfer: '#/components/schemas/UpdateTransferFunctionInput'
              api: '#/components/schemas/UpdateAPIFunctionInput'

    FunctionLifecycleMessages:
      type: object
      properties:
        started:
          type: array
          description: "Messages to display when the function starts executing. One will be chosen at random."
          items:
            type: string
          nullable: false
        waiting:
          type: array
          description: "Messages to play while the function is still running and the model returned StillWaiting. One will be chosen at random. If empty, a built-in default set of English phrases is used."
          items:
            type: string
          nullable: false
        awaitSpeech:
          type: boolean
          description: "Hold the function until the agent has finished speaking — any text said alongside the call, then the started message — instead of running it while the agent is still talking. Defaults to false."
          nullable: false
      required: ["started"]

    BasicCreateFunctionInput:
      type: object
      properties:
        name:
          type: string
          description: "The name of the function."
          nullable: false
        displayName:
          type: string
          description: "A human readable label for the function, used in the Vogent dashboard instead of the name. Never shown to the model. Defaults to empty, in which case the name is displayed."
          nullable: false
        description:
          type: string
          description: "A description of what the function does."
          nullable: false
        type:
          type: string
          enum: ["transfer", "api"]
        lifecycleMessages:
          $ref: "#/components/schemas/FunctionLifecycleMessages"
          description: "Messages to display during function execution lifecycle events."
      required: ["name", "description"]
    CreateTransferFunctionInput:
      type: object
      properties:
        allowedNumbers:
          type: array
          description: "The numbers that the agent is allowed to transfer to in e.164 format (+11234567890)."
          items:
            $ref: '#/components/schemas/AllowedNumber'
          nullable: false
        allowAnyNumber:
          type: boolean
          description: "Instead of using a fixed list of allowed numbers, allow the agent to transfer to any number (not recommended)."
      required: ["allowedNumbers"]
    CreateAPIFunctionInput:
      type: object
      properties:
        apiPath:
          type: string
          description: "The path to the API."
          nullable: false
        headers:
          type: array
          description: "Headers to be sent with the API request"
          items:
            $ref: '#/components/schemas/KVMapping'
          nullable: false
        inputJsonSchema:
          type: string
          description: "The JSON schema for the input to the function. Must be a top level object."
      required: ["apiPath", "headers", "inputJsonSchema"]
    CreateFunctionInput:
      allOf: # Combines the BasicErrorModel and the inline model
        - $ref: "#/components/schemas/BasicCreateFunctionInput"
        - oneOf:
          - title: Transfer
            $ref: "#/components/schemas/CreateTransferFunctionInput"
          - title: API
            $ref: "#/components/schemas/CreateAPIFunctionInput"
          discriminator:
            propertyName: type
            mapping:
              transfer: '#/components/schemas/CreateTransferFunctionInput'
              api: '#/components/schemas/CreateAPIFunctionInput'
    BasicFunction:
      type: object
      properties:
        id:
          type: string
          nullable: false
        name:
          type: string
          description: "The name of the function."
          nullable: false
        displayName:
          type: string
          description: "A human readable label for the function, used in the Vogent dashboard instead of the name. Never shown to the model, and empty when unset — display the name in that case."
          nullable: false
        description:
          type: string
          description: "A description of what the function does."
          nullable: false
        type:
          type: string
          enum: ["transfer", "api"]
          nullable: false
        lifecycleMessages:
          $ref: "#/components/schemas/FunctionLifecycleMessages"
          description: "Messages to display during function execution lifecycle events."
      required: ["id", "name", "displayName", "description", "type"]
    TransferFunction:
      type: object
      properties:
        allowedNumbers:
          type: array
          description: "The numbers that the agent is allowed to transfer to."
          items:
            $ref: '#/components/schemas/AllowedNumber'
          nullable: false
        allowAnyNumber:
          type: boolean
          description: "Instead of using a fixed list of allowed numbers, allow the agent to transfer to any number (not recommended)."
      required: ["allowedNumbers", "allowAnyNumber"]

    APIFunction:
      type: object
      properties:
        apiPath:
          type: string
          description: "The path to the API."
          nullable: false
        headers:
          type: array
          description: "Headers to be sent with the API request"
          items:
            $ref: '#/components/schemas/KVMapping'
          nullable: false
        inputJsonSchema:
          type: string
          description: "The JSON schema for the input to the function. Must be a top level object."
      required: ["apiPath", "headers", "inputJsonSchema"]

    ListFunctionsResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Function'
        cursor:
          type: string
          nullable: true
          description: "A cursor you can pass to /functions to fetch the next page. If no next page exists, the cursor will be null."
      required: ["data", "cursor"]

    Function:
      allOf:
        - $ref: "#/components/schemas/BasicFunction"
        - oneOf:
          - title: Transfer
            $ref: "#/components/schemas/TransferFunction"
          - title: API
            $ref: "#/components/schemas/APIFunction"
          discriminator:
            propertyName: type
            mapping:
              transfer: '#/components/schemas/TransferFunction'
              api: '#/components/schemas/APIFunction'
    PhoneNumberPurchaseInput:
      type: object
      properties:
        number:
          type: string
          description: "The number as returned by the phone number search endpoint."
          nullable: false
      required: ["number"]
    PhoneNumberSearchInput:
      type: object
      properties:
        prefix:
          type: string
          nullable: false
          description: "The phone number prefix, without the country code."
        country:
          type: string
          default: "US"
          description: "The 2-letter country code."
        limit:
          type: integer
          default: 5
          description: "The maximum number of candidates to return, maximum 10."
      required: ["prefix"]
    PhoneNumberCandidate:
      type: object
      properties:
        number:
          type: string
          nullable: false
          description: "The phone number that's available for purchase"
      required: ["number"]
    UpdatePhoneNumberInput:
      type: object
      properties:
        agentId:
          type: string
          nullable: false
          description: "The ID of the agent to link this phone number to. Set to the empty string to unlink an agent."
    PhoneNumberType:
      type: string
      enum: ["PSTN", "SIP_USERNAME"]
    PhoneNumber:
      type: object
      properties:
        id:
          type: string
        number:
          type: string
          example: "+18001234567"
          description: "The number in e.164 format, or the SIP username, if the type is SIP_USERNAME."
        type:
          $ref: '#/components/schemas/PhoneNumberType'
        agentId:
          type: string
          nullable: true
          description: "The ID of the linked agent, if the phone number is linked to one."
      required: ["id", "number", "agentId", "type"]
    CallTranscriptEntry:
      type: object
      properties:
        text:
          type: string
        speaker:
          type: string
          description: Either `HUMAN` or `AI`, indicating the speaker type. If this is a function
            call result the speaker will be `AI`, while the `detailType` will be `function`.
        detailType:
          type: string
          nullable: true
          description: Will be `function` if this is a function result, otherwise `null`.
        functionCallId:
          type: string
          description: The function call ID if this is a tool call result.
        startTimeMs:
          type: integer
        endTimeMs:
          type: integer
        functionCalls:
          type: array
          items:
            $ref: '#/components/schemas/CallTranscriptFunctionCall'
        nodeTransition:
          $ref: '#/components/schemas/CallTranscriptNodeTransition'
      required: ["text", "speaker"]
    CallTranscriptNodeTransition:
      type: object
      properties:
        toNodeId:
          type: string
        transitionData:
          type: object
          additionalProperties: {}
          x-go-type: "interface{}"
          x-go-type-skip-optional-pointer: true
          nullable: true
      required: ["toNodeId", "transitionData"]
    CallTranscriptFunctionCall:
      type: object
      properties:
        functionCallId:
          type: string
        name:
          type: string
        args:
          type: string
          description: "The arguments to the function call, JSON encoded if it is an object."
      required: ["name", "args"]
    CallRecording:
      type: object
      properties:
        url:
          type: string
          description: A URL that can be used to download the recording of the call. Be
            sure to include an API key in the header to access the recording.
          nullable: false
      required: ["url"]
    AgentType:
      type: string
      enum: ["STANDARD", "CUSTOM_FLOW"]
    IdleMessageConfig:
      type: object
      properties:
        enabled:
          type: boolean
          description: "Whether idle messages are enabled for this agent."
          nullable: false
        messages:
          type: array
          items:
            type: string
          description: "The list of idle messages that the agent can say when the user is silent."
          nullable: false
          x-go-type-skip-optional-pointer: true
        idleDurationMilliseconds:
          type: integer
          description: "The duration in milliseconds that the user must be silent before an idle message is triggered."
          nullable: false
          minimum: 5000
        maxIdleMessages:
          type: integer
          description: "The maximum number of idle messages that can be said during a call."
          nullable: false
          minimum: 1
      required: ["enabled"]
    Agent:
      type: object
      properties:
        id:
          type: string
          nullable: false
        name:
          type: string
          nullable: false
        transcriberParams:
          $ref: '#/components/schemas/TranscriberParams'
          x-go-type-skip-optional-pointer: true
          nullable: true
        metadata:
          type: object
          additionalProperties: {}
          x-go-type-skip-optional-pointer: true
        utteranceDetectorConfig:
          $ref: '#/components/schemas/UtteranceDetectorConfig'
        endpointDetectorConfig:
          $ref: '#/components/schemas/EndpointDetectorConfig'
          nullable: true
          description: "Configuration for endpoint detection to determine when a user has finished speaking."
        ivrConfiguration:
          $ref: '#/components/schemas/IVRConfiguration'
          description: "The configuration for IVR detection and navigation including detection type, prompt, voice, and tagging settings."
          nullable: true
        idleMessageConfig:
          $ref: '#/components/schemas/IdleMessageConfig'
          nullable: true
          description: "Configuration for idle messages that the agent can say when the user is silent."
        language:
          type: string
          description: "The language to use for the agent."
        maxDurationSeconds:
          type: integer
          nullable: false
          default: 10800
          description: "The maximum duration of the call in seconds."
        timeoutMessage:
          type: string
          nullable: true
          description: "An optional message to play via TTS before hanging up when the call reaches its max duration timeout."
        timeoutBehaviorConfiguration:
          $ref: '#/components/schemas/TimeoutBehaviorConfiguration'
          nullable: true
          description: "Configuration for the behavior when a call reaches its max duration timeout."
        defaultVoiceId:
          type: string
          description: "The default voice ID to use for the agent."
        defaultVersionedPromptId:
          type: string
          description: "The default versioned prompt ID to use for the agent."
        defaultExtractorId:
          type: string
          description: "The default extractor ID to use for the agent."
          nullable: true
        linkedFunctionDefinitions:
          type: array
          x-go-type-skip-optional-pointer: true
          items:
            $ref: "#/components/schemas/LinkedFunctionDefinition"
          description: "The function definitions that should be available to this agent."
        fillEmptyStringVariables:
          type: boolean
          nullable: false
          description: "If true, variables that are not specified will be filled with empty strings instead of being left as template placeholders."
        silenceHangupConfiguration:
          $ref: '#/components/schemas/SilenceHangupConfiguration'
          nullable: true
          description: "Configuration for automatically hanging up the call after a period of silence."
        ivrSilenceHangupConfiguration:
          $ref: '#/components/schemas/SilenceHangupConfiguration'
          nullable: true
          description: "Configuration for automatically hanging up the call after a period of silence while in IVR mode."
        voicemailConfig:
          $ref: '#/components/schemas/VoicemailConfig'
          nullable: true
          description: "Configuration for what to do when an answering machine is detected."
        voiceOptionValues:
          type: array
          x-go-type-skip-optional-pointer: true
          items:
            $ref: '#/components/schemas/ModelOptionValue'
          description: "The configuration values for the voice being used by the agent."
      required: ["id", "name", "language"]
    VersionedPrompt:
      type: object
      properties:
        id:
          type: string
          nullable: false
          description: "Unique identifier for the versioned prompt"
        name:
          type: string
          nullable: false
          description: "Human-readable name for the versioned prompt"
        agentType:
          $ref: '#/components/schemas/AgentType'
          description: "The type of agent this prompt is designed for (STANDARD or CUSTOM_FLOW)"
        prompt:
          type: string
          nullable: true
          description: "The actual prompt content that will be used by the agent. Can be null for CUSTOM_FLOW agent types"
        flowDefinition:
          $ref: '#/components/schemas/FlowDefinition'
          nullable: true
          description: "The flow definition for the agent. Only defined for CUSTOM_FLOW agent types."
        aiModelId:
          type: string
          description: "The AI model ID to use for the agent."
        modelOptionValues:
          x-go-type-skip-optional-pointer: true
          type: array
          items:
            $ref: '#/components/schemas/ModelOptionValue'
      required: ["id", "name", "agentType", "prompt"]
    FlowTransitionRuleConditionType:
      type: string
      enum: ["always", "equal", "in", "greater", "less", "language"]
      description: "The condition used to evaluate the transition rule. If language, the value will be used as a natural language condition to describe when to execute a transition."
      nullable: false
    ArrayConditionType:
      type: string
      enum: ["any", "all"]
      description: "The type of array condition to apply. 'any' means at least one element must match, 'all' means all elements must match."
      nullable: true
    FlowTransitionRule:
      type: object
      properties:
        conditionType:
          $ref: '#/components/schemas/FlowTransitionRuleConditionType'
        arrayConditionType:
          $ref: '#/components/schemas/ArrayConditionType'
        field:
          type: string
          nullable: true
        value:
          type: string
          nullable: true
        values:
          type: array
          items:
            type: string
          nullable: true
          x-go-type-skip-optional-pointer: true
        transitionNodeId:
          type: string
          nullable: false
      required: ["conditionType", "transitionNodeId"]
    ApiFlowNode:
      type: object
      properties:
        id:
          type: string
          nullable: false
        name:
          type: string
          nullable: false
        type:
          type: string
          nullable: false
          description: "The node type. View the available types at https://docs.vogent.ai/flow."
        transitionRules:
          type: array
          items:
            $ref: '#/components/schemas/FlowTransitionRule'
          nullable: false
          x-go-type-skip-optional-pointer: true
        outputSchema:
          type: string
          nullable: true
          description: "The JSON schema describing the output of this node. This is generated automatically from the node type and node data."
        nodeData:
          type: object
          nullable: false
          description: "The node-specific configuration. View the schemas by type at https://docs.vogent.ai/flow."
      required: ["id", "name", "type", "transitionRules", "nodeData"]
    FlowDefinition:
      type: object
      properties:
        nodes:
          type: array
          items:
            $ref: '#/components/schemas/ApiFlowNode'
          nullable: false
        globalContext:
          type: string
          nullable: true
        aiOpen:
          type: boolean
          nullable: false
          description: "Deprecated, use openingLineType instead."
        openingLineType:
          $ref: '#/components/schemas/OpeningLineType'
          nullable: false
      required: ["nodes", "globalContext", "aiOpen", "openingLineType"]
    Dial:
      type: object
      properties:
        id:
          type: string
          nullable: false
        toNumber:
          type: string
          x-go-type-skip-optional-pointer: true
        agent:
          $ref: '#/components/schemas/Agent'
        recordings:
          type: array
          x-go-type-skip-optional-pointer: true
          items:
            $ref: '#/components/schemas/CallRecording'
        transcript:
          type: array
          x-go-type-skip-optional-pointer: true
          items:
            $ref: '#/components/schemas/CallTranscriptEntry'
        durationSeconds:
          type: integer
          nullable: false
          description: "The total duration of the call, including all telephony time (if the call was transferred, this will include the transfer time)"
        aiDurationSeconds:
          type: integer
          nullable: false
          description: "The total duration of the call during which the AI was involved. Does not include transfer time."
        aiResult:
          type: object
          additionalProperties: {}
        inputs:
          type: object
          additionalProperties: {}
        status:
          type: string
          nullable: false
        dialTaskId:
          type: string
        fromNumberId:
          type: string
        startedAt:
          type: string
          format: date-time
          nullable: false
        endedAt:
          type: string
          format: date-time
          nullable: false
        createdAt:
          type: string
          format: date-time
          nullable: false
        updatedAt:
          type: string
          format: date-time
          nullable: false
        systemResultType:
          $ref: '#/components/schemas/SystemResultType'
          description: "The type of system result for this dial, if applicable."
          nullable: true
        voiceId:
          type: string
          nullable: false
        versionedPromptId:
          type: string
          nullable: false
      required: ["id"]
    HangupDialOutput:
      type: object
      properties:
        success:
          type: boolean
          example: true
          nullable: false
      required: ["success"]
    CreateDialOutput:
      type: object
      properties:
        dialToken:
          type: string
          example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZXN0IjoidGVzdCJ9.9EQaLsDRKDVXLUVLR9JgDTjEULaT2-OMbHayQAzgZH8"
          description: You can pass this dial token to Elto's web UI, or use this token to authorize any requests for this dial. It's safe to pass this token to a client -- it only allows users to run requests against the dial associated with this session.
          nullable: false
        sessionId:
          type: string
          example: "61ccefdf-ea02-4f49-811b-1241f8e20d26"
          nullable: false
        dialId:
          type: string
          example: "57555c5e-5a56-49ca-8fe8-24946d2fbc3e"
          nullable: false
      required: ["dialToken", "sessionId", "dialId"]
    CreateDialConflictOutput:
      type: object
      description: "The idempotency key on the request was already used by another dial in this workspace, so no second call was placed."
      properties:
        error:
          type: string
          example: "A dial with idempotency key \"order-4711-reminder\" already exists in this workspace: 57555c5e-5a56-49ca-8fe8-24946d2fbc3e"
          description: A description of the conflict.
          nullable: false
        dialId:
          type: string
          example: "57555c5e-5a56-49ca-8fe8-24946d2fbc3e"
          description: The dial that already holds this idempotency key. Retrieve it from /dials/{id} to pick up the call that was already placed.
          nullable: false
      required: ["error", "dialId"]
    DialTokenOutput:
      type: object
      properties:
        dialToken:
          type: string
          example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZXN0IjoidGVzdCJ9.9EQaLsDRKDVXLUVLR9JgDTjEULaT2-OMbHayQAzgZH8"
          description: You can pass this dial token to Elto's web UI, or use this token to authorize any requests for this dial. It's safe to pass this token to a client -- it only allows users to run requests against the dial associated with this session.
          nullable: false
      required: ["dialToken"]
    CreateDialInput:
      type: object
      properties:
        webhookUrl:
          type: string
          example: "https://test.com/webhook"
          nullable: true
          description: Optional. The URL for the webhook for this dial session.
        browserCall:
          type: boolean
          example: false
          nullable: true
          description: Set to true if this is a browser call.
        toNumber:
          type: string
          example: "+11234567890"
          nullable: true
          description: Required if this is a phone dial, in E.164 format.
        fromNumberId:
          type: string
          example: "1caec78c-4bba-477d-82cf-bcfce2b73856"
          nullable: true
          description: The ID for the phone number to use to start the call. Required if this is a phone dial.
        fromNumberPoolId:
          type: string
          example: "1caec78c-4bba-477d-82cf-bcfce2b73856"
          nullable: true
          description: The ID of a phone number pool to use when starting the call.
        aiVoiceId:
          type: string
          example: "61ccefdf-ea02-4f49-811b-1241f8e20d26"
          nullable: true
          description: The ID for the voice on the call. If not specified, the default voice for the agent will be used.
        voiceOptionValues:
          type: array
          x-go-type-skip-optional-pointer: true
          items:
            $ref: '#/components/schemas/ModelOptionValue'
          description: "An optional configuration for the voice being used."
        voiceVolumeLevel:
          type: integer
          example: -100
          description: The volume level for the voice on the call, from -300 (quiet) to 300 (loud).
        callAgentId:
          type: string
          example: "61ccefdf-ea02-4f49-811b-1241f8e20d26"
          description: Required. The ID of the agent.
        versionedModelId:
          type: string
          example: "61ccefdf-ea02-4f49-811b-1241f8e20d26"
          description: The prompt/model version to use for this call, if not specified, the default on the agent is used.
        ivrVersionedPromptId:
          type: string
          example: "61ccefdf-ea02-4f49-811b-1241f8e20d26"
          description: The prompt/model version to use for the IVR portion of this call, if ivr nav is enabled on the agent.
        overrideTranscriberFinalDurationMs:
          type: integer
          example: 500
          description: How long in ms after an utterance is complete to ignore the final/non-final status of the transcript and run inference.
        timeoutMinutes:
          type: integer
          example: 10
          description: "The number of minutes before the call will be timed out. If not specified, there will be no limit on the calls, it's recommended to provide something here."
        callAgentExtractorId:
          type: string
          example: "61ccefdf-ea02-4f49-811b-1241f8e20d26"
          description: The ID of the extractor to use for this call, if not specified, the default on the agent is used.
        callAgentInput:
          type: object
          nullable: true
          x-go-type-skip-optional-pointer: true
          additionalProperties: {}
          description: "Any macros in the call agent prompt."
        agentOverrides:
          $ref: '#/components/schemas/AgentOverrides'
          nullable: true
          description: (Alpha) This feature is in Alpha testing, schemas may change slightly before GA. Please notify the Vogent team if there are any issues when using this field. Optional overrides for the call agent used for this dial.
        keywords:
          type: array
          items:
            type: string
          nullable: true
          x-go-type-skip-optional-pointer: true
          description: "A list of keywords to be used in the call."
        advancedBrowserInteraction:
          type: boolean
          description: "If browserCall is false, and you want to have a more complex flow, allowing the web SDK to have transcribed barge-in lines, you should set this to true. Contact the vogent team to enable this feature."
        idempotencyKey:
          type: string
          example: "order-4711-reminder"
          maxLength: 255
          nullable: true
          description: "Optional. A unique key that keeps a retried request from placing a second call. If a dial in this workspace was already created with this key, the request fails with a 409 naming that dial instead of dialing again."
      required: ["callAgentId"]
    OpeningLineType:
      type: string
      enum:
        - INBOUND_ONLY
        - INBOUND_OUTBOUND
        - NONE
    ModelOptionValue:
      type: object
      description: "A configuration value for the model. You can get a list of available models and their configuration values from /models. All configuration values, with defaults will be returned when you retrieve a versioned prompt."
      properties:
        optionId:
          type: string
          description: "The ID of option."
          nullable: false
        value:
          type: string
          nullable: false
      required: ["optionId", "value"]
    CreateVersionedPromptInput:
      type: object
      properties:
        aiModelId:
          type: string
          description: "The ID of the model to use."
          nullable: false
        agentType:
          $ref: '#/components/schemas/AgentType'
          description: "The type of agent that this prompt represents."
        prompt:
          type: string
          nullable: true
        flowDefinition:
          $ref: '#/components/schemas/FlowDefinitionInput'
          description: "For agents with agentType CUSTOM_FLOW, the flow definition that you want to use."
          nullable: false
        name:
          type: string
          nullable: false
        modelOptionValues:
          x-go-type-skip-optional-pointer: true
          type: array
          items:
            $ref: '#/components/schemas/ModelOptionValue'
      required: ["aiModelId", "agentType", "name"]
    UpdateVersionedPromptInput:
      type: object
      properties:
        aiModelId:
          type: string
          description: "The ID of the model to use."
          nullable: false
        agentType:
          $ref: '#/components/schemas/AgentType'
          description: "The type of agent that this prompt represents."
          nullable: false
        prompt:
          type: string
          nullable: false
        flowDefinition:
          $ref: '#/components/schemas/FlowDefinitionInput'
          description: "For agents with agentType CUSTOM_FLOW, the flow definition that you want to use."
          nullable: false
        name:
          type: string
          nullable: false
        modelOptionValues:
          x-go-type-skip-optional-pointer: true
          type: array
          items:
            $ref: '#/components/schemas/ModelOptionValue'
    FlowDefinitionInput:
      type: object
      properties:
        nodes:
          type: array
          x-go-type-skip-optional-pointer: true
          items:
            $ref: '#/components/schemas/ApiFlowNodeInput'
          nullable: false
        globalContext:
          type: string
          nullable: true
        aiOpen:
          type: boolean
          nullable: false
          description: "Deprecated, use openingLineType instead."
        openingLineType:
          $ref: '#/components/schemas/OpeningLineType'
          nullable: false
    ApiFlowNodeInput:
      type: object
      properties:
        id:
          type: string
          nullable: false
        name:
          type: string
          nullable: false
          description: "One of the allowed flow node types. View the available types at https://docs.vogent.ai/flow."
        type:
          type: string
          nullable: false
        transitionRules:
          type: array
          items:
            $ref: '#/components/schemas/FlowTransitionRuleInput'
          nullable: false
        nodeData:
          type: object
          nullable: false
          description: "The node-specific configuration. View the configurations by node type at https://docs.vogent.ai/flow."
      required: ["id", "name", "type", "transitionRules", "nodeData"]
    FlowTransitionRuleInput:
      type: object
      properties:
        conditionType:
          $ref: '#/components/schemas/FlowTransitionRuleConditionType'
          nullable: false
        arrayConditionType:
          $ref: '#/components/schemas/ArrayConditionType'
        field:
          type: string
          nullable: true
        value:
          type: string
          nullable: true
        values:
          type: array
          items:
            type: string
          nullable: true
          x-go-type-skip-optional-pointer: true
        transitionNodeId:
          type: string
          nullable: false
      required: ["conditionType", "transitionNodeId"]

    LinkedFunctionDefinition:
      type: object
      properties:
        functionDefinitionId:
          type: string
          nullable: false
          description: "The ID of the function definition to link."
        lifecycleMessagesOverride:
          $ref: '#/components/schemas/FunctionLifecycleMessages'
          description: "Lifecycle messages to override the defaults for this function link, or null to not override."
      required: ["functionDefinitionId"]
    UpdateAgentInput:
      type: object
      properties:
        name:
          type: string
          description: "The name of the agent."
          nullable: false
        defaultVoiceId:
          type: string
          description: "The ID of the default voice to use."
          nullable: false
        defaultVersionedPromptId:
          type: string
          nullable: false
          description: "The default versioned prompt to use for this agent."
        callAgentExtractorId:
          type: string
          description: "The ID of the extractor to use for this agent, if not specified, the default on the agent is used. Set to an empty string to disable the extractor."
        inboundWebhookResponse:
          type: boolean
          nullable: false
        inboundWebhookUrl:
          type: string
          nullable: false
        maxDurationSeconds:
          type: integer
          nullable: false
          default: 10800
          description: "The maximum duration of the call in seconds."
        timeoutMessage:
          type: string
          nullable: true
          description: "An optional message to play via TTS before hanging up when the call reaches its max duration timeout."
        timeoutBehaviorConfiguration:
          $ref: '#/components/schemas/TimeoutBehaviorConfiguration'
          nullable: true
          description: "Configuration for the behavior when a call reaches its max duration timeout."
        metadata:
          type: object
          additionalProperties: {}
          x-go-type-skip-optional-pointer: true
        openingLine:
          type: object
          properties:
            lineType:
              $ref: '#/components/schemas/OpeningLineType'
              nullable: false
              description: "An indication of when the opening line should be used."
            content:
              type: string
              nullable: false
              description: "The content of the opening line."
          required: ["lineType", "content"]
          nullable: true
          description: "Details about the Agent's opening line. If unspecified, or null no opening line will be created."
        voiceVolumeLevel:
          type: integer
          nullable: false
          default: -100
          description: "A value, generally between -300 and 300, indicating the volume level to use for the voice. The default is -100."
        backgroundNoiseType:
          type: string
          enum:
            - noise
            - office
            - silence
          description: "The background audio that's used by the agent."
          nullable: false
        linkedFunctionDefinitionIds:
          type: array
          x-go-type-skip-optional-pointer: true
          items:
            type: string
          description: "The function definitions that should be available to this agent (deprecated, use linkedFunctionDefinitionInputs instead)"
        linkedFunctionDefinitionInputs:
          type: array
          x-go-type-skip-optional-pointer: true
          items:
            $ref: "#/components/schemas/LinkedFunctionDefinition"
          description: "The function definitions that should be available to this agent with optional lifecycle message overrides"
        transcriberParams:
          $ref: '#/components/schemas/TranscriberParams'
          x-go-type-skip-optional-pointer: true
          nullable: true
        idleMessageConfig:
          $ref: '#/components/schemas/IdleMessageConfig'
        utteranceDetectorConfig:
          $ref: '#/components/schemas/UtteranceDetectorConfig'
        endpointDetectorConfig:
          $ref: '#/components/schemas/EndpointDetectorConfig'
          nullable: true
          description: "Configuration for endpoint detection to determine when a user has finished speaking."
        ivrConfiguration:
          $ref: '#/components/schemas/IVRConfiguration'
          description: "The configuration for IVR detection and navigation including detection type, prompt, voice, and tagging settings."
          nullable: true
        language:
          type: string
        secondaryLanguages:
          type: array
          x-go-type-skip-optional-pointer: true
          items:
            type: string
          description: "Additional languages the agent can switch to during a call."
        enableChangeLanguage:
          type: boolean
          description: "Whether the agent can use the change_language tool to switch languages during a call."
        fillEmptyStringVariables:
          type: boolean
          nullable: true
          description: "If true, variables that are not specified will be filled with empty strings instead of being left as template placeholders."
        silenceHangupConfiguration:
          $ref: '#/components/schemas/SilenceHangupConfiguration'
          nullable: true
          description: "Configuration for automatically hanging up the call after a period of silence."
        ivrSilenceHangupConfiguration:
          $ref: '#/components/schemas/SilenceHangupConfiguration'
          nullable: true
          description: "Configuration for automatically hanging up the call after a period of silence while in IVR mode."
        voicemailConfig:
          $ref: '#/components/schemas/VoicemailConfig'
          nullable: true
          description: "Configuration for what to do when an answering machine is detected."
        voiceOptionValues:
          type: array
          x-go-type-skip-optional-pointer: true
          items:
            $ref: '#/components/schemas/ModelOptionValue'
          description: "An optional configuration for the voice being used."
    IVRConfigurationOverride:
      type: object
      properties:
        detectionType:
          $ref: '#/components/schemas/IvrDetectionType'
          description: "The type of IVR detection to use."
          nullable: false
        versionedPromptId:
          type: string
          description: "The versioned prompt ID to use for IVR detection."
          nullable: true
        versionedPrompt:
          $ref: '#/components/schemas/CreateVersionedPromptInput'
          nullable: false
          description: "The default versioned prompt to use for IVR navigation."
        aiVoiceId:
          type: string
          description: "The AI voice ID to use for IVR detection."
          nullable: true
        taggingText:
          type: string
          description: "The tagging text for IVR detection."
          nullable: true
      required: ["detectionType"]
    AgentOverrides:
      description: "Optional overrides for agent configuration when creating a dial. These override the agent's default settings for this specific dial."
      type: object
      properties:
        defaultVoiceId:
          type: string
          description: "The ID of the voice to use."
          nullable: false
        defaultVersionedPrompt:
          $ref: '#/components/schemas/CreateVersionedPromptInput'
          nullable: false
          description: "The default versioned prompt to use."
        inboundWebhookResponse:
          type: boolean
          nullable: false
        inboundWebhookUrl:
          type: string
          nullable: false
        maxDurationSeconds:
          type: integer
          nullable: false
          description: "The maximum duration of the call in seconds."
        timeoutMessage:
          type: string
          nullable: true
          description: "An optional message to play via TTS before hanging up when the call reaches its max duration timeout."
        timeoutBehaviorConfiguration:
          $ref: '#/components/schemas/TimeoutBehaviorConfiguration'
          nullable: true
          description: "Configuration for the behavior when a call reaches its max duration timeout."
        openingLine:
          type: object
          properties:
            lineType:
              $ref: '#/components/schemas/OpeningLineType'
              nullable: false
              description: "An indication of when the opening line should be used."
            content:
              type: string
              description: "The content of the opening line."
          required: ["lineType", "content"]
          nullable: false
          description: "Details about the Agent's opening line. If unspecified, or null no opening line will be created."
        voiceVolumeLevel:
          type: integer
          nullable: false
          description: "A value, generally between -300 and 300, indicating the volume level to use for the voice. The default is -100."
        backgroundNoiseType:
          type: string
          enum:
            - noise
            - office
            - silence
          description: "The background audio that's used by the agent."
        linkedFunctionDefinitionIds:
          type: array
          x-go-type-skip-optional-pointer: true
          items:
            type: string
          description: "The function definitions that should be available to this agent (deprecated, use linkedFunctionDefinitionInputs instead)"
        linkedFunctionDefinitionInputs:
          type: array
          x-go-type-skip-optional-pointer: true
          items:
            $ref: "#/components/schemas/LinkedFunctionDefinition"
          description: "The function definitions that should be available to this agent with optional lifecycle message overrides"
        metadata:
          type: object
          additionalProperties: {}
          x-go-type-skip-optional-pointer: true
        transcriberParams:
          $ref: '#/components/schemas/TranscriberParams'
          x-go-type-skip-optional-pointer: true
          nullable: false
        idleMessageConfig:
          $ref: '#/components/schemas/IdleMessageConfig'
        utteranceDetectorConfig:
          $ref: '#/components/schemas/UtteranceDetectorConfig'
        endpointDetectorConfig:
          $ref: '#/components/schemas/EndpointDetectorConfig'
          nullable: false
          description: "Configuration for endpoint detection to determine when a user has finished speaking. If not specified, will default to a semantic detector in the default mode."
        ivrConfiguration:
          $ref: '#/components/schemas/IVRConfigurationOverride'
          description: "The configuration for IVR detection and navigation including detection type, prompt, voice, and tagging settings."
        language:
          type: string
          description: "The language to use for the agent."
        secondaryLanguages:
          type: array
          x-go-type-skip-optional-pointer: true
          items:
            type: string
          description: "Additional languages the agent can switch to during a call."
        enableChangeLanguage:
          type: boolean
          description: "Whether the agent can use the change_language tool to switch languages during a call."
        fillEmptyStringVariables:
          type: boolean
          description: "If true, variables that are not specified will be filled with empty strings instead of being left as template placeholders."
        silenceHangupConfiguration:
          $ref: '#/components/schemas/SilenceHangupConfiguration'
          nullable: true
          description: "Configuration for automatically hanging up the call after a period of silence."
        ivrSilenceHangupConfiguration:
          $ref: '#/components/schemas/SilenceHangupConfiguration'
          nullable: true
          description: "Configuration for automatically hanging up the call after a period of silence while in IVR mode."
        voicemailConfig:
          $ref: '#/components/schemas/VoicemailConfig'
          nullable: true
          description: "Configuration for what to do when an answering machine is detected."
    CreateAgentInput:
        type: object
        properties:
          name:
            type: string
            description: "The name of the agent."
            nullable: false
          defaultVoiceId:
            type: string
            description: "The ID of the voice to use."
            nullable: false
          defaultVersionedPrompt:
            $ref: '#/components/schemas/CreateVersionedPromptInput'
            nullable: false
            description: "The default versioned prompt to use for this agent."
          defaultExtractor:
            $ref: '#/components/schemas/CreateCallAgentExtractorInput'
            nullable: true
            description: "The default extractor to use for this agent."
          inboundWebhookResponse:
            type: boolean
            nullable: false
          inboundWebhookUrl:
            type: string
            nullable: false
          maxDurationSeconds:
            type: integer
            nullable: false
            default: 10800
            description: "The maximum duration of the call in seconds."
          timeoutMessage:
            type: string
            nullable: true
            description: "An optional message to play via TTS before hanging up when the call reaches its max duration timeout."
          timeoutBehaviorConfiguration:
            $ref: '#/components/schemas/TimeoutBehaviorConfiguration'
            nullable: true
            description: "Configuration for the behavior when a call reaches its max duration timeout."
          openingLine:
            type: object
            properties:
              lineType:
                $ref: '#/components/schemas/OpeningLineType'
                nullable: false
                description: "An indication of when the opening line should be used."
              content:
                type: string
                nullable: false
                description: "The content of the opening line."
            required: ["lineType", "content"]
            nullable: true
            description: "Details about the Agent's opening line. If unspecified, or null no opening line will be created."
          voiceVolumeLevel:
            type: integer
            nullable: true
            default: -100
            description: "A value, generally between -300 and 300, indicating the volume level to use for the voice. The default is -100."
          backgroundNoiseType:
            type: string
            enum:
              - noise
              - office
              - silence
            default: office
            description: "The background audio that's used by the agent."
          linkedFunctionDefinitionIds:
            type: array
            x-go-type-skip-optional-pointer: true
            items:
              type: string
            description: "The function definitions that should be available to this agent (deprecated, use linkedFunctionDefinitionInputs instead)"
          linkedFunctionDefinitionInputs:
            type: array
            x-go-type-skip-optional-pointer: true
            items:
              $ref: "#/components/schemas/LinkedFunctionDefinition"
            description: "The function definitions that should be available to this agent with optional lifecycle message overrides"
          metadata:
            type: object
            additionalProperties: {}
            x-go-type-skip-optional-pointer: true
          transcriberParams:
            $ref: '#/components/schemas/TranscriberParams'
            x-go-type-skip-optional-pointer: true
            nullable: true
          idleMessageConfig:
            $ref: '#/components/schemas/IdleMessageConfig'
          utteranceDetectorConfig:
            $ref: '#/components/schemas/UtteranceDetectorConfig'
          endpointDetectorConfig:
            $ref: '#/components/schemas/EndpointDetectorConfig'
            nullable: true
            description: "Configuration for endpoint detection to determine when a user has finished speaking. If not specified, will default to a semantic detector in the default mode."
          ivrConfiguration:
            $ref: '#/components/schemas/IVRConfiguration'
            description: "The configuration for IVR detection and navigation including detection type, prompt, voice, and tagging settings."
            nullable: true
          language:
            type: string
            default: en
            description: "The language to use for the agent."
          secondaryLanguages:
            type: array
            x-go-type-skip-optional-pointer: true
            items:
              type: string
            description: "Additional languages the agent can switch to during a call."
          enableChangeLanguage:
            type: boolean
            description: "Whether the agent can use the change_language tool to switch languages during a call."
          fillEmptyStringVariables:
            type: boolean
            nullable: true
            description: "If true, variables that are not specified will be filled with empty strings instead of being left as template placeholders."
          silenceHangupConfiguration:
            $ref: '#/components/schemas/SilenceHangupConfiguration'
            nullable: true
            description: "Configuration for automatically hanging up the call after a period of silence."
          ivrSilenceHangupConfiguration:
            $ref: '#/components/schemas/SilenceHangupConfiguration'
            nullable: true
            description: "Configuration for automatically hanging up the call after a period of silence while in IVR mode."
          voicemailConfig:
            $ref: '#/components/schemas/VoicemailConfig'
            nullable: true
            description: "Configuration for what to do when an answering machine is detected."
          voiceOptionValues:
            type: array
            x-go-type-skip-optional-pointer: true
            items:
              $ref: '#/components/schemas/ModelOptionValue'
            description: "An optional configuration for the voice being used."
        required: ["name", "defaultVoiceId", "defaultVersionedPrompt"]
    IvrDetectionType:
      type: string
      enum: ["NONE", "STANDARD"]
      description: "The type of IVR detection to use for the agent."
    IVRConfiguration:
      type: object
      nullable: true
      properties:
        detectionType:
          $ref: '#/components/schemas/IvrDetectionType'
          description: "The type of IVR detection to use."
          nullable: false
        versionedPromptId:
          type: string
          description: "The versioned prompt ID to use for IVR detection."
          nullable: true
        aiVoiceId:
          type: string
          description: "The AI voice ID to use for IVR detection."
          nullable: true
        taggingText:
          type: string
          description: "The tagging text for IVR detection."
          nullable: true
      required: ["detectionType"]
    CreateDialTaskInput:
      type: object
      properties:
        callAgentId:
          type: string
          nullable: false
          description: "The ID of the call agent to create the task for."
        inputData:
          type: object
          nullable: false
          additionalProperties: {}
          description: "The input data for the task."
        keyInputs:
          type: array
          items:
            type: string
          nullable: false
          description: "The key inputs for the task."
      required: ["callAgentId", "inputData", "keyInputs"]
    CreateTaskAttemptInput:
      type: object
      properties:
        toNumber:
          type: string
          nullable: false
          description: "The phone number to dial in E.164 format."
        fromNumberId:
          type: string
          nullable: false
          description: "The ID of the phone number to use for dialing."
        webhookUrl:
          type: string
          nullable: true
          description: "Optional webhook URL for notifications about the dial."
      required: ["toNumber", "fromNumberId"]
    MarkTaskCompleteInput:
      type: object
      properties:
        dialId:
          type: string
          nullable: false
          description: "The ID of the completed dial."
      required: ["dialId"]
    DialTask:
      type: object
      properties:
        id:
          type: string
          nullable: false
        status:
          type: string
          enum: ["PENDING", "RUNNING", "COMPLETED"]
          nullable: false
        inputData:
          type: object
          additionalProperties: {}
          nullable: false
        keyInputs:
          type: array
          items:
            type: string
          nullable: false
        results:
          type: object
          additionalProperties: {}
          nullable: true
        createdAt:
          type: string
          format: date-time
          nullable: false
        completedDial:
          $ref: '#/components/schemas/Dial'
          nullable: true
      required: ["id", "status", "inputData", "keyInputs", "createdAt"]
    CreateCallAgentExtractorInput:
      type: object
      properties:
        name:
          type: string
          nullable: false
        extractorFieldsJsonSchema:
          type: string
          nullable: false
      required: ["name", "extractorFieldsJsonSchema"]
    CallAgentExtractor:
      type: object
      properties:
        id:
          type: string
          nullable: false
        name:
          type: string
          nullable: false
        extractorFieldsJsonSchema:
          type: string
          nullable: false
      required: ["id", "name", "extractorFieldsJsonSchema"]
    UpdateCallAgentExtractorInput:
      type: object
      properties:
        name:
          type: string
        extractorFieldsJsonSchema:
          type: string
    TranscriberParams:
      type: object
      properties:
        type:
          type: string
          nullable: false
          description: "By default, the only supported option is deepgram. Please contact support if you'd like access to more options."
        keywords:
          type: array
          items:
            type: string
          description: "Keywords to be used for transcription."
          x-go-type-skip-optional-pointer: true
          nullable: false
      required: ["type"]

    UtteranceDetectorSensitivity:
      type: string
      enum: ["ULTRA_FAST", "FAST", "MEDIUM", "SLOW"]
      nullable: false

    UtteranceDetectorConfig:
      type: object
      properties:
        sensitivity:
          $ref: '#/components/schemas/UtteranceDetectorSensitivity'
        interruptionPlayTimeMs:
          type: integer
          description: "The minimum amount of time in milliseconds that the agent will continue speaking after being interrupted. Defaults to 0."
          nullable: true
      required: ["sensitivity"]

    EndpointDetectorType:
      type: string
      enum: ["SIMPLE", "SEMANTIC"]
      nullable: false

    EndpointDetectorMode:
      type: string
      enum: ["CONSERVATIVE", "DEFAULT", "AGGRESSIVE"]
      nullable: false

    EndpointDetectorConfig:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/EndpointDetectorType'
          nullable: false
          description: "The type of endpoint detector to use."
        mode:
          $ref: '#/components/schemas/EndpointDetectorMode'
          nullable: true
          description: "The mode for the endpoint detector (only applicable for SEMANTIC type)."
      required: ["type"]

    SilenceHangupType:
      type: string
      enum: ["DISABLED", "FIRST_MESSAGE_ONLY", "WHOLE_CALL"]
      nullable: false
      description: "The type of silence hangup behavior. DISABLED means no silence hangup, FIRST_MESSAGE_ONLY means only hangup if no first message is received, WHOLE_CALL means hangup after silence at any point in the call."

    VoicemailDetection:
      type: string
      enum: ["DISABLE", "HANGUP", "LEAVE_VOICEMAIL"]
      nullable: false
      description: "How the agent reacts to an answering machine. DISABLE disables voicemail detection, HANGUP ends the call on detection, LEAVE_VOICEMAIL waits for the beep and speaks the configured message before hanging up."

    VoicemailConfig:
      type: object
      nullable: true
      properties:
        detection:
          $ref: '#/components/schemas/VoicemailDetection'
          nullable: false
          description: "The voicemail detection behavior."
        message:
          type: string
          nullable: true
          description: "The text to speak via TTS when leaving a voicemail. Required when detection is LEAVE_VOICEMAIL."
      required: ["detection"]

    SilenceHangupConfiguration:
      type: object
      nullable: true
      properties:
        type:
          $ref: '#/components/schemas/SilenceHangupType'
          nullable: false
          description: "The type of silence hangup behavior."
        silenceDurationSeconds:
          type: integer
          description: "The duration of silence in seconds before hanging up."
      required: ["type"]

    TimeoutBehavior:
      type: string
      enum: ["HANGUP", "TRANSFER"]
      nullable: false
      description: "The behavior when a call reaches its max duration timeout. HANGUP disconnects the call, TRANSFER forwards to a specified number."

    TimeoutBehaviorConfiguration:
      type: object
      nullable: true
      properties:
        behavior:
          $ref: '#/components/schemas/TimeoutBehavior'
          nullable: false
          description: "The timeout behavior to use."
        transferNumber:
          type: string
          nullable: true
          description: "The phone number to transfer to when behavior is TRANSFER."
      required: ["behavior"]

    SystemResultType:
      type: string
      enum:
        - BUSY
        - FAILED
        - NO_ANSWER
        - CANCELLED
        - USER_HANGUP
        - COUNTERPARTY_HANGUP
        - TIMEOUT
        - RATE_LIMITED
        - TRANSFERRED
        - AGENT_HANGUP
        - VOICEMAIL_DETECTED_HANGUP
        - LONG_SILENCE_HANGUP
      description: "The type of system result for a dial."
      nullable: false

    BatchDialJobStatus:
      type: string
      enum: ["INIT", "ACTIVE", "PAUSED", "COMPLETE", "CANCELLED"]

    ScheduleTimeSlot:
      type: object
      properties:
        startTime:
          type: string
        endTime:
          type: string
      required: ["startTime", "endTime"]

    DaySchedule:
      type: object
      properties:
        dayOfWeek:
          type: integer
        timeSlots:
          type: array
          items:
            $ref: '#/components/schemas/ScheduleTimeSlot'
      required: ["dayOfWeek", "timeSlots"]

    WeeklySchedule:
      type: object
      properties:
        days:
          type: array
          items:
            $ref: '#/components/schemas/DaySchedule'
          x-go-type-skip-optional-pointer: true
        timezone:
          type: string
      required: ["days", "timezone"]

    ScheduleTimeSlotInput:
      type: object
      properties:
        startTime:
          type: string
        endTime:
          type: string
      required: ["startTime", "endTime"]

    DayScheduleInput:
      type: object
      properties:
        dayOfWeek:
          type: integer
        timeSlots:
          type: array
          items:
            $ref: '#/components/schemas/ScheduleTimeSlotInput'
          x-go-type-skip-optional-pointer: true
      required: ["dayOfWeek", "timeSlots"]

    WeeklyScheduleInput:
      type: object
      properties:
        days:
          type: array
          items:
            $ref: '#/components/schemas/DayScheduleInput'
          x-go-type-skip-optional-pointer: true
        timezone:
          type: string
        disableSchedule:
          type: boolean
      required: ["days", "timezone"]

    BatchDialJob:
      type: object
      properties:
        id:
          type: string
        maxConcurrentDials:
          type: integer
        name:
          type: string
        status:
          $ref: '#/components/schemas/BatchDialJobStatus'
        fromPhoneNumberIds:
          type: array
          items:
            type: string
          x-go-type-skip-optional-pointer: true
        schedule:
          $ref: '#/components/schemas/WeeklySchedule'
          nullable: true
        callAgentId:
          type: string
        createdAt:
          type: string
          format: date-time
      required: ["id", "maxConcurrentDials", "name", "status", "callAgentId", "createdAt"]

    BatchDialJobsResult:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/BatchDialJob'
        cursor:
          type: string
          nullable: true
      required: ["data", "cursor"]

    BatchDialSpec:
      type: object
      properties:
        id:
          type: string
        inputs:
          type: object
          additionalProperties: {}
          x-go-type-skip-optional-pointer: true
        toNumber:
          type: string
        batchDialJobId:
          type: string
        createdAt:
          type: string
          format: date-time
      required: ["id", "toNumber", "batchDialJobId", "createdAt"]

    ListBatchDialSpecsResult:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/BatchDialSpec'
        cursor:
          type: string
          nullable: true
      required: ["data", "cursor"]

    ListBatchDialJobDialsResult:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Dial'
        cursor:
          type: string
          nullable: true
      required: ["data", "cursor"]

    BatchDialSpecInput:
      type: object
      properties:
        toNumber:
          type: string
        inputs:
          type: object
          additionalProperties: {}
          description: "Must be a string => string map."
          x-go-type-skip-optional-pointer: true
      required: ["toNumber"]

    CreateBatchDialJobInput:
      type: object
      properties:
        callAgentId:
          type: string
        maxConcurrentDials:
          type: integer
        name:
          type: string
        fromPhoneNumberIds:
          type: array
          items:
            type: string
          x-go-type-skip-optional-pointer: true
        schedule:
          $ref: '#/components/schemas/WeeklyScheduleInput'
          nullable: true
        rows:
          type: array
          items:
            $ref: '#/components/schemas/BatchDialSpecInput'
      required: ["callAgentId", "maxConcurrentDials", "name", "rows"]

    UpdateBatchDialJobInput:
      type: object
      properties:
        maxConcurrentDials:
          type: integer
        fromPhoneNumberIds:
          type: array
          items:
            type: string
          x-go-type-skip-optional-pointer: true
        schedule:
          $ref: '#/components/schemas/WeeklyScheduleInput'
          nullable: true

    SetBatchDialJobPausedInput:
      type: object
      properties:
        paused:
          type: boolean
      required: ["paused"]

    CreatePhoneNumberType:
      type: string
      enum: ["purchase", "sip_import", "vogent_sip"]
      description: "The type of phone number creation operation."
      nullable: false

    CreatePhoneNumberPurchaseInput:
      type: object
      properties:
        number:
          type: string
          description: "The number as returned by the phone number search endpoint."
          nullable: false
      required: ["number"]

    CreatePhoneNumberSIPImportInput:
      type: object
      properties:
        phoneNumber:
          type: string
          description: "The phone number in E.164 format."
          nullable: false
        terminationUri:
          type: string
          description: "The termination URI for the SIP trunk."
          nullable: false
        username:
          type: string
          description: "The username for SIP authentication."
          nullable: false
        password:
          type: string
          description: "The password for SIP authentication."
          nullable: false
      required: ["phoneNumber", "terminationUri", "username", "password"]

    CreatePhoneNumberVogentSIPInput:
      type: object
      properties:
        sipPrefix:
          type: string
          description: "The SIP prefix/username."
          nullable: false
        username:
          type: string
          description: "The username for SIP authentication (minimum 5 characters)."
          nullable: false
        password:
          type: string
          description: "The password for SIP authentication (minimum 5 characters)."
          nullable: false
      required: ["sipPrefix", "username", "password"]

    CreatePhoneNumberInput:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/CreatePhoneNumberType'
          description: "The type of phone number creation operation."
        purchase:
          $ref: '#/components/schemas/CreatePhoneNumberPurchaseInput'
          description: "Required when type is 'purchase'."
          nullable: true
        sipImport:
          $ref: '#/components/schemas/CreatePhoneNumberSIPImportInput'
          description: "Required when type is 'sip_import'."
          nullable: true
        vogentSip:
          $ref: '#/components/schemas/CreatePhoneNumberVogentSIPInput'
          description: "Required when type is 'vogent_sip'."
          nullable: true
      required: ["type"]

    PhoneNumberPoolPhoneNumber:
      type: object
      properties:
        id:
          type: string
        number:
          type: string
      required: ["id", "number"]

    PhoneNumberPool:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        phoneNumbers:
          type: array
          items:
            $ref: '#/components/schemas/PhoneNumberPoolPhoneNumber'
      required: ["id", "name", "phoneNumbers"]

    CreatePhoneNumberPoolInput:
      type: object
      properties:
        workspaceId:
          type: string
        name:
          type: string
        phoneNumberIds:
          type: array
          items:
            type: string
          x-go-type-skip-optional-pointer: true
      required: ["workspaceId", "name", "phoneNumberIds"]

    UpdatePhoneNumberPoolInput:
      type: object
      properties:
        id:
          type: string
        workspaceId:
          type: string
        name:
          type: string
        phoneNumberIds:
          type: array
          items:
            type: string
          x-go-type-skip-optional-pointer: true
      required: ["id"]

    AIEvalRecordType:
      type: string
      enum: ["DIAL", "PROMPT"]
      description: "The type of evaluation record."
      nullable: false

    AIEvalRunStatus:
      type: string
      enum: ["PENDING", "RUNNING", "SUCCESS", "FAILED", "CANCELLED"]
      description: "The status of an evaluation run."
      nullable: false

    AIEvalConfig:
      type: object
      properties:
        id:
          type: string
          nullable: false
        name:
          type: string
          nullable: false
        promptSnippet:
          type: string
          nullable: false
      required: ["id", "name", "promptSnippet"]

    CreateAIEvalConfigInput:
      type: object
      properties:
        name:
          type: string
          nullable: false
          description: "The name of the evaluation configuration."
        promptSnippet:
          type: string
          description: "An optional prompt snippet for the evaluation configuration."
      required: ["name"]

    UpdateAIEvalConfigInput:
      type: object
      properties:
        promptSnippet:
          type: string
          description: "The prompt snippet for the evaluation configuration."

    AIEvalPrompt:
      type: object
      properties:
        id:
          type: string
          nullable: false
        name:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        systemPrompt:
          type: string
          nullable: false
        maxTurns:
          type: integer
          nullable: false
        agentInputs:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
          nullable: false
      required: ["id", "systemPrompt", "maxTurns", "createdAt"]

    AIEvalRecord:
      type: object
      properties:
        id:
          type: string
          nullable: false
        recordType:
          $ref: '#/components/schemas/AIEvalRecordType'
        dialId:
          type: string
          nullable: true
        prompt:
          $ref: '#/components/schemas/AIEvalPrompt'
          nullable: true
      required: ["id", "recordType"]

    CreateAIEvalRecordInput:
      type: object
      description: "Create either a dial-based record (provide dialId) or a prompt-based record (provide prompt fields)."
      properties:
        recordType:
          $ref: '#/components/schemas/AIEvalRecordType'
          description: "The type of record to create: DIAL or PROMPT."
        dialId:
          type: string
          description: "The ID of an existing dial to link (required for DIAL type)."
        name:
          type: string
          description: "The name of the prompt (for PROMPT type)."
        description:
          type: string
          description: "The description of the prompt (for PROMPT type)."
        systemPrompt:
          type: string
          description: "The system prompt (required for PROMPT type)."
        maxTurns:
          type: integer
          description: "The maximum number of conversation turns (for PROMPT type, defaults to 20)."
        agentInputs:
          type: string
          description: "JSON object of key-value pairs injected as agent variables (for PROMPT type)."
      required: ["recordType"]

    UpdateAIEvalRecordInput:
      type: object
      properties:
        name:
          type: string
          description: "The name of the prompt."
        description:
          type: string
          description: "The description of the prompt."
        systemPrompt:
          type: string
          description: "The system prompt."
        maxTurns:
          type: integer
          description: "The maximum number of conversation turns."
        agentInputs:
          type: string
          description: "JSON object of key-value pairs injected as agent variables."

    RunEvalInput:
      type: object
      properties:
        versionedPromptId:
          type: string
          nullable: false
          description: "The ID of the versioned prompt to use for this eval run."
        callAgentId:
          type: string
          nullable: false
          description: "The ID of the call agent to evaluate."
        evalRecordIds:
          type: array
          items:
            type: string
          x-go-type-skip-optional-pointer: true
          description: "Optional list of specific eval record IDs to run. If omitted, all records in the config are evaluated."
      required: ["versionedPromptId", "callAgentId"]

    AIEvalAggregateResult:
      type: object
      properties:
        numFailing:
          type: integer
          nullable: false
        numPassing:
          type: integer
          nullable: false
      required: ["numFailing", "numPassing"]

    AIEvalRun:
      type: object
      properties:
        id:
          type: string
          nullable: false
        status:
          $ref: '#/components/schemas/AIEvalRunStatus'
        callAgentId:
          type: string
          nullable: false
        versionedPromptId:
          type: string
          nullable: false
        createdAt:
          type: string
          format: date-time
          nullable: false
        aggregateResult:
          $ref: '#/components/schemas/AIEvalAggregateResult'
      required: ["id", "status", "callAgentId", "versionedPromptId", "createdAt", "aggregateResult"]

    AIEvalRerunResult:
      type: object
      properties:
        numAlerts:
          type: integer
          nullable: false
        results:
          type: array
          items:
            $ref: '#/components/schemas/AIEvalResultLine'
          x-go-type-skip-optional-pointer: true
      required: ["numAlerts", "results"]

    AIEvalResultLine:
      type: object
      properties:
        index:
          type: integer
          nullable: false
        accurate:
          type: boolean
          nullable: false
        reason:
          type: string
          nullable: true
        modelOutput:
          type: string
          nullable: false
      required: ["index", "accurate", "modelOutput"]

    AIEvalSimulationMetadata:
      type: object
      properties:
        totalTurns:
          type: integer
          nullable: false
        endReason:
          type: string
          nullable: false
        simulationDurationMs:
          type: integer
          nullable: false
        numInputTokens:
          type: integer
          nullable: false
        numCachedInputTokens:
          type: integer
          nullable: false
        numOutputTokens:
          type: integer
          nullable: false
      required: ["totalTurns", "endReason", "simulationDurationMs", "numInputTokens", "numCachedInputTokens", "numOutputTokens"]

    AIEvalResult:
      type: object
      properties:
        id:
          type: string
          nullable: false
        evalRunId:
          type: string
          nullable: false
        record:
          $ref: '#/components/schemas/AIEvalRecord'
        numAlerts:
          type: integer
          nullable: false
        results:
          type: array
          items:
            $ref: '#/components/schemas/AIEvalResultLine'
          x-go-type-skip-optional-pointer: true
        transcript:
          type: array
          x-go-type-skip-optional-pointer: true
          items:
            $ref: '#/components/schemas/CallTranscriptEntry'
        simulationMetadata:
          $ref: '#/components/schemas/AIEvalSimulationMetadata'
          nullable: true
        createdAt:
          type: string
          format: date-time
          nullable: false
      required: ["id", "evalRunId", "record", "numAlerts", "results", "transcript", "createdAt"]

    DeleteEvalRecordOutput:
      type: object
      properties:
        id:
          type: string
          nullable: false
      required: ["id"]

  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: "In the form `Bearer <api_key_here>`. You can find your api key in your dashboard."
