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

# Edit an Agent

> Update the details of a specific agent



## OpenAPI

````yaml PATCH /agents/{agentId}
openapi: 3.0.1
info:
  title: AI Phone Call Service API
  description: >-
    API for managing AI-based phone calls, including call initiation and result
    retrieval.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://my.cald.ai/client/api/v1
security:
  - apiKeyAuth: []
paths:
  /agents/{agentId}:
    patch:
      description: Update the details of a specific agent
      parameters:
        - name: agentId
          in: path
          description: The agent ID of the agent
          required: true
          schema:
            type: string
            description: The agent ID of the agent
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Agent'
      responses:
        '200':
          description: Success response with agent details
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: >-
                      Whether the agent was successfully updated, can be either
                      `success` or `failed`
        '404':
          description: Agent not found
components:
  schemas:
    Agent:
      type: object
      properties:
        name:
          type: string
          description: The name given to the agent in the MyCald Dashboard
        maxCallDuration:
          type: number
          description: The maximum duration of a call in minutes, between 1 and 60
          default: 10
        recordingSettings:
          type: object
          properties:
            enable:
              type: boolean
              description: Whether to enable recording of the calls
              default: false
        instructions:
          type: string
          description: >-
            The instructions for the agent, for example, `Hi, convince the
            prospect to buy the product`
        greeting:
          type: string
          description: The greeting for the agent, for example, `Hi there!`
        transferSettings:
          type: object
          properties:
            enable:
              type: boolean
              description: Whether to enable transfer of the calls
              default: false
            rule:
              type: string
              description: >-
                The rule to use for transferring the calls, for example:
                `transfer the call if the prospect would like to have more
                information or the AI is unable to answer the question`
              default: always
            phoneNumber:
              type: string
              description: The phone number to transfer the call to
        machineSettings:
          type: object
          properties:
            enable:
              type: boolean
              description: >-
                Whether to enable machine detection (e.g. IVR, voicemail), where
                the AI will hang up if it detects a machine
              default: false
        voicemailSettings:
          type: object
          properties:
            enable:
              type: boolean
              description: >-
                Whether to enable saying a voicemail message if the call is
                picked up by a voicemail
              default: false
            voicemail:
              type: string
              description: >-
                The message to say, only available if `enable` is set to `true`,
                for example, `Hi, this is the AI assistant calling on behalf of
                John Smith. I was curious if you would be interested in our
                product. Please call us back at 123-456-7890.`
        webhookSettings:
          type: object
          properties:
            enable:
              type: boolean
              description: >-
                Whether to enable sending of a webhook to a URL of your choice
                when the call is completed
              default: false
            url:
              type: string
              description: >-
                The webhook needs to be an HTTP or HTTPS callback URL. Upon
                completion of the call, we'll transmit the call ID, transcript,
                etc. to this URL. This feature is beneficial for receiving
                real-time notifications at the conclusion of calls.
        smsSettings:
          type: object
          properties:
            enable:
              type: boolean
              description: Whether to enable sending of text messages
              default: false
            rule:
              type: string
              description: >-
                The rule to use for sending text messages, for example: `send a
                text message if the prospect is interested in the offer`
              default: always
            message:
              type: string
              description: >-
                The message to send, only available if `enable` is set to
                `true`, for example, `Hi, please visit our website at
                https://www.example.com` for more information.`
        voice:
          type: string
          description: >-
            The voice ID of the voice to use for the agent, for example,
            `standard_male`
          default: standard_male
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Your API key, e.g. `caldLiveDe39a3accb206dd615f30d118e519df0`

````