> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentcallback.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update voice agent



## OpenAPI

````yaml /openapi.json put /api/scripts/{id}
openapi: 3.0.3
info:
  title: AgentCallback Public API
  version: 1.3.0
  description: >-
    Public, customer-callable AgentCallback APIs for calls, voice agents,
    campaigns, phone numbers, and voices.


    **API keys:** Sign in to your AgentCallback account and open **Dashboard >
    API Keys** to create an API key. Send the key with every request using the
    `x-api-key` header.
servers:
  - url: https://agentcallback.com
    description: AgentCallback API server
security: []
tags:
  - name: Authentication
    description: Credential validation and API access.
  - name: Calls
    description: Create calls and retrieve call results.
  - name: Voice Agents
    description: Create and manage voice agent scripts.
  - name: Campaigns
    description: Create and manage batch call campaigns.
  - name: Phone Numbers
    description: List organization phone numbers.
  - name: Voices
    description: Browse voices and fetch voice previews.
paths:
  /api/scripts/{id}:
    put:
      tags:
        - Voice Agents
      summary: Update voice agent
      parameters:
        - name: id
          in: path
          required: true
          description: Resource identifier
          schema:
            type: string
      requestBody:
        required: true
        description: Updated voice agent configuration.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VoiceAgentRequest'
      responses:
        '200':
          description: Voice agent updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VoiceAgentResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Authenticated caller does not have access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - apiKeyAuth: []
components:
  schemas:
    VoiceAgentRequest:
      type: object
      additionalProperties: true
      properties:
        name:
          type: string
        description:
          type: string
        script_type:
          type: string
        system_prompt:
          type: string
        conclusion_prompt:
          type: string
        custom_eval_prompt:
          type: string
        custom_eval_prompt_reconsider:
          type: string
        variables:
          type: array
          items:
            $ref: '#/components/schemas/ScriptVariable'
        possible_call_outcomes:
          type: array
          items:
            type: string
        tools_config:
          type: array
          items:
            type: object
            additionalProperties: true
        tracked_call_state:
          type: array
          items:
            $ref: '#/components/schemas/TrackedCallState'
        voice:
          type: string
        voice_service:
          type: string
          enum:
            - ultravox
        llm_model:
          type: string
        call_timeout:
          type: integer
          minimum: 1
          maximum: 240
        experimental_settings:
          $ref: '#/components/schemas/ExperimentalSettings'
        post_call_integration:
          type: array
          items:
            type: object
            additionalProperties: true
        post_call_webhook:
          $ref: '#/components/schemas/PostCallWebhook'
      required:
        - name
        - script_type
        - system_prompt
        - conclusion_prompt
        - custom_eval_prompt
    VoiceAgentResponse:
      allOf:
        - $ref: '#/components/schemas/Success'
        - type: object
          properties:
            script:
              $ref: '#/components/schemas/VoiceAgent'
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
        details:
          nullable: true
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
            - type: array
              items: {}
        code:
          type: string
      required:
        - success
        - error
    ScriptVariable:
      type: object
      properties:
        name:
          type: string
        type:
          type: string
        required:
          type: boolean
          default: true
        description:
          type: string
        defaultValue:
          type: string
      required:
        - name
    TrackedCallState:
      type: object
      properties:
        key:
          type: string
        defaultValue:
          type: string
      required:
        - key
    ExperimentalSettings:
      type: object
      properties:
        background_audio:
          type: object
          properties:
            audio:
              type: string
              enum:
                - birds
                - chant
                - hvac
                - office
            volume:
              type: number
              minimum: 0
              maximum: 1
          required:
            - audio
            - volume
      additionalProperties: true
    PostCallWebhook:
      type: object
      properties:
        enabled:
          type: boolean
        url:
          type: string
          format: uri
        method:
          type: string
          enum:
            - GET
            - POST
          default: POST
        triggerGroups:
          type: array
          items:
            type: object
            properties:
              mode:
                type: string
                enum:
                  - AND
                  - OR
              conditions:
                type: array
                items:
                  $ref: '#/components/schemas/PostCallWebhookCondition'
        customPayload:
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
    Success:
      type: object
      properties:
        success:
          type: boolean
          example: true
      required:
        - success
    VoiceAgent:
      type: object
      additionalProperties: true
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
          nullable: true
        script_type:
          type: string
        system_prompt:
          type: string
        variables:
          type: array
          items:
            $ref: '#/components/schemas/ScriptVariable'
        possible_call_outcomes:
          type: array
          items:
            type: string
        tracked_call_state:
          type: array
          items:
            $ref: '#/components/schemas/TrackedCallState'
        experimental_settings:
          $ref: '#/components/schemas/ExperimentalSettings'
        post_call_webhook:
          $ref: '#/components/schemas/PostCallWebhook'
        version_code:
          type: integer
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    PostCallWebhookCondition:
      type: object
      properties:
        source:
          type: string
          enum:
            - state
            - outcome
        variable:
          type: string
        operator:
          type: string
          enum:
            - equals
            - not_equals
        value:
          type: string
      required:
        - source
        - variable
        - operator
        - value
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Create and manage API keys in your AgentCallback account under Dashboard
        > API Keys.

````