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

# Update agent

> Replaces the agent's config and saves it as a new version. Send the whole config: anything you leave out is dropped.

<Note>
Updating doesn't change the running agent. Call [Deploy agent](/api-reference/deployment/deploy-agent) to put the new version live.
</Note>




## OpenAPI

````yaml /api-reference/rest/openapi.yaml put /v1/agents/{agentId}
openapi: 3.1.0
info:
  title: Zero Runtime REST API
  version: '1.0'
  description: >-
    Create, configure, version and deploy agents, and wire SIP telephony to
    them.
servers:
  - url: https://api.zeroruntime.ai
security:
  - token: []
tags:
  - name: Agents
  - name: Versions
  - name: Deployment
  - name: Phone numbers
  - name: Routing rules
  - name: Calls
  - name: Batch calls
  - name: Knowledge bases
  - name: Knowledge base folders
paths:
  /v1/agents/{agentId}:
    parameters:
      - $ref: '#/components/parameters/agentId'
    put:
      tags:
        - Agents
      summary: Update agent
      description: >
        Replaces the agent's config and saves it as a new version. Send the
        whole config: anything you leave out is dropped.


        <Note>

        Updating doesn't change the running agent. Call [Deploy
        agent](/api-reference/deployment/deploy-agent) to put the new version
        live.

        </Note>
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/AgentConfig'
                - type: object
                  properties:
                    versionName:
                      type: string
                      description: Label for the new version.
                      default: Updated via API
            examples:
              Inference:
                summary: Inference
                value:
                  versionName: Switch to booking flow
                  name: Booking Agent
                  defaultLanguage: english
                  languages:
                    english:
                      prompt: >-
                        You are a booking assistant for a dental clinic. Help
                        callers book, move or cancel appointments, and confirm
                        the date and time before ending the call.
                      greeting:
                        text: >-
                          Hello! Thanks for calling Bright Smile Dental. How can
                          I help with your appointment?
                        interruptible: true
                      stt:
                        - model: assemblyai/universal-streaming-english
                          language: en
                      llm:
                        - model: google/gemini-3.5-flash
                      tts:
                        - model: deepgram/aura-2
                          voice: apollo
                          language: en
                      turnDetection:
                        model: videosdk/echo-small
                        mode: default
                      endCall:
                        enabled: true
                        when: >-
                          the appointment is confirmed or the caller says
                          goodbye
                        message: You're all set. See you at the clinic!
                  voiceProcessing:
                    noiseCancellation:
                      model: aicoustics/quail-s-16khz
                  callSummary:
                    enabled: false
              Your own key (BYOK):
                summary: Your own key (BYOK)
                value:
                  versionName: Move LLM to my OpenAI key
                  name: Booking Agent
                  defaultLanguage: english
                  languages:
                    english:
                      prompt: >-
                        You are a booking assistant for a dental clinic. Help
                        callers book, move or cancel appointments, and confirm
                        the date and time before ending the call.
                      greeting:
                        text: >-
                          Hello! Thanks for calling Bright Smile Dental. How can
                          I help with your appointment?
                        interruptible: true
                      stt:
                        - model: assemblyai/universal-streaming-english
                          language: en
                      llm:
                        - model: openai/gpt-4o
                          apiKey: sk-proj-…
                      tts:
                        - model: deepgram/aura-2
                          voice: apollo
                          language: en
      responses:
        '200':
          description: The new version.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentWithConfig'
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    agentId:
      name: agentId
      in: path
      required: true
      schema:
        type: string
      example: ag_7f2c91
  schemas:
    AgentConfig:
      type: object
      required:
        - name
        - languages
      properties:
        name:
          type: string
          example: Support Agent
        defaultLanguage:
          type: string
          description: A language name, any casing.
          example: english
        languages:
          type: object
          description: >-
            Keyed by language name (`english`, `hindi`, …). Holds everything
            that varies by language.
          additionalProperties:
            $ref: '#/components/schemas/LanguageBlock'
          example:
            english:
              prompt: >-
                You are a support agent for an online store. Keep replies to one
                or two sentences.
              greeting:
                text: Hi! How can I help you today?
                interruptible: false
              stt:
                - model: deepgram/nova-3-general
                  language: en
              llm:
                - model: openai/gpt-4o
                  apiKey: ••••••••••••••••AbCd
              tts:
                - model: cartesia/sonic-3
                  voice: faf0731e-dfb9-4cfc-8119-259a79b27e12
        voiceProcessing:
          $ref: '#/components/schemas/VoiceProcessing'
        knowledgeBaseIds:
          type: array
          items:
            type: string
          description: >-
            Ids of the knowledge bases the agent answers from. An update
            replaces the list, so leaving it out removes them all.
        callSummary:
          type: object
          properties:
            enabled:
              type: boolean
            llm:
              $ref: '#/components/schemas/ModelEntry'
            instruction:
              type: string
            webhook:
              type: object
              properties:
                url:
                  type: string
                  format: uri
        tools:
          type: array
          items:
            type: string
          description: >-
            Ids of the tools the agent can call. An update replaces the list, so
            leaving it out removes them all.
        advanced:
          type: object
    AgentWithConfig:
      allOf:
        - $ref: '#/components/schemas/Agent'
        - type: object
          properties:
            versionId:
              type: string
              example: cm_31d0ba
            config:
              allOf:
                - $ref: '#/components/schemas/AgentConfig'
              description: The config as stored, with names resolved.
    LanguageBlock:
      type: object
      required:
        - prompt
      properties:
        prompt:
          type: string
        greeting:
          type: object
          properties:
            text:
              type: string
            interruptible:
              type: boolean
              description: Must match across languages.
        stt:
          $ref: '#/components/schemas/ModelSlot'
        llm:
          $ref: '#/components/schemas/ModelSlot'
        tts:
          $ref: '#/components/schemas/ModelSlot'
        realtime:
          allOf:
            - $ref: '#/components/schemas/ModelSlot'
          description: >-
            A realtime model fills STT, LLM and TTS itself. When set, `stt`,
            `llm` and `tts` in the same block are ignored.
        turnDetection:
          type: object
          properties:
            model:
              type: string
              description: >-
                A turn detection model from [Supported
                models](/api-reference/rest/models).
              example: videosdk/echo-large
            mode:
              type: string
              enum:
                - default
                - adaptive
            threshold:
              type: number
              minimum: 0
              maximum: 1
            minWaitSeconds:
              type: number
              minimum: 0
            maxWaitSeconds:
              type: number
              minimum: 0
              description: At least `minWaitSeconds`.
        wakeUp:
          type: object
          description: When `enabled` is true, `afterSeconds` and `message` are required.
          properties:
            enabled:
              type: boolean
            afterSeconds:
              type: number
              minimum: 0
            message:
              type: string
        endCall:
          type: object
          properties:
            enabled:
              type: boolean
              description: Must match across languages.
            when:
              type: string
              description: Must match across languages.
            message:
              type: string
    VoiceProcessing:
      type: object
      description: Shared by every language.
      properties:
        vad:
          type: object
          required:
            - sensitivity
          properties:
            sensitivity:
              type: string
              enum:
                - low
                - medium
                - high
            threshold:
              type: number
              minimum: 0
              maximum: 1
            minSpeechDuration:
              type: number
              minimum: 0
            minSilenceDuration:
              type: number
              minimum: 0
        interruption:
          type: object
          properties:
            mode:
              type: string
              enum:
                - hybrid
                - vad
                - stt
              description: '`vad` needs a `voiceProcessing.vad` block.'
            minDuration:
              type: number
              minimum: 0
            minWords:
              type: integer
              minimum: 0
        noiseCancellation:
          type: object
          description: '`{ "model": "provider/modelId" }` or `{ "provider": "…" }`.'
          properties:
            model:
              type: string
              description: >-
                A noise cancellation model from [Supported
                models](/api-reference/rest/models).
              example: aicoustics/quail-l-16khz
            provider:
              type: string
    ModelEntry:
      type: object
      description: One model in a slot.
      required:
        - model
      properties:
        model:
          type: string
          description: >-
            `provider/modelId`. Copy a slug from [Supported
            models](/api-reference/rest/models).
          example: cartesia/sonic-3
        voice:
          type: string
          description: >-
            The provider's voice id. Required for TTS models. Open a model's
            voices in [Supported models](/api-reference/rest/models) to copy
            one.
        language:
          type: string
          description: >-
            Optional language code for a regional variant, e.g. `en-IN`. Left
            out, the plain code is picked. See each model's codes in [Supported
            models](/api-reference/rest/models).
        apiKey:
          type: string
          description: >
            Your provider's own API key. Selects the bring-your-own-key variant
            of the model; leave it off for inference.


            Responses return it masked (`••••••••AbCd`). Send the full key on
            every create and update; a masked value is rejected.
          example: sk-proj-…
      additionalProperties: false
    Agent:
      type: object
      properties:
        agentId:
          type: string
          example: ag_7f2c91
        name:
          type: string
          example: Support Agent
        status:
          type: string
          enum:
            - inactive
            - active
          description: >-
            `active` once deployed. A new agent stays `inactive` only if its
            first deploy couldn't run, for example when the account has no
            active API key. Call [Deploy
            agent](/api-reference/deployment/deploy-agent) yourself then.
          example: active
        deploymentId:
          type: string
          example: dp_44b1e0
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    ValidationError:
      type: object
      properties:
        status:
          type: string
          example: error
        errors:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
                example: languages.english.tts[0].voice
              code:
                type: string
                example: UNKNOWN_VOICE
              message:
                type: string
                example: >-
                  Sonic 3 has no voice called "jacqueline". Pick one from its
                  voice list.
    Error:
      type: object
      properties:
        error:
          type: string
    ModelSlot:
      type: array
      description: The first entry is primary; the rest are fallbacks tried in order.
      items:
        $ref: '#/components/schemas/ModelEntry'
  responses:
    ValidationError:
      description: The body didn't validate. Every problem is listed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
    Unauthorized:
      description: Missing or invalid `Authorization` header.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: No such resource on this account.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    token:
      type: apiKey
      in: header
      name: Authorization
      description: Your API token, sent raw (no `Bearer` prefix).
      x-default: <auth-token>

````

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