> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fish.audio/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Draft Config

> Patch the draft configuration section by section; omitted sections keep
their value.



## OpenAPI

````yaml patch /v1/agent/agents/{agent_id}/config
openapi: 3.1.0
info:
  title: FishAudio OpenAPI
  version: '1'
servers:
  - description: Fish Audio API
    url: https://api.fish.audio
security: []
tags: []
paths:
  /v1/agent/agents/{agent_id}/config:
    patch:
      tags:
        - Agents
      summary: Update Draft Config
      description: >-
        Patch the draft configuration section by section; omitted sections keep

        their value. Changes only affect live sessions after the next publish.

        `prompt.system_prompt` is limited to 4000 characters (422 beyond).

        `voice.voice_id` accepts any public voice model id.

        `voice.speaking_language` accepts `en`, `ja`, `zh`, `ko`, `es`, `fr`,
        `de`;

        anything else is 422. `tool_ids` and

        `knowledge_source_ids` replace their attachment lists wholesale and
        every

        id must resolve, else 422.
      parameters:
        - in: path
          name: agent_id
          description: ''
          required: true
          schema:
            title: Agent Id
            type: string
          deprecated: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicAgentConfigPatchPayload'
      responses:
        '200':
          description: Request fulfilled, document follows
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  agent_id:
                    title: Agent Id
                    type: string
                  config_hash:
                    description: >-
                      Content hash of the draft; equal to a version's
                      config_hash when the draft has no unpublished changes.
                    title: Config Hash
                    type: string
                  prompt:
                    $ref: '#/components/schemas/AgentPromptConfig'
                  voice:
                    $ref: '#/components/schemas/AgentVoiceConfig'
                  conversation:
                    $ref: '#/components/schemas/AgentConversationConfig'
                  tools:
                    $ref: '#/components/schemas/PublicAgentToolsConfig'
                  webhooks:
                    $ref: '#/components/schemas/PublicAgentWebhooksConfig'
                  knowledge_base:
                    $ref: '#/components/schemas/PublicAgentKnowledgeBaseConfig'
                  analysis:
                    $ref: '#/components/schemas/AgentAnalysisConfig'
                  updated_at:
                    format: date-time
                    title: Updated At
                    type: string
                required:
                  - agent_id
                  - config_hash
                  - prompt
                  - voice
                  - conversation
                  - tools
                  - webhooks
                  - knowledge_base
                  - analysis
                  - updated_at
                type: object
        '401':
          description: No permission -- see authorization schemes
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                required:
                  - status
                  - message
                type: object
        '404':
          description: Nothing matches the given URI
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                required:
                  - status
                  - message
                type: object
        '422':
          description: ''
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                required:
                  - status
                  - message
                type: object
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: bash
          label: Update Draft Config
          source: |-
            curl --request PATCH \
              --url https://api.fish.audio/v1/agent/agents/<agent-id>/config \
              --header 'Authorization: Bearer <token>' \
              --header 'Content-Type: application/json' \
              --data '{
                "prompt": {
                  "system_prompt": "You are the receptionist for Fish Dental."
                },
                "webhooks": {
                  "post_call": [
                    {
                      "url": "https://example.com/hooks/fish",
                      "secret": "<signing-secret>"
                    }
                  ]
                }
              }'
components:
  schemas:
    PublicAgentConfigPatchPayload:
      additionalProperties: false
      properties:
        prompt:
          anyOf:
            - $ref: '#/components/schemas/PublicAgentPromptPatch'
            - type: 'null'
          default: null
        voice:
          anyOf:
            - $ref: '#/components/schemas/PublicAgentVoicePatch'
            - type: 'null'
          default: null
        conversation:
          anyOf:
            - $ref: '#/components/schemas/PublicAgentConversationPatch'
            - type: 'null'
          default: null
        tools:
          anyOf:
            - $ref: '#/components/schemas/PublicAgentToolsPatch'
            - type: 'null'
          default: null
        webhooks:
          anyOf:
            - $ref: '#/components/schemas/PublicAgentWebhooksPatch'
            - type: 'null'
          default: null
        knowledge_base:
          anyOf:
            - $ref: '#/components/schemas/PublicAgentKnowledgeBasePatch'
            - type: 'null'
          default: null
        analysis:
          anyOf:
            - $ref: '#/components/schemas/PublicAgentAnalysisPatch'
            - type: 'null'
          default: null
      title: PublicAgentConfigPatchPayload
      type: object
    AgentPromptConfig:
      properties:
        system_prompt:
          default: ''
          title: System Prompt
          type: string
        first_message_mode:
          default: prompt
          enum:
            - 'off'
            - fixed
            - prompt
          title: First Message Mode
          type: string
        first_message:
          default: Hi! Thanks for calling — how can I help you today?
          title: First Message
          type: string
        first_message_prompt:
          default: Greet the caller and ask what you can help with.
          title: First Message Prompt
          type: string
      title: AgentPromptConfig
      type: object
    AgentVoiceConfig:
      properties:
        voice_id:
          default: 4501d82f5de3467ebf4d7ef095a2deee
          title: Voice Id
          type: string
        speaking_language:
          default: en
          enum:
            - en
            - ja
            - zh
            - ko
            - es
            - fr
            - de
          title: Speaking Language
          type: string
      title: AgentVoiceConfig
      type: object
    AgentConversationConfig:
      properties:
        max_duration_seconds:
          default: 1800
          title: Max Duration Seconds
          type: integer
        eagerness:
          default: balanced
          enum:
            - relaxed
            - balanced
            - eager
          title: Eagerness
          type: string
        interruptible:
          default: true
          title: Interruptible
          type: boolean
        interruption_sensitivity:
          default: balanced
          enum:
            - low
            - balanced
            - high
          title: Interruption Sensitivity
          type: string
        reengage_enabled:
          default: false
          title: Reengage Enabled
          type: boolean
        record_audio:
          default: true
          title: Record Audio
          type: boolean
        timezone:
          default: ''
          title: Timezone
          type: string
        transfer_destinations:
          default: []
          items:
            $ref: '#/components/schemas/AgentTransferDestination'
          title: Transfer Destinations
          type: array
      title: AgentConversationConfig
      type: object
    PublicAgentToolsConfig:
      properties:
        enabled:
          default: true
          title: Enabled
          type: boolean
        tool_ids:
          items:
            type: string
          title: Tool Ids
          type: array
        system_tools:
          $ref: '#/components/schemas/AgentSystemToolsConfig'
      title: PublicAgentToolsConfig
      type: object
    PublicAgentWebhooksConfig:
      properties:
        post_call:
          items:
            $ref: '#/components/schemas/PublicPostCallWebhook'
          title: Post Call
          type: array
      title: PublicAgentWebhooksConfig
      type: object
    PublicAgentKnowledgeBaseConfig:
      properties:
        enabled:
          default: false
          title: Enabled
          type: boolean
        knowledge_source_ids:
          items:
            type: string
          title: Knowledge Source Ids
          type: array
      title: PublicAgentKnowledgeBaseConfig
      type: object
    AgentAnalysisConfig:
      properties:
        summary:
          $ref: '#/components/schemas/AgentAnalysisSummaryConfig'
        data_fields:
          items:
            $ref: '#/components/schemas/AgentAnalysisDataField'
          maxItems: 20
          title: Data Fields
          type: array
        criteria:
          items:
            $ref: '#/components/schemas/AgentAnalysisCriterion'
          maxItems: 10
          title: Criteria
          type: array
      title: AgentAnalysisConfig
      type: object
    PublicAgentPromptPatch:
      additionalProperties: false
      properties:
        system_prompt:
          anyOf:
            - maxLength: 4000
              type: string
            - type: 'null'
          default: null
          title: System Prompt
        first_message_mode:
          anyOf:
            - enum:
                - 'off'
                - fixed
                - prompt
              type: string
            - type: 'null'
          default: null
          title: First Message Mode
        first_message:
          anyOf:
            - maxLength: 10000
              type: string
            - type: 'null'
          default: null
          title: First Message
        first_message_prompt:
          anyOf:
            - maxLength: 10000
              type: string
            - type: 'null'
          default: null
          title: First Message Prompt
      title: PublicAgentPromptPatch
      type: object
    PublicAgentVoicePatch:
      additionalProperties: false
      properties:
        voice_id:
          anyOf:
            - maxLength: 256
              type: string
            - type: 'null'
          default: null
          title: Voice Id
        speaking_language:
          anyOf:
            - enum:
                - en
                - ja
                - zh
                - ko
                - es
                - fr
                - de
              type: string
            - type: 'null'
          default: null
          title: Speaking Language
      title: PublicAgentVoicePatch
      type: object
    PublicAgentConversationPatch:
      additionalProperties: false
      properties:
        max_duration_seconds:
          anyOf:
            - maximum: 3600
              minimum: 60
              type: integer
            - type: 'null'
          default: null
          title: Max Duration Seconds
        eagerness:
          anyOf:
            - enum:
                - relaxed
                - balanced
                - eager
              type: string
            - type: 'null'
          default: null
          title: Eagerness
        interruptible:
          anyOf:
            - type: boolean
            - type: 'null'
          default: null
          title: Interruptible
        interruption_sensitivity:
          anyOf:
            - enum:
                - low
                - balanced
                - high
              type: string
            - type: 'null'
          default: null
          title: Interruption Sensitivity
        reengage_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          default: null
          title: Reengage Enabled
        record_audio:
          anyOf:
            - type: boolean
            - type: 'null'
          default: null
          title: Record Audio
        timezone:
          anyOf:
            - maxLength: 64
              type: string
            - type: 'null'
          default: null
          title: Timezone
        transfer_destinations:
          anyOf:
            - items:
                $ref: '#/components/schemas/AgentTransferDestinationPatch'
              type: array
            - type: 'null'
          default: null
          title: Transfer Destinations
      title: PublicAgentConversationPatch
      type: object
    PublicAgentToolsPatch:
      additionalProperties: false
      properties:
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          default: null
          title: Enabled
        tool_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          default: null
          description: >-
            Replaces the attached tool set wholesale. Every id must be an
            existing tool in the agent's workspace, else 422.
          title: Tool Ids
        system_tools:
          anyOf:
            - $ref: '#/components/schemas/PublicSystemToolsPatch'
            - type: 'null'
          default: null
      title: PublicAgentToolsPatch
      type: object
    PublicAgentWebhooksPatch:
      additionalProperties: false
      properties:
        post_call:
          anyOf:
            - items:
                $ref: '#/components/schemas/PublicPostCallWebhookPayload'
              maxItems: 5
              type: array
            - type: 'null'
          default: null
          description: >-
            Up to 5 endpoints, each receiving every post-call event. Replaces
            the configured list wholesale; a single object is still accepted and
            is stored as a one-element list, and null (or an empty list) clears
            every endpoint. URLs must be unique.
          title: Post Call
      title: PublicAgentWebhooksPatch
      type: object
    PublicAgentKnowledgeBasePatch:
      additionalProperties: false
      properties:
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          default: null
          title: Enabled
        knowledge_source_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          default: null
          description: >-
            Replaces the attached knowledge sources wholesale. Every id must be
            an existing knowledge source visible to the agent, else 422.
          title: Knowledge Source Ids
      title: PublicAgentKnowledgeBasePatch
      type: object
    PublicAgentAnalysisPatch:
      additionalProperties: false
      properties:
        summary:
          anyOf:
            - $ref: '#/components/schemas/PublicAgentAnalysisSummaryPatch'
            - type: 'null'
          default: null
        data_fields:
          anyOf:
            - items:
                $ref: '#/components/schemas/PublicAgentAnalysisDataField'
              maxItems: 20
              type: array
            - type: 'null'
          default: null
          title: Data Fields
        criteria:
          anyOf:
            - items:
                $ref: '#/components/schemas/PublicAgentAnalysisCriterion'
              maxItems: 10
              type: array
            - type: 'null'
          default: null
          title: Criteria
      title: PublicAgentAnalysisPatch
      type: object
    AgentTransferDestination:
      properties:
        type:
          const: phone
          default: phone
          title: Type
          type: string
        label:
          default: ''
          title: Label
          type: string
        phone_number:
          title: Phone Number
          type: string
        mode:
          default: cold
          enum:
            - cold
            - warm
          title: Mode
          type: string
        warm_connect:
          default: confirm
          enum:
            - confirm
            - direct
          title: Warm Connect
          type: string
      required:
        - phone_number
      title: AgentTransferDestination
      type: object
    AgentSystemToolsConfig:
      properties:
        language_detection:
          default: false
          title: Language Detection
          type: boolean
        hang_up_call:
          default: false
          title: Hang Up Call
          type: boolean
      title: AgentSystemToolsConfig
      type: object
    PublicPostCallWebhook:
      properties:
        url:
          title: Url
          type: string
        has_secret:
          default: false
          description: >-
            Whether a signing secret is configured; the value itself is never
            returned.
          title: Has Secret
          type: boolean
      required:
        - url
      title: PublicPostCallWebhook
      type: object
    AgentAnalysisSummaryConfig:
      properties:
        enabled:
          default: true
          title: Enabled
          type: boolean
        prompt:
          anyOf:
            - maxLength: 1000
              type: string
            - type: 'null'
          default: null
          title: Prompt
        language:
          default: en
          enum:
            - en
            - zh
            - ja
            - ko
            - es
            - fr
            - de
            - pt
            - ru
            - ar
          title: Language
          type: string
      title: AgentAnalysisSummaryConfig
      type: object
    AgentAnalysisDataField:
      properties:
        name:
          pattern: ^[a-z][a-z0-9_]{0,63}$
          title: Name
          type: string
        type:
          default: text
          enum:
            - boolean
            - text
            - number
            - enum
          title: Type
          type: string
        description:
          default: ''
          maxLength: 500
          title: Description
          type: string
        enum_options:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          default: null
          title: Enum Options
      required:
        - name
      title: AgentAnalysisDataField
      type: object
    AgentAnalysisCriterion:
      properties:
        name:
          pattern: ^[a-z][a-z0-9_]{0,63}$
          title: Name
          type: string
        description:
          default: ''
          maxLength: 500
          title: Description
          type: string
      required:
        - name
      title: AgentAnalysisCriterion
      type: object
    AgentTransferDestinationPatch:
      additionalProperties: false
      properties:
        type:
          const: phone
          default: phone
          title: Type
          type: string
        label:
          default: ''
          title: Label
          type: string
        phone_number:
          title: Phone Number
          type: string
        mode:
          default: cold
          enum:
            - cold
            - warm
          title: Mode
          type: string
        warm_connect:
          default: confirm
          enum:
            - confirm
            - direct
          title: Warm Connect
          type: string
      required:
        - phone_number
      title: AgentTransferDestinationPatch
      type: object
    PublicSystemToolsPatch:
      additionalProperties: false
      properties:
        language_detection:
          anyOf:
            - type: boolean
            - type: 'null'
          default: null
          title: Language Detection
        hang_up_call:
          anyOf:
            - type: boolean
            - type: 'null'
          default: null
          title: Hang Up Call
      title: PublicSystemToolsPatch
      type: object
    PublicPostCallWebhookPayload:
      additionalProperties: false
      properties:
        url:
          maxLength: 4000
          minLength: 1
          title: Url
          type: string
        secret:
          anyOf:
            - maxLength: 256
              type: string
            - type: 'null'
          default: null
          description: >-
            Optional HMAC-SHA256 signing secret (X-Fish-Webhook-Signature).
            Write-only: reads report `has_secret` instead of the value.
          title: Secret
      required:
        - url
      title: PublicPostCallWebhookPayload
      type: object
    PublicAgentAnalysisSummaryPatch:
      additionalProperties: false
      properties:
        enabled:
          default: true
          title: Enabled
          type: boolean
        prompt:
          anyOf:
            - maxLength: 1000
              type: string
            - type: 'null'
          default: null
          title: Prompt
        language:
          default: en
          enum:
            - en
            - zh
            - ja
            - ko
            - es
            - fr
            - de
            - pt
            - ru
            - ar
          title: Language
          type: string
      title: PublicAgentAnalysisSummaryPatch
      type: object
    PublicAgentAnalysisDataField:
      additionalProperties: false
      properties:
        name:
          pattern: ^[a-z][a-z0-9_]{0,63}$
          title: Name
          type: string
        type:
          default: text
          enum:
            - boolean
            - text
            - number
            - enum
          title: Type
          type: string
        description:
          default: ''
          maxLength: 500
          title: Description
          type: string
        enum_options:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          default: null
          title: Enum Options
      required:
        - name
      title: PublicAgentAnalysisDataField
      type: object
    PublicAgentAnalysisCriterion:
      additionalProperties: false
      properties:
        name:
          pattern: ^[a-z][a-z0-9_]{0,63}$
          title: Name
          type: string
        description:
          default: ''
          maxLength: 500
          title: Description
          type: string
      required:
        - name
      title: PublicAgentAnalysisCriterion
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````