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

# Update agent draft



## OpenAPI

````yaml /api-reference/openapi.json put /v1/agents/{agentId}/branches/{branchId}/draft
openapi: 3.0.0
info:
  title: Zeptar API
  description: >-
    The Zeptar API is organized around REST. All requests and responses are
    JSON. Endpoints are scoped to the authenticated user’s active organization
    unless the path specifies an organization explicitly.
  version: v1
  contact: {}
servers:
  - url: https://api.zeptar.com
    description: Production
  - url: http://localhost:3001
    description: Local development
security: []
tags:
  - name: dashboard
    description: Workspace analytics dashboard
  - name: api-keys
    description: Create, list, update, and revoke API keys
  - name: request-log
    description: Browse, filter, and export the history of authenticated API requests
  - name: voices
    description: Voices available for speech synthesis
  - name: llm
    description: Large language models available for agents
  - name: convai/agents
    description: CRUD on conversational AI agents
  - name: convai/conversations
    description: Start a preview conversation against an agent
  - name: conversations
    description: Browse conversation history, transcripts, tags, and analysis
  - name: organizations
    description: List and look up workspaces (organizations)
  - name: organizations/members
    description: Add and remove members from an org
  - name: me
    description: The current authenticated user
  - name: me/workspace-invitations
    description: Pending workspace invites for the current user
paths:
  /v1/agents/{agentId}/branches/{branchId}/draft:
    put:
      tags:
        - drafts
      summary: Update agent draft
      operationId: DraftsController_upsert
      parameters:
        - name: agentId
          required: true
          in: path
          schema:
            type: string
        - name: branchId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpsertDraftDto'
      responses:
        '200':
          description: ''
      security:
        - apiKey: []
        - cookie: []
components:
  schemas:
    UpsertDraftDto:
      type: object
      properties:
        config:
          $ref: '#/components/schemas/ConfigDto'
      required:
        - config
    ConfigDto:
      type: object
      properties:
        system_prompt:
          type: string
          example: You are a helpful assistant.
        first_message:
          type: object
          example: Hello! How can I help you today?
          nullable: true
        first_message_wait_time_seconds:
          type: object
          example: 7
          nullable: true
        language:
          $ref: '#/components/schemas/LanguageConfigDto'
        llm:
          $ref: '#/components/schemas/LlmConfigDto'
        tts:
          $ref: '#/components/schemas/TtsConfigDto'
        interruptible:
          type: boolean
          example: true
        language_voice_overrides:
          type: object
          additionalProperties: true
        prompt_timezone:
          type: object
          example: Europe/Paris
          nullable: true
        agent_behavior:
          $ref: '#/components/schemas/AgentBehaviorConfigDto'
        widget:
          $ref: '#/components/schemas/WidgetConfigDto'
        guardrails:
          $ref: '#/components/schemas/GuardrailsConfigDto'
        workflow:
          type: object
          additionalProperties: true
          nullable: true
      required:
        - system_prompt
        - first_message
        - first_message_wait_time_seconds
        - interruptible
        - language_voice_overrides
        - prompt_timezone
        - workflow
    LanguageConfigDto:
      type: object
      properties:
        default:
          type: string
          example: en
        additional:
          example:
            - de
          type: array
          items:
            type: string
      required:
        - default
        - additional
    LlmConfigDto:
      type: object
      properties:
        provider:
          type: string
          example: openai
        model:
          type: string
          example: gpt-5.2-chat-latest
        temperature:
          type: object
          example: 0.7
          nullable: true
      required:
        - provider
        - model
        - temperature
    TtsConfigDto:
      type: object
      properties:
        provider:
          type: string
          example: cartesia
        voice_id:
          type: string
          example: 9626c31c-bec5-4cca-baa8-f8ba9e84c8bc
        model:
          type: string
          example: sonic-3
        settings:
          type: object
          additionalProperties:
            type: number
        voice_name:
          type: string
          example: Jacqueline
      required:
        - provider
        - voice_id
        - model
        - settings
    AgentBehaviorConfigDto:
      type: object
      properties:
        default_personality:
          type: boolean
          example: true
        customize_per_channel:
          type: boolean
          example: false
          deprecated: true
        channels:
          type: object
          additionalProperties: true
      required:
        - default_personality
        - channels
    WidgetConfigDto:
      type: object
      properties:
        feedback_mode:
          type: string
          enum:
            - none
            - during
            - end
        variant:
          type: string
          enum:
            - tiny
            - compact
            - full
        text_only:
          type: boolean
          example: false
        text_input_enabled:
          type: boolean
          example: true
        transcript_enabled:
          type: boolean
          example: false
        language_selector:
          type: boolean
          example: false
        mic_muting_enabled:
          type: boolean
          example: false
        expandable:
          type: string
          enum:
            - collapsed
            - expanded
            - always
        action_indicator:
          type: boolean
          example: false
        show_conversation_id:
          type: boolean
          example: true
        hide_audio_tags:
          type: boolean
          example: true
        markdown_allow_all_domains:
          type: boolean
          example: false
        markdown_allowed_domains:
          type: array
          items:
            type: string
        markdown_include_www_variants:
          type: boolean
          example: true
        markdown_allow_http:
          type: boolean
          example: true
        terms_enabled:
          type: boolean
          example: false
        terms_require_acceptance:
          type: boolean
          example: false
        terms_key:
          type: string
        terms_text:
          type: string
        avatar_color_1:
          type: string
        avatar_color_2:
          type: string
        color_background:
          type: string
        color_text:
          type: string
        color_accent:
          type: string
        text_main_label:
          type: string
        text_start_call:
          type: string
        text_start_chat:
          type: string
        text_listening:
          type: string
        text_speaking:
          type: string
        text_input_placeholder:
          type: string
    GuardrailsConfigDto:
      type: object
      properties:
        focus:
          $ref: '#/components/schemas/GuardrailToggleDto'
        manipulation:
          $ref: '#/components/schemas/GuardrailToggleDto'
        content:
          $ref: '#/components/schemas/ContentGuardrailDto'
        custom:
          type: array
          items:
            $ref: '#/components/schemas/CustomGuardrailDto'
    GuardrailToggleDto:
      type: object
      properties:
        enabled:
          type: boolean
          example: false
    ContentGuardrailDto:
      type: object
      properties:
        execution_mode:
          type: string
          enum:
            - streaming
            - blocking
        violation_action:
          type: string
          enum:
            - end_conversation
            - retry
        categories:
          type: object
          additionalProperties: true
      required:
        - categories
    CustomGuardrailDto:
      type: object
      properties:
        id:
          type: string
          example: 2b1c…
        enabled:
          type: boolean
          example: true
        name:
          type: string
          example: No financial advice
        prompt:
          type: string
          example: Block specific investment recommendations.
        model:
          type: string
          example: gemini-2.5-flash-lite
        execution_mode:
          type: string
          enum:
            - streaming
            - blocking
        violation_action:
          type: string
          enum:
            - end_conversation
            - retry
        retry_feedback:
          type: string
      required:
        - id
        - name
        - prompt
  securitySchemes:
    apiKey:
      scheme: bearer
      bearerFormat: zsk_…
      type: http
      description: >-
        API key issued via `POST /v1/api-keys`. Prefix is `zsk_`. Pass as
        `Authorization: Bearer zsk_…`. Scopes are enforced per key.
    cookie:
      type: apiKey
      in: cookie
      name: better-auth.session_token
      description: >-
        Session cookie set by `auth.api.signInEmail` (or the OAuth flow).
        Forwarded automatically by the browser; copy via `document.cookie` for
        server-to-server calls during development.

````