---
title: "Edit draft config (prompt, tools, post-call metrics, voice, etc.)"
method: PATCH
path: "/agent/{id}/drafts/{draftId}/config"
tags: ["Agent Versioning - Drafts", "Post-Call Analytics"]
---

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

`PATCH /agent/{id}/drafts/{draftId}/config`

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](/atoms/atoms-platform/features/post-call-metrics) 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`).

## Path parameters

- `id` string, required
- `draftId` string, required

## Request body

- DraftConfigRequest — Config payload for editing a draft via `PATCH /agent/{id}/drafts/{draftId}/config`. Accepts the same shape as the legacy `PATCH /agent/{id}` body plus two versioning-era fields — `singlePromptConfig` (prompt + tools) and `postCallAnalyticsConfig`. All fields are optional; a draft save may update any subset.
  - `name` string, required
  - `description` string
  - `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.
  - `language` object — Language configuration for the agent. Cross-field rule: `default` must be one of the values in `supported`. Tamil (`ta`) cannot be combined with other languages in `supported`.
    - `default` 'en' | 'hi' | 'mr' | 'gu' | 'ta' | 'es' | 'north_indic' | 'bn' | 'or' — The default language of the agent. Note: `ta` cannot be combined with other languages in `supported`.
    - `supported` string[] — Languages the agent understands. `default` must be one of these values. Tamil (`ta`) cannot be combined with other languages.
    - `switching` object — Language switching configuration for the agent. If enabled, the agent will be able to switch between languages based on the user's language.
      - `isEnabled` boolean — Whether to enable language switching for the agent
      - `minWordsForDetection` number — Minimum number of words required for language detection
      - `strongSignalThreshold` number — Threshold for strong language signal detection (0.1 to 0.9)
      - `weakSignalThreshold` number — Threshold for weak language signal detection (0.1 to 0.9)
      - `minConsecutiveForWeakThresholdSwitch` number — Minimum consecutive detections required for weak threshold language switch
  - `synthesizer` object — Synthesizer (TTS) configuration for the agent. Models `waves`, `waves_lightning_large`, `waves_lightning_v2`, and `waves_lightning_v3_1` validate `voiceId` against the Waves API. All other models accept any voiceId. Cloned voices are regular voiceIds — use them with any compatible Waves model.
    - `voiceConfig` object — Voice configuration for the synthesizer.
      - `model` 'waves' | 'waves_lightning_large' | 'waves_lightning_v2' | 'waves_lightning_v3_1' | 'waves_lightning_v3' | 'waves_lightning_v2_http' | 'gpt-realtime' | 'gpt-realtime-mini' — The TTS model to use.
      - `voiceId` string — The voice ID to use. For cloned voices, pass the voiceId from the Waves platform with a compatible model.
      - `gender` 'male' | 'female' — The gender of the voice.
    - `speed` number
    - `consistency` number
    - `similarity` number
    - `enhancement` 0 | 1 | 2
    - `sampleRate` 8000 | 16000 | 24000 | 44100 — Output audio sample rate in Hz.
  - `globalKnowledgeBaseId` string — 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`.
  - `defaultVariables` object — 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.
  - `preCallAPI` object — Configuration for an API call to be made before the call starts. The response variables can be injected into the agent's prompt.
    - `isEnabled` boolean — Whether the pre-call API is enabled.
    - `url` string, uri, required — The URL of the API endpoint to call.
    - `method` 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH', required — The HTTP method to use for the API call.
    - `headers` object — Optional HTTP headers to include in the request.
    - `body` object — Optional request body for POST/PUT/PATCH requests.
    - `timeout` integer — Timeout in seconds for the API call.
    - `queryParams` object — Optional query parameters to include in the request URL.
    - `responseVariables` object[] — List of variables to extract from the API response using JSON path expressions.
      - `variableName` string, required — The name of the variable to inject into the agent prompt.
      - `jsonPath` string, required — JSON path expression to extract the value from the API response.
  - `globalPrompt` string — Set global instructions for your agent's personality, role, and behavior throughout conversations. Note: Only used for workflow_graph agents. Maximum 4000 characters.
  - `telephonyProductId` string[] — 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.
  - `firstMessage` string — The first message the agent sends when a conversation starts.
  - `muteUserUntilFirstBotResponse` boolean — When true, the user's audio is muted until the agent has finished its first response.
  - `allowInterruptions` boolean — Whether the user can interrupt the agent while it is speaking.
  - `waitForUserToSpeakFirst` boolean — When true, the agent waits for the user to speak before sending the first message.
  - `interruptionBackoffTimer` number — Seconds the agent waits after being interrupted before resuming speech.
  - `smartTurnConfig` object — Smart turn-detection configuration. When enabled, the agent uses an additional model to decide whether the user has finished a turn.
    - `isEnabled` boolean
    - `waitTimeInSecs` number — How long to wait after the user stops speaking before responding.
  - `voiceDetectionConfig` object — Voice activity detection (VAD) configuration. Controls how the agent decides when speech is present.
    - `confidence` number — Minimum VAD confidence threshold to register speech.
    - `minVolume` number — Minimum input volume threshold to register speech.
    - `triggerTimeInSecs` number — How long sustained speech must be detected before turning the VAD on.
    - `releaseTimeInSecs` number — How long after silence before the VAD turns off.
  - `voiceMailDetectionConfig` object — Voicemail-detection configuration. When the call hits a voicemail tone, the agent plays `endText` and ends the call.
    - `enabled` boolean
    - `endText` string — Message played before hanging up when voicemail is detected.
  - `denoisingConfig` object — Background-noise denoising configuration for the agent's input audio.
    - `isEnabled` boolean
  - `redactionConfig` object — PII redaction configuration. When enabled, personally identifiable information is redacted from transcripts before storage.
    - `isEnabled` boolean
  - `pronunciationDicts` object[] — Pronunciation overrides — words the TTS engine should pronounce differently from its default.
    - `word` string, required — The word to override.
    - `pronunciation` string, required — How the word should be pronounced (phonetic spelling).
  - `llmIdleTimeoutConfig` object — Timeout configuration for the LLM stage of a conversation. Triggers a retry or call termination when the LLM does not respond within the configured window.
    - `chatTimeoutTimeInSecs` number — LLM idle timeout for chat conversations, in seconds.
    - `webcallTimeoutTimeInSecs` number — LLM idle timeout for web calls, in seconds.
    - `telephonyTimeoutTimeInSecs` number — LLM idle timeout for telephony calls, in seconds.
    - `maxRetries` number — Maximum number of LLM-idle retries before terminating the call. System-defined min/max.
  - `sessionTimeoutConfig` object — Maximum duration of a conversation session. The call ends after this elapsed time even if active.
    - `timeoutTimeInSecs` number — Maximum session duration in seconds (max 1 hour). Defaults to 1800 (30 minutes).
  - `timezone` object — Timezone applied to scheduled actions and timestamps the agent reports to the user.
    - `label` string — IANA timezone label (e.g. `America/New_York`).
    - `offset` number — UTC offset in minutes (e.g. -300 for EST).
  - `callDispositionConfig` string — Configuration string for call disposition tracking.
  - `allowInboundCall` boolean — Whether the agent accepts inbound calls.
  - `enableStyleGuide` boolean — Whether style guide enforcement is applied to agent responses.
  - `speechFormatting` boolean — Whether speech formatting is applied to the agent's responses.
  - `singlePromptConfig` SinglePromptConfig — Configuration for single prompt workflow type
    - `prompt` string, required — The main prompt that defines the agent's behavior and responses
    - `tools` Tool[] — Array of tools/functions available to the agent during conversations. Five tool types are supported: `end_call`, `transfer_call`, `api_call`, `extract_dynamic_variables`, and `knowledge_base_search`. Each type has its own required fields — see `Tool` schema.
      - `type` 'end_call' | 'transfer_call' | 'api_call' | 'extract_dynamic_variables' | 'knowledge_base_search', required — The type of function/tool
      - `name` string, required — Unique name for the function (no spaces)
      - `description` string, required — Description of what the function does
      - `enabled` boolean — Whether the tool is enabled
      - `transferNumber` string — Required for transfer_call type. Phone number to transfer the call to (E.164 format)
      - `transferOption` object — Required for transfer_call type. Controls cold vs warm transfer behavior.
        - `type` 'cold_transfer' | 'warm_transfer' — Transfer mode. `cold_transfer` hands off immediately; `warm_transfer` briefs the receiving party first.
        - `privateHandoffOption` object, nullable — Private briefing delivered to the transfer target before the caller is connected. Only used when `type = warm_transfer`.
          - `type` 'prompt' | 'static' — `prompt` generates briefing from the LLM; `static` plays fixed text.
          - `prompt` string — The prompt or static text for the private handoff.
        - `publicHandoffOption` object, nullable — Message played to the caller while the transfer is being set up. Only used when `type = warm_transfer`.
          - `type` 'prompt' | 'static'
          - `prompt` string
      - `onHoldMusic` 'ringtone' | 'relaxing_sound' | 'uplifting_beats' | 'none' — Optional for transfer_call type. Audio played to the caller while the transfer is in progress.
      - `transferOnlyIfHuman` boolean — Optional for transfer_call type. If true, the call is only transferred when a human is detected on the receiving end (voicemail/IVR skipped).
      - `detectionTimeout` integer — Optional for transfer_call type. Seconds to wait for human detection before giving up (5–60).
      - `url` string, uri — Required for api_call type. The URL to make the HTTP request to.
      - `method` 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' — Required for api_call type. HTTP method to use.
      - `timeout` integer — Optional for api_call type. Request timeout in milliseconds (1000–30000).
      - `headers` object — Optional for api_call type. Static HTTP headers as a key/value map.
      - `headersArray` object[] — Optional for api_call type. Headers as an array of key/value objects (alternative to `headers` map).
        - `key` string, required
        - `value` string, required
      - `queryParams` object[] — Optional for api_call type. Query parameters to include in the request URL. Values support variable templating like `{{order_id}}`.
        - `key` string, required
        - `value` string, required
      - `requestBody` string — Optional for api_call type. Raw request body as a JSON string. Supports variable templating.
      - `llmParameters` object[] — Optional for api_call type. Parameters the LLM can supply dynamically at runtime.
        - `name` string, required — Parameter name
        - `description` string, required — What the parameter represents
        - `type` 'text' | 'number' | 'boolean' | 'enum', required
        - `values` string[] — Required when type is `enum`. Allowed values.
        - `required` boolean
      - `responseVariables` object[] — Optional for api_call type. Variables to extract from the API response into the agent's variable store.
        - `variableName` string, required — Name to store the extracted value under
        - `jsonPath` string, required — JSON path to extract the value from the response
      - `variablesExtractionSchema` object[] — Required for extract_dynamic_variables type. Schema defining variables to extract from the conversation.
        - `name` string, required — Name of the variable to extract
        - `description` string, required — What this variable represents
        - `type` 'text' | 'number' | 'boolean' | 'enum', required
        - `values` string[] — Required when type is `enum`. List of possible values.
      - `knowledgeBaseId` string — Required for knowledge_base_search type. ID of the knowledge base to search.
      - `fillerPhrases` string[] — Optional for knowledge_base_search type. Phrases spoken while searching.
  - `postCallAnalyticsConfig` PostCallAnalyticsConfig — Per-agent post-call analytics configuration. Evaluated after each call ends and surfaced in call logs under the `postCallAnalytics` field.
    - `dispositionMetrics` DispositionMetric[] — Structured metrics extracted from each completed call.
      - `identifier` string, required — Stable machine identifier. Lowercase letters, digits, and underscores only.
      - `dispositionMetricPrompt` string, required — Natural-language question evaluated against the transcript after the call ends.
      - `dispositionMetricType` 'STRING' | 'BOOLEAN' | 'INTEGER' | 'ENUM' | 'DATETIME', required — Data type returned by the metric.
      - `choices` string[] — Required when `dispositionMetricType = ENUM`. Allowed values.
    - `successMetrics` object[] — **Deprecated** — will be removed in a future version. Use `dispositionMetrics` instead. Kept here because the backend still accepts it on writes and returns it on reads.
      - `identifier` string, required
      - `successMetricPrompt` string, required
      - `successMetricType` 'NUMERIC_SCALE' | 'PERCENTAGE_SCALE' | 'PASS_FAIL' | 'DESCRIPTIVE_SCALE', required
    - `summaryPrompt` string — **Deprecated** — no longer used in post-call analysis and will be removed in a future version. Kept here because the backend still accepts it on writes and returns it on reads.
    - `useInternalAnalyticsModel` boolean — Use the internal analytics model. When false, falls back to the agent's own LLM.
    - `useReasoningModel` boolean — Route analytics evaluation through the reasoning model for higher-quality results at a latency/cost tradeoff.

## Response `200`

Draft config updated successfully

- object
  - `status` boolean
  - `data` AgentVersion — Represents either a draft revision or a published version of an agent's configuration.
    - `_id` string — Unique identifier
    - `agent` string — The agent this version belongs to
    - `status` 'published' | 'draft' | 'archived' — Current status of the version record
    - `versionNumber` integer, nullable — Auto-incremented version number (published versions only)
    - `label` string, nullable — Human-readable label for the version
    - `description` string, nullable — Description of what changed in this version
    - `isPinned` boolean — Whether the version is pinned for quick access
    - `publishedBy` string, nullable — User ID of who published this version
    - `draftId` string, nullable — Unique draft identifier (drafts only)
    - `draftName` string, nullable — Human-readable draft name
    - `draftRevision` integer, nullable — Revision number within the draft (drafts only)
    - `sourceVersionId` string, nullable — The published version this draft was branched from
    - `blocks` object — References to the 13 config section blocks
      - `workflow_prompt` string
      - `workflow_tools` string
      - `workflow_graph` string
      - `llm` string
      - `voice` string
      - `language` string
      - `call_handling` string
      - `detection` string
      - `analytics` string
      - `timeouts` string
      - `audio` string
      - `privacy` string
      - `widget` string
    - `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.
    - `parentVersion` string, nullable — The version this was derived from
    - `isActive` boolean — Whether this is the currently active version for the agent
    - `createdBy` string — User ID of who created this record
    - `createdAt` string, date-time
    - `updatedAt` string, date-time

## Other responses

- `400` — Invalid input
- `401` — Unauthorized access
- `500` — Internal server error

## Changes

- **2026-05-26** `7131fe74f3cb` — 3 breaking, 4 warning, 16 info
  - removed `subschema #1, subschema #2` from the `allOf[#/components/schemas/CreateAgentRequest]/synthesizer/voiceConfig` request property `oneOf` list
  - the `allOf[#/components/schemas/CreateAgentRequest]/synthesizer/voiceConfig` request property type/format changed from ``/`` to `object`/``
  - the `allOf[#/components/schemas/CreateAgentRequest]/telephonyProductId` request property type/format changed from `string`/`` to `array`/``
  - the `allOf[#/components/schemas/CreateAgentRequest]/globalPrompt` request property's maxLength was set to `4000`
  - …19 more
- **2026-05-06** `98bb2336fc95` — 15 info
  - added the new optional request property `allOf[#/components/schemas/CreateAgentRequest]/allowInterruptions`
  - added the new optional request property `allOf[#/components/schemas/CreateAgentRequest]/denoisingConfig`
  - added the new optional request property `allOf[#/components/schemas/CreateAgentRequest]/firstMessage`
  - added the new optional request property `allOf[#/components/schemas/CreateAgentRequest]/interruptionBackoffTimer`
  - …11 more
- …earlier changes not shown

[Full history](https://skmtc.dev/smallest-inc/apis/agent-management-api/changes/agent/:id/drafts/:draftId/config/patch.md)

---

[API](https://skmtc.dev/smallest-inc/apis/agent-management-api.md) · [All operations](https://skmtc.dev/smallest-inc/apis/agent-management-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/smallest-inc/agent-management-api/revisions/2bfbd089ccb3/schema)
