Agent Versioning - Drafts
Post-Call Analytics

Edit draft config (prompt, tools, post-call metrics, voice, etc.)

Update the configuration of a draft. This single endpoint is how every agent-level config field is changed: prompt, tools, voice, language, post-call analytics (disposition metrics), and more. There is no standalone post-call-analytics endpoint — it lives here as the postCallAnalyticsConfig body field.

Post-Call Analytics

Pass a postCallAnalyticsConfig object to configure disposition metrics (STRING, BOOLEAN, INTEGER, ENUM, DATETIME) that are automatically extracted from each completed call, along with the useInternalAnalyticsModel and useReasoningModel flags. See the Post-Call Metrics guide for a full Python walkthrough and disposition metric schema reference.

Full payload

Accepts the full agent-shaped config payload (language, synthesizer, slmModel, defaultVariables, preCallAPI, etc.) plus two draft-specific fields:

  • singlePromptConfig — prompt and tools (end_call, transfer_call, api_call, extract_dynamic_variables, knowledge_base_search).
  • postCallAnalyticsConfig — disposition metrics + analytics/ reasoning model flags.

Each PATCH increments the draft's revision counter. Config is not live until the draft is published and activated (see /drafts/{draftId}/publish and /versions/{versionId}/activate).

patch/agent/{id}/drafts/{draftId}/config

Path parameters

idstring required
Example:60d0fe4f5311236168a109ca

The agent ID

draftIdstring required

The draft ID

Request body

namestring required
descriptionstring
backgroundSound'' | 'office' | 'cafe' | 'call_center' | 'static'

Ambient background sound during calls. Options: '' (none), 'office', 'cafe', 'call_center', 'static'. Note: this value is currently overridden by the server default on creation; update via PATCH after creation.

globalKnowledgeBaseIdstring

The global knowledge base ID of the agent. You can create a global knowledge base by using the /knowledgebase endpoint and assign it to the agent. The agent will use this knowledge base for its responses.

slmModel'electron' | 'electron-kogta' | 'electron-kogta-v2' | 'gpt-4o' | 'gpt-4.1' | 'gpt-5.2' | 'gpt-realtime' | 'gpt-realtime-mini'

The LLM model to use for the agent. Note: gpt-5.2, electron-kogta, and electron-kogta-v2 require org-level access and return 403 if not enabled. workflowType must be single_prompt to use gpt-realtime or gpt-realtime-mini.

defaultVariablesobject

The default variables to use for the agent. These variables will be used if no variables are provided when initiating a conversation with the agent.

globalPromptstring

Set global instructions for your agent's personality, role, and behavior throughout conversations. Note: Only used for workflow_graph agents. Maximum 4000 characters.

telephonyProductIdstring[]

IDs of telephony products (phone numbers) to associate with the agent for inbound/outbound calls.

workflowType'workflow_graph' | 'single_prompt'

The type of workflow configuration. workflow_graph uses a node-based visual workflow, single_prompt uses a simple prompt-based configuration.

firstMessagestring

The first message the agent sends when a conversation starts.

muteUserUntilFirstBotResponseboolean

When true, the user's audio is muted until the agent has finished its first response.

allowInterruptionsboolean

Whether the user can interrupt the agent while it is speaking.

waitForUserToSpeakFirstboolean

When true, the agent waits for the user to speak before sending the first message.

interruptionBackoffTimernumber

Seconds the agent waits after being interrupted before resuming speech.

callDispositionConfigstring

Configuration string for call disposition tracking.

allowInboundCallboolean

Whether the agent accepts inbound calls.

enableStyleGuideboolean

Whether style guide enforcement is applied to agent responses.

speechFormattingboolean

Whether speech formatting is applied to the agent's responses.

Example request

{
  "singlePromptConfig": {
    "prompt": "You are a helpful AI assistant that can help users with various tasks.",
    "tools": [
      {
        "name": "end_call",
        "description": "End the conversation when the user is satisfied",
        "transferNumber": "+1234567890",
        "url": "https://api.example.com/orders",
        "method": "GET",
        "headers": {
          "Authorization": "Bearer TOKEN",
          "Content-Type": "application/json"
        },
        "headersArray": [
          {
            "key": "Authorization",
            "value": "Bearer TOKEN"
          }
        ],
        "queryParams": [
          {
            "key": "id",
            "value": "{{order_id}}"
          }
        ],
        "requestBody": "{\"customer_id\": \"{{customer_id}}\"}",
        "responseVariables": [
          {
            "variableName": "orderStatus",
            "jsonPath": "$.data.status"
          }
        ],
        "variablesExtractionSchema": [
          {
            "name": "customer_name",
            "description": "The customer's full name",
            "values": [
              "satisfied",
              "unsatisfied",
              "neutral"
            ]
          }
        ],
        "knowledgeBaseId": "60d0fe4f5311236168a109ca",
        "fillerPhrases": [
          "Let me check that for you",
          "One moment please"
        ]
      }
    ]
  },
  "postCallAnalyticsConfig": {
    "dispositionMetrics": [
      {
        "identifier": "call_resolved",
        "dispositionMetricPrompt": "Was the customer issue resolved by the end of the call?",
        "dispositionMetricType": "STRING",
        "choices": [
          "resolved",
          "escalated",
          "callback_scheduled",
          "no_action"
        ]
      }
    ]
  }
}

Response

Draft config updated successfully

statusboolean

Example response

{
  "status": true
}

Changes