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

languageobject

Language configuration. See CreateAgentRequest for full shape.

synthesizerobject

Synthesizer (TTS) configuration. See CreateAgentRequest for full shape.

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

LLM model for this draft

transcriberTypestring

STT engine to use for this draft

customLLMWebSocketUrlstring

Custom LLM WebSocket URL (overrides slmModel)

widgetConfigobject

Widget configuration for chat-mode agents

defaultVariablesobject

Default prompt variables

preCallAPIobject

Pre-call API configuration. See CreateAgentRequest for full shape.

globalPromptstring

Global prompt for workflow_graph agents (max 4000 characters)

globalKnowledgeBaseIdstring

Knowledge base ID to attach to this draft

firstMessagestring

Opening message for this draft

allowInterruptionsboolean
waitForUserToSpeakFirstboolean
muteUserUntilFirstBotResponseboolean
interruptionBackoffTimernumber
backgroundSound'' | 'office' | 'cafe' | 'call_center' | 'static'
smartTurnConfigobject
voiceDetectionConfigobject
voiceMailDetectionConfigobject
denoisingConfigobject
redactionConfigobject
pronunciationDictsobject[]
llmIdleTimeoutConfigobject
sessionTimeoutConfigobject
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.

timezoneobject
callDispositionConfigstring
enableStyleGuideboolean
speechFormattingboolean

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