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

# Update an agent

> Changes an agent's name or description. Send only the fields you want to change.

Anything you leave out stays as it is. Sending `"description": null` clears the description.

Common causes of a `422` validation error:

* `name` is empty or longer than 100 characters.
* `description` is empty or longer than 5,000 characters.

A `400` can also mean the agent's current voice setup is no longer valid, so any update is refused. Fix the agent's voice in the Dashboard, then retry. See [Errors](https://docs.olimi.ai/api-reference/endpoint/agent/agents.md#errors).


## OpenAPI

````yaml patch /api/v2/agents/{id}
openapi: 3.0.1
info:
  title: Customer Management API
  description: API for managing customer lists and customers within those lists
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api-eg.olimi.ai
security:
  - bearerAuth: []
paths:
  /api/v2/agents/{id}:
    patch:
      tags:
        - Agents
      summary: Update an agent
      description: >-
        Changes an agent's name or description. Send only the fields you want to
        change.
      parameters:
        - name: id
          in: path
          required: true
          description: The agent's `id`.
          schema:
            type: string
            format: uuid
          example: 0d6a3f7e-5b8c-4b1e-9a51-2f1d7c9e4a10
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentUpdate'
      responses:
        '200':
          description: The updated agent.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentUpdateResponse'
        '400':
          description: >-
            The `id` isn't a valid UUID, or the agent's current voice setup is
            no longer valid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '401':
          description: The `X-API-KEY` header is missing or the key isn't valid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '404':
          description: >-
            `agent_not_found`: no agent with that `id` belongs to your company,
            or it was deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '422':
          description: The request body didn't pass validation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
      security:
        - apiKeyAuth: []
components:
  schemas:
    AgentUpdate:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 100
          description: The agent's display name. Surrounding spaces are trimmed.
          example: Admissions Assistant (Cairo)
        description:
          type: string
          minLength: 1
          maxLength: 5000
          description: >-
            A short description of what the agent does. Surrounding spaces are
            trimmed. Send `null` to clear it.
          example: Answers questions about enrollment and fees.
          nullable: true
    AgentUpdateResponse:
      type: object
      properties:
        message:
          type: string
          example: Agent updated successfully
        data:
          $ref: '#/components/schemas/Agent'
    ApiError:
      type: object
      properties:
        statusCode:
          type: integer
          example: 404
        errorCode:
          type: string
          description: Machine-readable error code.
          example: agent_not_found
        message:
          type: string
          description: Human-readable text. May change; don't match on it.
          example: Agent not found
    ValidationError:
      type: object
      properties:
        statusCode:
          type: integer
          example: 422
        message:
          type: array
          items:
            type: string
          description: What went wrong. Human-readable.
          example:
            - name must be shorter than or equal to 100 characters
        error:
          type: string
          example: Unprocessable Entity
    Agent:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The agent's ID.
          example: 0d6a3f7e-5b8c-4b1e-9a51-2f1d7c9e4a10
        organizationId:
          type: string
          format: uuid
          description: Your company's ID.
          example: 5f2c8a91-7d3e-4b60-8c1a-9e4f2b7d6a35
        name:
          type: string
          description: The agent's display name.
          example: Admissions Assistant
        description:
          type: string
          nullable: true
          description: A short description of what the agent does.
          example: Answers questions about enrollment and fees.
        callType:
          type: string
          enum:
            - inbound
            - outbound
            - web
          description: >-
            How the agent talks to people. See [Call
            types](/api-reference/endpoint/agent/agents#call-types).
          example: inbound
        isActive:
          type: boolean
          description: Whether the agent is switched on.
          example: true
        languageId:
          type: string
          format: uuid
          nullable: true
          description: The language the agent speaks.
          example: a3b9e2d4-6c1f-4e8a-9d72-1b5c8f3e0a46
        voiceId:
          type: string
          format: uuid
          nullable: true
          description: The voice the agent speaks with.
          example: e7d1c5b2-4a8f-4396-b0e2-7c9a1d3f5b68
        voice:
          $ref: '#/components/schemas/AgentVoice'
        createdAt:
          type: string
          format: date-time
          description: When the agent was created (UTC).
          example: '2026-08-12T09:31:04.112Z'
        updatedAt:
          type: string
          format: date-time
          description: When the agent was last changed (UTC).
          example: '2026-09-20T14:02:51.870Z'
    AgentVoice:
      type: object
      nullable: true
      description: The voice the agent speaks with.
      properties:
        id:
          type: string
          format: uuid
          description: The voice's ID. Same as the agent's `voiceId`.
          example: e7d1c5b2-4a8f-4396-b0e2-7c9a1d3f5b68
        name:
          type: string
          description: The voice's display name.
          example: Salma
        gender:
          type: string
          nullable: true
          description: The voice's gender.
          example: female
        language:
          $ref: '#/components/schemas/AgentVoiceLanguage'
    AgentVoiceLanguage:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The language's ID.
          example: a3b9e2d4-6c1f-4e8a-9d72-1b5c8f3e0a46
        name:
          type: string
          description: The language's display name.
          example: Arabic - Egyptian
        code:
          type: string
          description: The language code.
          example: ar-EG
      nullable: true
      description: The voice's language. `null` for voices not tied to one language.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````

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