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

# Update Agent

> Update properties of an Agent

export const limit_0 = 60

<Info>
  **Rate Limit:** This endpoint is limited to **{limit_0.toLocaleString()} requests per minute** per user.
</Info>

## Overview

Update properties of an Agent.
Only `metadata` is currently supported for updates.


## OpenAPI

````yaml openapi.json PATCH /api/v1/client/agents/{agent_id}
openapi: 3.1.0
info:
  title: kolena
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/client/agents/{agent_id}:
    patch:
      tags:
        - client
        - agents
      summary: Client Update Agent
      operationId: client_update_agent_api_v1_client_agents__agent_id__patch
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: integer
            title: Agent Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAgentRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agent'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    UpdateAgentRequest:
      properties:
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
          description: >-
            Object of key-value pairs; useful for organizing, filtering, and
            tracking purposes. Metadata keys must be strings. Metadata values
            can be primitives (strings, numbers, booleans, or null) or lists of
            primitives. Updating metadata completely replaces the existing
            metadata on that Agent (not merged). To remove all metadata from an
            Agent, send an empty object `{}` as the metadata value.
      type: object
      title: UpdateAgentRequest
    Agent:
      properties:
        id:
          type: integer
          title: Id
          description: The ID of this Agent.
        workspace_id:
          type: integer
          title: Workspace Id
          description: The ID of the workspace hosting this Agent.
        name:
          type: string
          title: Name
          description: The name of this Agent.
        objective:
          type: string
          title: Objective
          description: >-
            A short description of this Agent's objective, e.g. "Extract key
            information from leases and addendum documents".
        created:
          type: string
          format: date-time
          title: Created
          description: >-
            When this Agent was created, formatted as an ISO 8601 timestamp
            (e.g. `2025-12-31T10:15:45+00:00`)
        updated:
          type: string
          format: date-time
          title: Updated
          description: >-
            When this Agent was last updated, formatted as an ISO 8601 timestamp
            (e.g. `2025-12-31T10:15:45+00:00`)
        created_by:
          type: string
          title: Created By
          description: The email address of the user who created this Agent.
        agent_guidelines:
          anyOf:
            - $ref: '#/components/schemas/AgentGuidelines'
            - type: 'null'
          description: >-
            The Agent Guidelines that will be used for all Prompts in this
            Agent.
        n_runs:
          type: integer
          title: N Runs
          description: The number of times this Agent has been Run.
        prompts:
          items:
            $ref: '#/components/schemas/Prompt'
          type: array
          title: Prompts
          description: The Prompts configured for this Agent.
          examples:
            - - created: '2025-01-01T00:00:00'
                documents: []
                id: 1
                input_prompt_ids: []
                last_updated_by: user@example.com
                model:
                  type: efficient
                  version: 2.0.0-rc1
                name: Account number
                options:
                  code_generation: false
                  document_filter: false
                  enhanced_vision: false
                  prompt: Find the account number
                  type: string
                  web_search: false
                updated: '2025-01-01T00:00:00'
              - created: '2025-01-01T00:00:00'
                documents: []
                id: 2
                input_prompt_ids:
                  - 1
                last_updated_by: user@example.com
                model:
                  type: default
                  version: 2.0.0-rc2
                name: Account info
                options:
                  code_generation: false
                  document_filter: false
                  enhanced_vision: false
                  fields:
                    - full name
                    - address
                  prompt: >-
                    Extract form fields using account number: <kolena-prompt
                    id='1'/>
                  type: form
                  web_search: false
                updated: '2025-01-02T00:00:00'
        output_templates:
          items:
            $ref: '#/components/schemas/OutputTemplate'
          type: array
          title: Output Templates
          description: >-
            The Templates configured for this Agent, used to generate formatted
            output documents.
        metadata:
          additionalProperties: true
          type: object
          title: Metadata
          description: Metadata for this Agent.
          examples:
            - department: finance
              environment: production
              tags:
                - invoice-processing
                - high-priority
              version: 2
      type: object
      required:
        - id
        - workspace_id
        - name
        - objective
        - created
        - updated
        - created_by
        - agent_guidelines
        - n_runs
        - prompts
      title: Agent
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AgentGuidelines:
      properties:
        prompt:
          type: string
          title: Prompt
          description: The instructions that will be used for all Prompts in this Agent.
        created:
          type: string
          format: date-time
          title: Created
          description: >-
            When these Agent Guidelines were created, formatted as an ISO 8601
            timestamp (e.g. `2025-12-31T10:15:45+00:00`)
        updated:
          type: string
          format: date-time
          title: Updated
          description: >-
            When these Agent Guidelines were last updated, formatted as an ISO
            8601 timestamp (e.g. `2025-12-31T10:15:45+00:00`)
      type: object
      required:
        - prompt
        - created
        - updated
      title: AgentGuidelines
    Prompt:
      properties:
        id:
          type: integer
          title: Id
          description: The ID of this Prompt.
        name:
          type: string
          title: Name
          description: The name of this Prompt.
        created:
          type: string
          format: date-time
          title: Created
          description: >-
            When this Prompt was created, formatted as an ISO 8601 timestamp
            (e.g. `2025-12-31T10:15:45+00:00`)
        updated:
          type: string
          format: date-time
          title: Updated
          description: >-
            When this Prompt was last updated, formatted as an ISO 8601
            timestamp (e.g. `2025-12-31T10:15:45+00:00`)
        model:
          $ref: '#/components/schemas/PromptModel'
          description: The model used by this Prompt.
        options:
          additionalProperties: true
          type: object
          title: Options
          description: The configuration options for this Prompt.
        documents:
          items:
            $ref: '#/components/schemas/PromptDocument'
          type: array
          title: Documents
          description: Any files attached to this Prompt.
        input_prompt_ids:
          items:
            type: integer
          type: array
          title: Input Prompt Ids
          description: >-
            A list of Prompt IDs that provide input to this Prompt. These are
            the prompts whose outputs can be referenced within this Prompt.
        last_updated_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Updated By
          description: The email address of the user who last updated this Prompt.
      type: object
      required:
        - id
        - name
        - created
        - updated
        - model
        - options
        - documents
      title: Prompt
    OutputTemplate:
      properties:
        id:
          type: integer
          title: Id
          description: The ID of this Template.
        filename:
          type: string
          title: Filename
          description: The original filename of this Template.
        created:
          type: string
          format: date-time
          title: Created
          description: >-
            When this Template was created, formatted as an ISO 8601 timestamp
            (e.g. `2025-12-31T10:15:45+00:00`)
        updated:
          type: string
          format: date-time
          title: Updated
          description: >-
            When this Template was last updated, formatted as an ISO 8601
            timestamp (e.g. `2025-12-31T10:15:45+00:00`)
      type: object
      required:
        - id
        - filename
        - created
        - updated
      title: OutputTemplate
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    PromptModel:
      properties:
        type:
          type: string
          enum:
            - default
            - efficient
          title: Type
          description: The type of this model, either `default` or `efficient`.
        version:
          type: string
          title: Version
          description: The specific version of the `default` or `efficient` model used.
      type: object
      required:
        - type
        - version
      title: PromptModel
    PromptDocument:
      properties:
        filename:
          type: string
          title: Filename
          description: The filename of a document used as a Prompt attachment.
        content_hash:
          anyOf:
            - type: string
            - type: 'null'
          title: Content Hash
          description: The content hash of the original uploaded file.
      type: object
      required:
        - filename
      title: PromptDocument
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer
      description: >-
        Bearer authentication header of the form `Bearer <token>`. The `<token>`
        represents your API key, which must be acquired from the Kolena
        platform.

````