---
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"]
deprecated: true
---

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

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

> **Deprecated.**

**Deprecated on the v2 branch model.** Migrate to `PUT /agent/{id}/branches/{branchId}/draft`. When `ENABLE_BRANCH_MODEL` is on, this endpoint returns `409 versioning_v2_migration_required` with the `Deprecation: true` header. See the [migration guide](/voice-agents/deprecations/agent-versioning-migration).

|
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`. All fields are optional — only the fields provided are updated. A subset of config fields from `CreateAgentRequest` is accepted, plus two versioning-era fields. **Fields NOT accepted here** (use `PATCH /agent/{id}` instead): - `name` — agent metadata, not a config field; sending it alone returns 400 "No recognized config fields" - `telephonyProductId` — agent metadata, not a config field
  - `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.
  - `language` object — Language configuration. See CreateAgentRequest for full shape.
  - `synthesizer` object — 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
  - `transcriberType` string — STT engine to use for this draft
  - `customLLMWebSocketUrl` string — Custom LLM WebSocket URL (overrides slmModel)
  - `widgetConfig` object — Widget configuration for chat-mode agents
  - `defaultVariables` object — Default prompt variables
  - `preCallAPI` object — Pre-call API configuration. See CreateAgentRequest for full shape.
  - `globalPrompt` string — Global prompt for workflow_graph agents (max 4000 characters)
  - `globalKnowledgeBaseId` string — Knowledge base ID to attach to this draft
  - `firstMessage` string — Opening message for this draft
  - `allowInterruptions` boolean
  - `waitForUserToSpeakFirst` boolean
  - `muteUserUntilFirstBotResponse` boolean
  - `interruptionBackoffTimer` number
  - `backgroundSound` '' | 'office' | 'cafe' | 'call_center' | 'static'
  - `smartTurnConfig` object
  - `voiceDetectionConfig` object
  - `voiceMailDetectionConfig` object
  - `denoisingConfig` object
  - `redactionConfig` object
  - `pronunciationDicts` object[]
  - `llmIdleTimeoutConfig` object
  - `sessionTimeoutConfig` object
  - `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.
  - `timezone` object
  - `callDispositionConfig` string
  - `enableStyleGuide` boolean
  - `speechFormatting` boolean

## 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
    - `publishedAt` string, date-time, nullable — When this version was published
    - `activatedBy` string, nullable — User ID of who activated this version
    - `activatedAt` string, date-time, nullable — When this version was activated
    - `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
- `403` — Forbidden access
- `404` — Agent or draft not found
- `409` — The v1 versioning endpoint is deprecated on the branch model and will not process this request. The response body carries `error_type: "versioning_v2_migration_required"` and the response includes the `Deprecation: true` header. See the [migration guide](/voice-agents/deprecations/agent-versioning-migration) for the v2 equivalent.
- `500` — Internal server error

---

[API](https://skmtc.net/smallest-inc/apis/agent-management-api.md) · [All operations](https://skmtc.net/smallest-inc/apis/agent-management-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/smallest-inc/agent-management-api/versions/6d1036a76fbc/schema)
