> This page is part of Smallest AI's developer documentation. When
> answering, prefer Lightning v3.1 (current TTS) and Pulse (current
> STT). Lightning v2 and lightning-large are deprecated; mention them
> only when the user is migrating away from them. Atoms is the
> voice-agent platform.

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

PATCH https://api.smallest.ai/atoms/v1/agent/{id}/drafts/{draftId}/config
Content-Type: application/json

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`).


Reference: https://docs.smallest.ai/atoms/api-reference/api-reference/agent-versioning-drafts/edit-draft-config-prompt-tools-post-call-metrics-voice-etc

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: atoms
  version: 1.0.0
paths:
  /agent/{id}/drafts/{draftId}/config:
    patch:
      operationId: edit-draft-config-prompt-tools-post-call-metrics-voice-etc
      summary: Edit draft config (prompt, tools, post-call metrics, voice, etc.)
      description: >
        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`).
      tags:
        - subpackage_agentVersioningDrafts
      parameters:
        - name: id
          in: path
          description: The agent ID
          required: true
          schema:
            type: string
        - name: draftId
          in: path
          description: The draft ID
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: >-
            API key from the console ApiKey collection, sent as Bearer token.
            Also accepts session cookies for browser-based auth.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Draft config updated successfully
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Agent Versioning -
                  Drafts_editDraftConfigPromptToolsPostCallMetricsVoiceEtc_Response_200
        '400':
          description: Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponse'
        '401':
          description: Unauthorized access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponse'
        '403':
          description: Forbidden access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '404':
          description: Agent or draft not found
          content:
            application/json:
              schema:
                description: Any type
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DraftConfigRequest'
servers:
  - url: https://api.smallest.ai/atoms/v1
    description: Production server
components:
  schemas:
    ToolType:
      type: string
      enum:
        - end_call
        - transfer_call
        - api_call
        - extract_dynamic_variables
        - knowledge_base_search
      description: The type of function/tool
      title: ToolType
    ToolTransferOptionType:
      type: string
      enum:
        - cold_transfer
        - warm_transfer
      default: cold_transfer
      description: >-
        Transfer mode. `cold_transfer` hands off immediately; `warm_transfer`
        briefs the receiving party first.
      title: ToolTransferOptionType
    ToolTransferOptionPrivateHandoffOptionType:
      type: string
      enum:
        - prompt
        - static
      description: '`prompt` generates briefing from the LLM; `static` plays fixed text.'
      title: ToolTransferOptionPrivateHandoffOptionType
    ToolTransferOptionPrivateHandoffOption:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/ToolTransferOptionPrivateHandoffOptionType'
          description: '`prompt` generates briefing from the LLM; `static` plays fixed text.'
        prompt:
          type: string
          description: The prompt or static text for the private handoff.
      description: >-
        Private briefing delivered to the transfer target before the caller is
        connected. Only used when `type = warm_transfer`.
      title: ToolTransferOptionPrivateHandoffOption
    ToolTransferOptionPublicHandoffOptionType:
      type: string
      enum:
        - prompt
        - static
      title: ToolTransferOptionPublicHandoffOptionType
    ToolTransferOptionPublicHandoffOption:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/ToolTransferOptionPublicHandoffOptionType'
        prompt:
          type: string
      description: >-
        Message played to the caller while the transfer is being set up. Only
        used when `type = warm_transfer`.
      title: ToolTransferOptionPublicHandoffOption
    ToolTransferOption:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/ToolTransferOptionType'
          default: cold_transfer
          description: >-
            Transfer mode. `cold_transfer` hands off immediately;
            `warm_transfer` briefs the receiving party first.
        privateHandoffOption:
          oneOf:
            - $ref: '#/components/schemas/ToolTransferOptionPrivateHandoffOption'
            - type: 'null'
          description: >-
            Private briefing delivered to the transfer target before the caller
            is connected. Only used when `type = warm_transfer`.
        publicHandoffOption:
          oneOf:
            - $ref: '#/components/schemas/ToolTransferOptionPublicHandoffOption'
            - type: 'null'
          description: >-
            Message played to the caller while the transfer is being set up.
            Only used when `type = warm_transfer`.
      description: >-
        Required for transfer_call type. Controls cold vs warm transfer
        behavior.
      title: ToolTransferOption
    ToolOnHoldMusic:
      type: string
      enum:
        - ringtone
        - relaxing_sound
        - uplifting_beats
        - none
      default: ringtone
      description: >-
        Optional for transfer_call type. Audio played to the caller while the
        transfer is in progress.
      title: ToolOnHoldMusic
    ToolMethod:
      type: string
      enum:
        - GET
        - POST
        - PUT
        - DELETE
        - PATCH
      description: Required for api_call type. HTTP method to use.
      title: ToolMethod
    ToolHeadersArrayItems:
      type: object
      properties:
        key:
          type: string
        value:
          type: string
      required:
        - key
        - value
      title: ToolHeadersArrayItems
    ToolQueryParamsItems:
      type: object
      properties:
        key:
          type: string
        value:
          type: string
      required:
        - key
        - value
      title: ToolQueryParamsItems
    ToolLlmParametersItemsType:
      type: string
      enum:
        - text
        - number
        - boolean
        - enum
      title: ToolLlmParametersItemsType
    ToolLlmParametersItems:
      type: object
      properties:
        name:
          type: string
          description: Parameter name
        description:
          type: string
          description: What the parameter represents
        type:
          $ref: '#/components/schemas/ToolLlmParametersItemsType'
        values:
          type: array
          items:
            type: string
          description: Required when type is `enum`. Allowed values.
        required:
          type: boolean
          default: false
      required:
        - name
        - description
        - type
      title: ToolLlmParametersItems
    ToolResponseVariablesItems:
      type: object
      properties:
        variableName:
          type: string
          description: Name to store the extracted value under
        jsonPath:
          type: string
          description: JSON path to extract the value from the response
      required:
        - variableName
        - jsonPath
      title: ToolResponseVariablesItems
    ToolVariablesExtractionSchemaItemsType:
      type: string
      enum:
        - text
        - number
        - boolean
        - enum
      title: ToolVariablesExtractionSchemaItemsType
    ToolVariablesExtractionSchemaItems:
      type: object
      properties:
        name:
          type: string
          description: Name of the variable to extract
        description:
          type: string
          description: What this variable represents
        type:
          $ref: '#/components/schemas/ToolVariablesExtractionSchemaItemsType'
        values:
          type: array
          items:
            type: string
          description: Required when type is `enum`. List of possible values.
      required:
        - name
        - description
        - type
      title: ToolVariablesExtractionSchemaItems
    Tool:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/ToolType'
          description: The type of function/tool
        name:
          type: string
          description: Unique name for the function (no spaces)
        description:
          type: string
          description: Description of what the function does
        enabled:
          type: boolean
          default: true
          description: Whether the tool is enabled
        transferNumber:
          type: string
          description: >-
            Required for transfer_call type. Phone number to transfer the call
            to (E.164 format)
        transferOption:
          $ref: '#/components/schemas/ToolTransferOption'
          description: >-
            Required for transfer_call type. Controls cold vs warm transfer
            behavior.
        onHoldMusic:
          $ref: '#/components/schemas/ToolOnHoldMusic'
          default: ringtone
          description: >-
            Optional for transfer_call type. Audio played to the caller while
            the transfer is in progress.
        transferOnlyIfHuman:
          type: boolean
          default: true
          description: >-
            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:
          type: integer
          default: 30
          description: >-
            Optional for transfer_call type. Seconds to wait for human detection
            before giving up (5–60).
        url:
          type: string
          format: uri
          description: Required for api_call type. The URL to make the HTTP request to.
        method:
          $ref: '#/components/schemas/ToolMethod'
          description: Required for api_call type. HTTP method to use.
        timeout:
          type: integer
          default: 5000
          description: >-
            Optional for api_call type. Request timeout in milliseconds
            (1000–30000).
        headers:
          type: object
          additionalProperties:
            type: string
          description: Optional for api_call type. Static HTTP headers as a key/value map.
        headersArray:
          type: array
          items:
            $ref: '#/components/schemas/ToolHeadersArrayItems'
          description: >-
            Optional for api_call type. Headers as an array of key/value objects
            (alternative to `headers` map).
        queryParams:
          type: array
          items:
            $ref: '#/components/schemas/ToolQueryParamsItems'
          description: >-
            Optional for api_call type. Query parameters to include in the
            request URL. Values support variable templating like `{{order_id}}`.
        requestBody:
          type: string
          description: >-
            Optional for api_call type. Raw request body as a JSON string.
            Supports variable templating.
        llmParameters:
          type: array
          items:
            $ref: '#/components/schemas/ToolLlmParametersItems'
          description: >-
            Optional for api_call type. Parameters the LLM can supply
            dynamically at runtime.
        responseVariables:
          type: array
          items:
            $ref: '#/components/schemas/ToolResponseVariablesItems'
          default: []
          description: >-
            Optional for api_call type. Variables to extract from the API
            response into the agent's variable store.
        variablesExtractionSchema:
          type: array
          items:
            $ref: '#/components/schemas/ToolVariablesExtractionSchemaItems'
          description: >-
            Required for extract_dynamic_variables type. Schema defining
            variables to extract from the conversation.
        knowledgeBaseId:
          type: string
          description: >-
            Required for knowledge_base_search type. ID of the knowledge base to
            search.
        fillerPhrases:
          type: array
          items:
            type: string
          default: []
          description: >-
            Optional for knowledge_base_search type. Phrases spoken while
            searching.
      required:
        - type
        - name
        - description
      description: >
        Tool (function) available to the agent. The `type` field determines
        which

        additional fields are required. Backend validation enforces per-type
        schemas.
      title: Tool
    SinglePromptConfig:
      type: object
      properties:
        prompt:
          type: string
          description: The main prompt that defines the agent's behavior and responses
        tools:
          type: array
          items:
            $ref: '#/components/schemas/Tool'
          default: []
          description: >
            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.
      required:
        - prompt
      description: Configuration for single prompt workflow type
      title: SinglePromptConfig
    DispositionMetricDispositionMetricType:
      type: string
      enum:
        - STRING
        - BOOLEAN
        - INTEGER
        - ENUM
        - DATETIME
      description: Data type returned by the metric.
      title: DispositionMetricDispositionMetricType
    DispositionMetric:
      type: object
      properties:
        identifier:
          type: string
          description: >-
            Stable machine identifier. Lowercase letters, digits, and
            underscores only.
        dispositionMetricPrompt:
          type: string
          description: >-
            Natural-language question evaluated against the transcript after the
            call ends.
        dispositionMetricType:
          $ref: '#/components/schemas/DispositionMetricDispositionMetricType'
          description: Data type returned by the metric.
        choices:
          type: array
          items:
            type: string
          description: Required when `dispositionMetricType = ENUM`. Allowed values.
      required:
        - identifier
        - dispositionMetricPrompt
        - dispositionMetricType
      description: |
        A single disposition metric captured after each call. The metric prompt
        is evaluated against the call transcript post-call, and the result is
        returned in the call log under `postCallAnalytics.dispositionMetrics`.
      title: DispositionMetric
    PostCallAnalyticsConfigSuccessMetricsItemsSuccessMetricType:
      type: string
      enum:
        - NUMERIC_SCALE
        - PERCENTAGE_SCALE
        - PASS_FAIL
        - DESCRIPTIVE_SCALE
      title: PostCallAnalyticsConfigSuccessMetricsItemsSuccessMetricType
    PostCallAnalyticsConfigSuccessMetricsItems:
      type: object
      properties:
        identifier:
          type: string
        successMetricPrompt:
          type: string
        successMetricType:
          $ref: >-
            #/components/schemas/PostCallAnalyticsConfigSuccessMetricsItemsSuccessMetricType
      required:
        - identifier
        - successMetricPrompt
        - successMetricType
      title: PostCallAnalyticsConfigSuccessMetricsItems
    PostCallAnalyticsConfig:
      type: object
      properties:
        dispositionMetrics:
          type: array
          items:
            $ref: '#/components/schemas/DispositionMetric'
          default: []
          description: Structured metrics extracted from each completed call.
        successMetrics:
          type: array
          items:
            $ref: '#/components/schemas/PostCallAnalyticsConfigSuccessMetricsItems'
          default: []
          description: |
            **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.
        summaryPrompt:
          type: string
          default: ''
          description: |
            **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:
          type: boolean
          default: true
          description: >-
            Use the internal analytics model. When false, falls back to the
            agent's own LLM.
        useReasoningModel:
          type: boolean
          default: false
          description: >-
            Route analytics evaluation through the reasoning model for
            higher-quality results at a latency/cost tradeoff.
      description: >
        Per-agent post-call analytics configuration. Evaluated after each call
        ends

        and surfaced in call logs under the `postCallAnalytics` field.
      title: PostCallAnalyticsConfig
    DraftConfigRequestLanguage:
      type: object
      properties: {}
      description: Language configuration. See CreateAgentRequest for full shape.
      title: DraftConfigRequestLanguage
    DraftConfigRequestSynthesizer:
      type: object
      properties: {}
      description: Synthesizer (TTS) configuration. See CreateAgentRequest for full shape.
      title: DraftConfigRequestSynthesizer
    DraftConfigRequestSlmModel:
      type: string
      enum:
        - electron
        - electron-kogta
        - electron-kogta-v2
        - gpt-4o
        - gpt-4.1
        - gpt-5.2
        - gpt-realtime
        - gpt-realtime-mini
      description: LLM model for this draft
      title: DraftConfigRequestSlmModel
    DraftConfigRequestWidgetConfig:
      type: object
      properties: {}
      description: Widget configuration for chat-mode agents
      title: DraftConfigRequestWidgetConfig
    DraftConfigRequestDefaultVariables:
      type: object
      properties: {}
      description: Default prompt variables
      title: DraftConfigRequestDefaultVariables
    DraftConfigRequestPreCallApi:
      type: object
      properties: {}
      description: Pre-call API configuration. See CreateAgentRequest for full shape.
      title: DraftConfigRequestPreCallApi
    DraftConfigRequestBackgroundSound:
      type: string
      enum:
        - ''
        - office
        - cafe
        - call_center
        - static
      title: DraftConfigRequestBackgroundSound
    DraftConfigRequestSmartTurnConfig:
      type: object
      properties: {}
      title: DraftConfigRequestSmartTurnConfig
    DraftConfigRequestVoiceDetectionConfig:
      type: object
      properties: {}
      title: DraftConfigRequestVoiceDetectionConfig
    DraftConfigRequestVoiceMailDetectionConfig:
      type: object
      properties: {}
      title: DraftConfigRequestVoiceMailDetectionConfig
    DraftConfigRequestDenoisingConfig:
      type: object
      properties: {}
      title: DraftConfigRequestDenoisingConfig
    DraftConfigRequestRedactionConfig:
      type: object
      properties: {}
      title: DraftConfigRequestRedactionConfig
    DraftConfigRequestPronunciationDictsItems:
      type: object
      properties: {}
      title: DraftConfigRequestPronunciationDictsItems
    DraftConfigRequestLlmIdleTimeoutConfig:
      type: object
      properties: {}
      title: DraftConfigRequestLlmIdleTimeoutConfig
    DraftConfigRequestSessionTimeoutConfig:
      type: object
      properties: {}
      title: DraftConfigRequestSessionTimeoutConfig
    WorkflowType:
      type: string
      enum:
        - workflow_graph
        - single_prompt
      description: >-
        The type of workflow configuration. workflow_graph uses a node-based
        visual workflow, single_prompt uses a simple prompt-based configuration.
      title: WorkflowType
    DraftConfigRequestTimezone:
      type: object
      properties: {}
      title: DraftConfigRequestTimezone
    DraftConfigRequest:
      type: object
      properties:
        singlePromptConfig:
          $ref: '#/components/schemas/SinglePromptConfig'
        postCallAnalyticsConfig:
          $ref: '#/components/schemas/PostCallAnalyticsConfig'
        language:
          $ref: '#/components/schemas/DraftConfigRequestLanguage'
          description: Language configuration. See CreateAgentRequest for full shape.
        synthesizer:
          $ref: '#/components/schemas/DraftConfigRequestSynthesizer'
          description: >-
            Synthesizer (TTS) configuration. See CreateAgentRequest for full
            shape.
        slmModel:
          $ref: '#/components/schemas/DraftConfigRequestSlmModel'
          description: LLM model for this draft
        transcriberType:
          type: string
          description: STT engine to use for this draft
        customLLMWebSocketUrl:
          type: string
          description: Custom LLM WebSocket URL (overrides slmModel)
        widgetConfig:
          $ref: '#/components/schemas/DraftConfigRequestWidgetConfig'
          description: Widget configuration for chat-mode agents
        defaultVariables:
          $ref: '#/components/schemas/DraftConfigRequestDefaultVariables'
          description: Default prompt variables
        preCallAPI:
          $ref: '#/components/schemas/DraftConfigRequestPreCallApi'
          description: Pre-call API configuration. See CreateAgentRequest for full shape.
        globalPrompt:
          type: string
          description: Global prompt for workflow_graph agents (max 4000 characters)
        globalKnowledgeBaseId:
          type: string
          description: Knowledge base ID to attach to this draft
        firstMessage:
          type: string
          description: Opening message for this draft
        allowInterruptions:
          type: boolean
        waitForUserToSpeakFirst:
          type: boolean
        muteUserUntilFirstBotResponse:
          type: boolean
        interruptionBackoffTimer:
          type: number
          format: double
        backgroundSound:
          $ref: '#/components/schemas/DraftConfigRequestBackgroundSound'
        smartTurnConfig:
          $ref: '#/components/schemas/DraftConfigRequestSmartTurnConfig'
        voiceDetectionConfig:
          $ref: '#/components/schemas/DraftConfigRequestVoiceDetectionConfig'
        voiceMailDetectionConfig:
          $ref: '#/components/schemas/DraftConfigRequestVoiceMailDetectionConfig'
        denoisingConfig:
          $ref: '#/components/schemas/DraftConfigRequestDenoisingConfig'
        redactionConfig:
          $ref: '#/components/schemas/DraftConfigRequestRedactionConfig'
        pronunciationDicts:
          type: array
          items:
            $ref: '#/components/schemas/DraftConfigRequestPronunciationDictsItems'
        llmIdleTimeoutConfig:
          $ref: '#/components/schemas/DraftConfigRequestLlmIdleTimeoutConfig'
        sessionTimeoutConfig:
          $ref: '#/components/schemas/DraftConfigRequestSessionTimeoutConfig'
        workflowType:
          $ref: '#/components/schemas/WorkflowType'
        timezone:
          $ref: '#/components/schemas/DraftConfigRequestTimezone'
        callDispositionConfig:
          type: string
        enableStyleGuide:
          type: boolean
        speechFormatting:
          type: boolean
      description: >
        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
      title: DraftConfigRequest
    AgentVersionStatus:
      type: string
      enum:
        - published
        - draft
        - archived
      description: Current status of the version record
      title: AgentVersionStatus
    AgentVersionBlocks:
      type: object
      properties:
        workflow_prompt:
          type: string
        workflow_tools:
          type: string
        workflow_graph:
          type: string
        llm:
          type: string
        voice:
          type: string
        language:
          type: string
        call_handling:
          type: string
        detection:
          type: string
        analytics:
          type: string
        timeouts:
          type: string
        audio:
          type: string
        privacy:
          type: string
        widget:
          type: string
      description: References to the 13 config section blocks
      title: AgentVersionBlocks
    AgentVersion:
      type: object
      properties:
        _id:
          type: string
          description: Unique identifier
        agent:
          type: string
          description: The agent this version belongs to
        status:
          $ref: '#/components/schemas/AgentVersionStatus'
          description: Current status of the version record
        versionNumber:
          type:
            - integer
            - 'null'
          description: Auto-incremented version number (published versions only)
        label:
          type:
            - string
            - 'null'
          description: Human-readable label for the version
        description:
          type:
            - string
            - 'null'
          description: Description of what changed in this version
        isPinned:
          type: boolean
          default: false
          description: Whether the version is pinned for quick access
        publishedBy:
          type:
            - string
            - 'null'
          description: User ID of who published this version
        publishedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: When this version was published
        activatedBy:
          type:
            - string
            - 'null'
          description: User ID of who activated this version
        activatedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: When this version was activated
        draftId:
          type:
            - string
            - 'null'
          description: Unique draft identifier (drafts only)
        draftName:
          type:
            - string
            - 'null'
          description: Human-readable draft name
        draftRevision:
          type:
            - integer
            - 'null'
          description: Revision number within the draft (drafts only)
        sourceVersionId:
          type:
            - string
            - 'null'
          description: The published version this draft was branched from
        blocks:
          $ref: '#/components/schemas/AgentVersionBlocks'
          description: References to the 13 config section blocks
        workflowType:
          $ref: '#/components/schemas/WorkflowType'
        parentVersion:
          type:
            - string
            - 'null'
          description: The version this was derived from
        isActive:
          type: boolean
          description: Whether this is the currently active version for the agent
        createdBy:
          type: string
          description: User ID of who created this record
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      description: >-
        Represents either a draft revision or a published version of an agent's
        configuration.
      title: AgentVersion
    Agent Versioning - Drafts_editDraftConfigPromptToolsPostCallMetricsVoiceEtc_Response_200:
      type: object
      properties:
        status:
          type: boolean
        data:
          $ref: '#/components/schemas/AgentVersion'
      title: >-
        Agent Versioning -
        Drafts_editDraftConfigPromptToolsPostCallMetricsVoiceEtc_Response_200
    BadRequestErrorResponse:
      type: object
      properties:
        status:
          type: boolean
        errors:
          type: array
          items:
            type: string
      title: BadRequestErrorResponse
    UnauthorizedErrorResponse:
      type: object
      properties:
        status:
          type: boolean
        errors:
          type: array
          items:
            type: string
      title: UnauthorizedErrorResponse
    ApiResponseData:
      type: object
      properties: {}
      title: ApiResponseData
    ApiResponse:
      type: object
      properties:
        status:
          type: boolean
        data:
          $ref: '#/components/schemas/ApiResponseData'
      title: ApiResponse
    InternalServerErrorResponse:
      type: object
      properties:
        status:
          type: boolean
        errors:
          type: array
          items:
            type: string
      title: InternalServerErrorResponse
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key from the console ApiKey collection, sent as Bearer token. Also
        accepts session cookies for browser-based auth.

```

## Examples



**Request**

```json
{}
```

**Response**

```json
{
  "status": true,
  "data": {
    "_id": "60d0fe4f5311236168a109cb",
    "agent": "60d0fe4f5311236168a109ca",
    "status": "published",
    "versionNumber": 3,
    "label": "Q2 2024 Update",
    "description": "Updated voice and post-call analytics configuration for improved customer satisfaction tracking.",
    "isPinned": false,
    "publishedBy": "user_7890",
    "publishedAt": "2024-01-15T09:30:00Z",
    "activatedBy": "user_7890",
    "activatedAt": "2024-01-15T09:30:00Z",
    "draftId": "draft_4567",
    "draftName": "Voice and Analytics Update",
    "draftRevision": 5,
    "sourceVersionId": "60d0fe4f5311236168a109c9",
    "blocks": {
      "workflow_prompt": "block_001",
      "workflow_tools": "block_002",
      "workflow_graph": "block_003",
      "llm": "block_004",
      "voice": "block_005",
      "language": "block_006",
      "call_handling": "block_007",
      "detection": "block_008",
      "analytics": "block_009",
      "timeouts": "block_010",
      "audio": "block_011",
      "privacy": "block_012",
      "widget": "block_013"
    },
    "workflowType": "workflow_graph",
    "parentVersion": "60d0fe4f5311236168a109c8",
    "isActive": true,
    "createdBy": "user_1234",
    "createdAt": "2024-01-10T08:00:00Z",
    "updatedAt": "2024-01-15T09:30:00Z"
  }
}
```

**SDK Code**

```python
from smallestai import SmallestAI

client = SmallestAI(
    token="YOUR_TOKEN_HERE",
)

client.atoms.agent_versioning_drafts.edit_draft_config_prompt_tools_post_call_metrics_voice_etc(
    id="60d0fe4f5311236168a109ca",
    draft_id="draftId",
)

```

```javascript
const url = 'https://api.smallest.ai/atoms/v1/agent/60d0fe4f5311236168a109ca/drafts/draftId/config';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.smallest.ai/atoms/v1/agent/60d0fe4f5311236168a109ca/drafts/draftId/config"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.smallest.ai/atoms/v1/agent/60d0fe4f5311236168a109ca/drafts/draftId/config")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.smallest.ai/atoms/v1/agent/60d0fe4f5311236168a109ca/drafts/draftId/config")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.smallest.ai/atoms/v1/agent/60d0fe4f5311236168a109ca/drafts/draftId/config', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.smallest.ai/atoms/v1/agent/60d0fe4f5311236168a109ca/drafts/draftId/config");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.smallest.ai/atoms/v1/agent/60d0fe4f5311236168a109ca/drafts/draftId/config")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```