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

# Update agent

> Update an agent's settings, inbound settings, channels, knowledge bases, tools and publish state.

Steps run in this order: settings, inbound, channels, knowledge bases, tools, test values, publish. If a step
fails, earlier steps stay applied and the error lists them under `applied`.

For a chat agent send `type: chat`: `live`, `name`, `system_prompt`, then `chat` (channels, follow-up, settings,
which actions are on, and custom actions to add, change or remove). This operation can change workspace data or trigger an external side effect; review the request before sending it and do not retry blindly after a timeout.



## OpenAPI

````yaml /openapi.json patch /api/v1/public/agents/{agent_id}
openapi: 3.1.0
info:
  description: >-
    Customer-facing API for managing outreach, leads, conversations, voice
    agents, knowledge bases, analytics, and webhooks.
  title: Sendora Public API
  version: 1.0.0
servers:
  - description: Production
    url: https://api.sendora.ai
security: []
tags:
  - description: Leads, lead lists, importing, enriching and finding new prospects.
    name: Leads
  - description: Build, run and measure outreach, and enroll leads.
    name: Campaigns
  - description: Read and send messages, and manage who must not be contacted.
    name: Conversations
  - description: >-
      Voice and chat agents, their tools, knowledge bases, voices and website
      widgets.
    name: Agents
  - description: >-
      Start calls, and manage phone numbers, SMS registration, sending accounts
      and email domains.
    name: Calls and numbers
  - description: Webhooks, jobs, analytics and the Copilot assistant.
    name: Platform
  - description: Manage client workspaces, plans and branding.
    name: Agency
paths:
  /api/v1/public/agents/{agent_id}:
    patch:
      tags:
        - Agents
      summary: Update agent
      description: >-
        Update an agent's settings, inbound settings, channels, knowledge bases,
        tools and publish state.


        Steps run in this order: settings, inbound, channels, knowledge bases,
        tools, test values, publish. If a step

        fails, earlier steps stay applied and the error lists them under
        `applied`.


        For a chat agent send `type: chat`: `live`, `name`, `system_prompt`,
        then `chat` (channels, follow-up, settings,

        which actions are on, and custom actions to add, change or remove). This
        operation can change workspace data or trigger an external side effect;
        review the request before sending it and do not retry blindly after a
        timeout.
      operationId: update_agent_api_v1_public_agents__agent_id__patch
      parameters:
        - description: >-
            The voice agent's id: the `id` from List or get agents. It is also
            the last part of that page's address in the app.
          in: path
          name: agent_id
          required: true
          schema:
            title: Agent Id
            type: string
        - in: header
          name: X-API-Key
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
        - in: header
          name: Authorization
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentPatchBody'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/VoiceAgentDetail'
                  - $ref: '#/components/schemas/ChatAgentLiveOut'
                  - type: object
                title: Response Update Agent Api V1 Public Agents  Agent Id  Patch
          description: Successful Response
        '401':
          description: The X-API-Key header is missing, invalid, expired, or revoked.
        '402':
          description: >-
            The workspace is suspended for billing, or the request would exceed
            a plan or usage limit.
        '403':
          description: >-
            The key is valid but lacks the required scope, or the workspace has
            no active plan, lacks the entitlement, or has this feature turned
            off or view-only.
        '404':
          description: >-
            The resource does not exist or is not owned by the authenticated
            workspace.
        '410':
          description: The workspace behind this key has been deleted.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
        '500':
          description: >-
            An unexpected Sendora error occurred. Retry only if the operation is
            safe to repeat.
        '503':
          description: >-
            An entitlement or billing check is temporarily unavailable. Retry
            after the Retry-After interval.
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - label: cURL
          lang: bash
          source: >-
            curl -X PATCH 'https://api.sendora.ai/api/v1/public/agents/YOUR_ID'
            -H "X-API-Key: $SENDORA_API_KEY" -H "Content-Type: application/json"
            \
              -d '{"name":"example","display_name":"example","avatar_url":"example"}'
        - label: Python
          lang: python
          source: >-
            import requests


            url = 'https://api.sendora.ai/api/v1/public/agents/YOUR_ID'

            headers = {'X-API-Key': '$SENDORA_API_KEY'}

            response = requests.patch(url, headers=headers, json={'name':
            'example', 'display_name': 'example', 'avatar_url': 'example'})

            response.raise_for_status()

            print(response.json())
        - label: JavaScript
          lang: javascript
          source: >-
            const response = await
            fetch("https://api.sendora.ai/api/v1/public/agents/YOUR_ID", {
              method: "PATCH",
              headers: { 'X-API-Key': process.env.SENDORA_API_KEY, 'Content-Type': 'application/json' },
              body: JSON.stringify({"name": "example", "display_name": "example", "avatar_url": "example"}),
            });

            if (!response.ok) throw new Error(await response.text());

            console.log(await response.json());
        - label: Go
          lang: go
          source: >-
            req, err := http.NewRequest("PATCH",
            "https://api.sendora.ai/api/v1/public/agents/YOUR_ID",
            bytes.NewBufferString(`{"name": "example", "display_name":
            "example", "avatar_url": "example"}`))

            if err != nil { log.Fatal(err) }

            req.Header.Set("X-API-Key", os.Getenv("SENDORA_API_KEY"))

            req.Header.Set("Content-Type", "application/json")

            resp, err := http.DefaultClient.Do(req)

            if err != nil { log.Fatal(err) }

            defer resp.Body.Close()
components:
  schemas:
    AgentPatchBody:
      properties:
        avatar_url:
          anyOf:
            - maxLength: 500
              type: string
            - type: 'null'
          description: Avatar url returned by the Sendora API.
          title: Avatar Url
        avatar_video_url:
          anyOf:
            - maxLength: 500
              type: string
            - type: 'null'
          description: Avatar video url returned by the Sendora API.
          title: Avatar Video Url
        channels:
          anyOf:
            - additionalProperties:
                type: object
              propertyNames:
                enum:
                  - email
                  - linkedin
                  - whatsapp
                  - phone
              type: object
            - type: 'null'
          description: Channel assignments, keyed by channel.
          title: Channels
        chat:
          anyOf:
            - $ref: '#/components/schemas/ChatSetup'
            - type: 'null'
          description: >-
            With type chat: channels, follow-up, settings, which actions are on,
            and custom actions.
        confirmation_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            The confirmation value returned by the previous publish attempt,
            sent back to confirm it.
          title: Confirmation Id
        custom_voice_ref:
          anyOf:
            - type: string
            - type: 'null'
          description: Custom voice ref returned by the Sendora API.
          title: Custom Voice Ref
        display_name:
          anyOf:
            - maxLength: 200
              type: string
            - type: 'null'
          description: Display name returned by the Sendora API.
          title: Display Name
        first_message:
          anyOf:
            - maxLength: 2000
              type: string
            - type: 'null'
          description: First message returned by the Sendora API.
          title: First Message
        first_message_delay_seconds:
          anyOf:
            - maximum: 30
              minimum: 0
              type: number
            - type: 'null'
          description: First message delay seconds returned by the Sendora API.
          title: First Message Delay Seconds
        first_speaker:
          anyOf:
            - pattern: ^(agent|user)$
              type: string
            - type: 'null'
          description: First speaker returned by the Sendora API.
          title: First Speaker
        inactivity_messages:
          anyOf:
            - items: {}
              maxItems: 10
              type: array
            - type: 'null'
          description: Inactivity messages returned by the Sendora API.
          title: Inactivity Messages
        inbound:
          anyOf:
            - type: object
            - type: 'null'
          description: 'Inbound call settings: capture_leads, lead_defaults, after_hours.'
          title: Inbound
        is_active:
          anyOf:
            - type: boolean
            - type: 'null'
          description: Is active returned by the Sendora API.
          title: Is Active
        join_timeout_seconds:
          anyOf:
            - maximum: 300
              minimum: 5
              type: integer
            - type: 'null'
          description: Join timeout seconds returned by the Sendora API.
          title: Join Timeout Seconds
        knowledge_base_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: >-
            The knowledge bases this agent uses: each an `id` from List or get
            knowledge bases.
          title: Knowledge Base Ids
        language_hint:
          anyOf:
            - maxLength: 16
              type: string
            - type: 'null'
          description: Language hint returned by the Sendora API.
          title: Language Hint
        live:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 'Chat agents only: switch the agent on or off.'
          title: Live
        max_duration_seconds:
          anyOf:
            - maximum: 3600
              type: integer
            - type: 'null'
          description: Max duration seconds returned by the Sendora API.
          title: Max Duration Seconds
        model:
          anyOf:
            - type: string
            - type: 'null'
          description: Model returned by the Sendora API.
          title: Model
        name:
          anyOf:
            - maxLength: 200
              type: string
            - type: 'null'
          description: Name returned by the Sendora API.
          title: Name
        output_medium:
          anyOf:
            - pattern: ^(voice|text)$
              type: string
            - type: 'null'
          description: Output medium returned by the Sendora API.
          title: Output Medium
        publish:
          anyOf:
            - type: boolean
            - type: 'null'
          description: true publishes the draft. Needs confirmation_id.
          title: Publish
        recording_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: Recording enabled returned by the Sendora API.
          title: Recording Enabled
        system_prompt:
          anyOf:
            - maxLength: 20000
              type: string
            - type: 'null'
          description: System prompt returned by the Sendora API.
          title: System Prompt
        temperature:
          anyOf:
            - type: number
            - type: 'null'
          description: Temperature returned by the Sendora API.
          title: Temperature
        test_context:
          anyOf:
            - $ref: '#/components/schemas/TestContextValuesRequest'
            - type: 'null'
          description: >-
            Voice agents: the values used for the call variables when you test
            the agent.
        time_exceeded_message:
          anyOf:
            - maxLength: 600
              type: string
            - type: 'null'
          description: Time exceeded message returned by the Sendora API.
          title: Time Exceeded Message
        tool_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: >-
            The tools this agent uses: each an `id` from List or read tools and
            widgets (type tool).
          title: Tool Ids
        tools:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          description: Tools returned by the Sendora API.
          title: Tools
        type:
          anyOf:
            - enum:
                - voice
                - chat
              type: string
            - type: 'null'
          description: >-
            chat to change a chat agent's name, instructions or setup with
            `chat`. Leave out for a voice agent.
          title: Type
        uninterruptible:
          anyOf:
            - type: boolean
            - type: 'null'
          description: Uninterruptible returned by the Sendora API.
          title: Uninterruptible
        voice_asset_id:
          anyOf:
            - maxLength: 160
              type: string
            - type: 'null'
          description: 'The voice to use: the `asset_id` of a voice in List voices.'
          title: Voice Asset Id
        voice_id:
          anyOf:
            - maxLength: 128
              type: string
            - type: 'null'
          description: 'A voice''s id: the `id` from List voices.'
          title: Voice Id
        voice_model:
          anyOf:
            - type: string
            - type: 'null'
          description: Voice model returned by the Sendora API.
          title: Voice Model
        voice_speed:
          anyOf:
            - maximum: 1.2
              minimum: 0.7
              type: number
            - type: 'null'
          description: Voice speed returned by the Sendora API.
          title: Voice Speed
        voicemail_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: Voicemail enabled returned by the Sendora API.
          title: Voicemail Enabled
        voicemail_script:
          anyOf:
            - maxLength: 600
              type: string
            - type: 'null'
          description: Voicemail script returned by the Sendora API.
          title: Voicemail Script
      required: []
      title: AgentPatchBody
      type: object
    VoiceAgentDetail:
      properties:
        channels:
          description: Channel assignments, keyed by email, linkedin, whatsapp, phone.
          title: Channels
          type: object
        configuration:
          anyOf:
            - type: object
            - type: 'null'
          description: 'Editable settings: prompt, voice, model, limits.'
          title: Configuration
        created_at:
          description: Created at returned by the Sendora API.
          format: date-time
          title: Created At
          type: string
        direction:
          default: outbound
          description: Direction returned by the Sendora API.
          title: Direction
          type: string
        display_name:
          anyOf:
            - type: string
            - type: 'null'
          description: Display name returned by the Sendora API.
          title: Display Name
        first_message:
          default: ''
          description: First message returned by the Sendora API.
          title: First Message
          type: string
        id:
          description: The voice agent's id. Pass it to any endpoint that takes `agent_id`.
          title: Id
          type: string
        inbound:
          anyOf:
            - type: object
            - type: 'null'
          description: Inbound call settings.
          title: Inbound
        is_active:
          default: false
          description: Is active returned by the Sendora API.
          title: Is Active
          type: boolean
        knowledge_bases:
          anyOf:
            - items:
                type: object
              type: array
            - type: 'null'
          description: Knowledge bases returned by the Sendora API.
          title: Knowledge Bases
        name:
          description: Name returned by the Sendora API.
          title: Name
          type: string
        ready:
          default: false
          description: Ready returned by the Sendora API.
          title: Ready
          type: boolean
        tools:
          anyOf:
            - items:
                type: object
              type: array
            - type: 'null'
          description: Tools returned by the Sendora API.
          title: Tools
        type:
          default: voice
          description: Type returned by the Sendora API.
          title: Type
          type: string
        updated_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: Updated at returned by the Sendora API.
          title: Updated At
        voices:
          anyOf:
            - items:
                type: object
              type: array
            - type: 'null'
          description: Present with include=voices.
          title: Voices
      required:
        - id
        - name
        - created_at
      title: VoiceAgentDetail
      type: object
    ChatAgentLiveOut:
      properties:
        channels_missing:
          description: >-
            Channels that could not be switched on because no account is
            connected.
          items:
            type: string
          title: Channels Missing
          type: array
        channels_on:
          description: Channels the agent now answers on.
          items:
            type: string
          title: Channels On
          type: array
        live:
          description: Live returned by the Sendora API.
          title: Live
          type: boolean
      required:
        - live
        - channels_on
        - channels_missing
      title: ChatAgentLiveOut
      type: object
    HTTPValidationError:
      properties:
        detail:
          description: Detail returned by the Sendora API.
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      required: []
      title: HTTPValidationError
      type: object
    ChatSetup:
      properties:
        actions:
          anyOf:
            - additionalProperties:
                $ref: '#/components/schemas/ActionToggleIn'
              type: object
            - type: 'null'
          description: Turn an action on or off by its id
          title: Actions
        channels:
          anyOf:
            - additionalProperties:
                $ref: '#/components/schemas/ChannelSetting'
              propertyNames:
                enum:
                  - sms
                  - whatsapp
                  - email
              type: object
            - type: 'null'
          description: Channels returned by the Sendora API.
          title: Channels
        custom_actions:
          anyOf:
            - $ref: '#/components/schemas/CustomActionChanges'
            - type: 'null'
          description: Custom actions returned by the Sendora API.
        followup:
          anyOf:
            - $ref: '#/components/schemas/FollowupIn'
            - type: 'null'
          description: Nudge a quiet contact after some minutes, up to three times
        settings:
          anyOf:
            - type: object
            - type: 'null'
          description: The agent's settings, as in the app
          title: Settings
      required: []
      title: ChatSetup
      type: object
    TestContextValuesRequest:
      properties:
        values:
          description: Values returned by the Sendora API.
          title: Values
          type: object
      required: []
      title: TestContextValuesRequest
      type: object
    ValidationError:
      properties:
        loc:
          description: Loc returned by the Sendora API.
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          description: Msg returned by the Sendora API.
          title: Message
          type: string
        type:
          description: Type returned by the Sendora API.
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    ActionToggleIn:
      properties:
        config:
          description: Config returned by the Sendora API.
          title: Config
          type: object
        enabled:
          description: Enabled returned by the Sendora API.
          title: Enabled
          type: boolean
      required:
        - enabled
      title: ActionToggleIn
      type: object
    ChannelSetting:
      properties:
        account_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            A sender account's id: the `id` from List or read connections (type
            connected) for the same channel.
          title: Account Id
        mode:
          anyOf:
            - enum:
                - auto
                - draft
              type: string
            - type: 'null'
          description: auto sends replies; draft saves them for a person to approve
          title: Mode
      required: []
      title: ChannelSetting
      type: object
    CustomActionChanges:
      properties:
        add:
          anyOf:
            - items:
                $ref: '#/components/schemas/CustomActionIn'
              maxItems: 20
              type: array
            - type: 'null'
          description: Custom actions to add; each calls your own URL.
          title: Add
        remove:
          anyOf:
            - items:
                type: string
              maxItems: 20
              type: array
            - type: 'null'
          description: Ids of custom actions to delete.
          title: Remove
        update:
          anyOf:
            - additionalProperties:
                $ref: '#/components/schemas/CustomActionIn'
              type: object
            - type: 'null'
          description: Custom actions to change, keyed by the action's id.
          title: Update
      required: []
      title: CustomActionChanges
      type: object
    FollowupIn:
      properties:
        nudge_after_minutes:
          description: Nudge after minutes returned by the Sendora API.
          maximum: 1440
          minimum: 0
          title: Nudge After Minutes
          type: integer
        nudge_max:
          default: 2
          description: Nudge max returned by the Sendora API.
          maximum: 3
          minimum: 1
          title: Nudge Max
          type: integer
      required:
        - nudge_after_minutes
      title: FollowupIn
      type: object
    CustomActionIn:
      properties:
        auth_tokens:
          anyOf:
            - items:
                type: object
              type: array
            - type: 'null'
          description: Auth tokens returned by the Sendora API.
          title: Auth Tokens
        description:
          default: ''
          description: Description returned by the Sendora API.
          maxLength: 500
          title: Description
          type: string
        display_name:
          anyOf:
            - maxLength: 80
              type: string
            - type: 'null'
          description: Display name returned by the Sendora API.
          title: Display Name
        http_method:
          default: POST
          description: Http method returned by the Sendora API.
          maxLength: 8
          title: Http Method
          type: string
        http_url:
          description: Http url returned by the Sendora API.
          maxLength: 2000
          title: Http Url
          type: string
        name:
          description: Name returned by the Sendora API.
          maxLength: 40
          title: Name
          type: string
        parameters:
          description: Parameters returned by the Sendora API.
          items:
            type: object
          maxItems: 12
          title: Parameters
          type: array
        timeout_seconds:
          default: 8
          description: Timeout seconds returned by the Sendora API.
          maximum: 30
          minimum: 1
          title: Timeout Seconds
          type: number
      required:
        - name
        - http_url
      title: CustomActionIn
      type: object
  securitySchemes:
    ApiKeyAuth:
      description: Customer API key created in the Sendora dashboard.
      in: header
      name: X-API-Key
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.