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

# Update Agent by ID

> This endpoint updates an existing agent. Only the fields provided in the request body will be updated; other fields will remain unchanged.




## OpenAPI

````yaml /agentic/auto-generated-openapi.yml patch /agents/{id}
openapi: 3.1.1
info:
  title: Corti Agent API
  version: 0.1.0
  description: >
    The Corti Agent API allows users to interact with the Corti Agent, enabling
    the creation and management of threads, sending messages, and receiving
    responses.
servers: []
security: []
paths:
  /agents/{id}:
    patch:
      tags:
        - Agents
      summary: Update Agent by ID
      description: >
        This endpoint updates an existing agent. Only the fields provided in the
        request body will be updated; other fields will remain unchanged.
      operationId: agents_update
      parameters:
        - $ref: '#/components/parameters/Tenant-Name'
        - $ref: '#/components/parameters/AgentID'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentsUpdateAgent'
      responses:
        '200':
          description: Agent updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentsAgent'
        '400':
          description: >
            The request could not be processed, possibly due to missing required
            fields or invalid data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentsErrorResponse'
        '401':
          description: |
            Authentication is required to access this endpoint.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentsErrorResponse'
        '404':
          description: Agent not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentsErrorResponse'
        '422':
          description: |
            The request body failed validation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentsValidationErrorResponse'
      x-codeSamples:
        - lang: csharp
          label: C# .NET SDK
          source: >
            using Corti;


            var client = new CortiClient(
                "TENANT_NAME",
                CortiClientEnvironment.Eu,
                new CortiClientAuth.ClientCredentials("client_id", "client_secret")
            );

            await
            client.Agents.UpdateAsync("12345678-90ab-cdef-gh12-34567890abc", new
            AgentsUpdateAgent());
        - lang: javascript
          label: JavaScript SDK
          source: |
            import { CortiClient, CortiEnvironment } from "@corti/sdk";

            const client = new CortiClient({
                environment: CortiEnvironment.Eu,
                auth: {
                    clientId: "YOUR_CLIENT_ID",
                    clientSecret: "YOUR_CLIENT_SECRET"
                },
                tenantName: "YOUR_TENANT_NAME"
            });
            await client.agents.update("12345678-90ab-cdef-gh12-34567890abc");
components:
  parameters:
    Tenant-Name:
      name: Tenant-Name
      in: header
      description: >-
        Identifies a distinct entity within Corti's multi-tenant system. Ensures
        correct routing and authentication of the request.
      required: true
      example: base
      schema:
        type: string
        description: >-
          Identifies a distinct entity within Corti's multi-tenant system.
          Ensures correct routing and authentication of the request.
        example: base
    AgentID:
      name: id
      in: path
      required: true
      description: The identifier of the agent associated with the context.
      schema:
        type: string
        description: The identifier of the agent associated with the context.
        example: 12345678-90ab-cdef-gh12-34567890abc
  schemas:
    AgentsUpdateAgent:
      type: object
      properties:
        name:
          type: string
          description: The name of the agent.
        systemPrompt:
          type: string
          description: >
            The system prompt that defines the overall agents behavior and
            expectations. This field is optional as there is a default system
            orchestrator.
        description:
          type: string
          description: A brief description of the agent's capabilities.
        experts:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/AgentsCreateExpert'
              - $ref: '#/components/schemas/AgentsUpdateExpertReference'
        mcpServers:
          type: array
          description: >
            A list of MCP servers that the agent can call. If omitted, the agent
            can't call any MCP servers.
          items:
            $ref: '#/components/schemas/AgentsCreateMCPServer'
    AgentsAgent:
      type: object
      required:
        - id
        - name
        - description
        - systemPrompt
      properties:
        id:
          type: string
          description: The unique identifier of the agent.
        name:
          type: string
          description: The name of the agent.
        description:
          type: string
          description: A brief description of the agent's capabilities.
        systemPrompt:
          type: string
          description: >-
            The system prompt that defines the overall agents behavior and
            expectations.
        experts:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/AgentsExpert'
              - $ref: '#/components/schemas/AgentsExpertReference'
        mcpServers:
          type: array
          description: >
            A list of MCP servers that the agent can call. If omitted, the agent
            can't call any MCP servers.
          items:
            $ref: '#/components/schemas/AgentsMCPServer'
    AgentsErrorResponse:
      type: object
      required:
        - code
        - description
      properties:
        code:
          type: string
          description: |
            A machine-readable error code that identifies the type of error.
        description:
          type: string
          description: >
            A human-readable description of the error, providing more context
            about what went wrong.
        howToFix:
          type: string
          description: |
            A human-readable message describing how to fix the issue.
        details:
          type: object
          description: |
            An optional object containing additional details about the error.
          additionalProperties: true
        cause:
          type: object
          description: >
            An optional object containing the cause of the error, following the
            same structure as the parent error response.
          additionalProperties: true
    AgentsValidationErrorResponse:
      allOf:
        - $ref: '#/components/schemas/AgentsErrorResponse'
        - type: object
          properties:
            detail:
              type: array
              title: Detail
              items:
                $ref: '#/components/schemas/AgentsValidationError'
    AgentsCreateExpert:
      type: object
      required:
        - type
        - name
        - description
      properties:
        type:
          type: string
          enum:
            - new
        name:
          type: string
          description: The name of the expert. Must be unique.
          pattern: ^[a-zA-Z0-9_\.-]+$
        description:
          type: string
          description: A brief description of the expert's capabilities.
        systemPrompt:
          type: string
          description: >
            Optional system prompt that defines the expert's behavior and
            expectations.
        mcpServers:
          type: array
          description: >
            A list of MCP servers that the expert can call. If omitted, the
            expert can't call any MCP Servers.
          items:
            $ref: '#/components/schemas/AgentsCreateMCPServer'
    AgentsUpdateExpertReference:
      description: >-
        An expert reference when updating an agent. The id is required to
        identify which expert to update, or reference. The expert must already
        exist.
      required:
        - id
      allOf:
        - $ref: '#/components/schemas/AgentsCreateExpertReference'
    AgentsCreateMCPServer:
      type: object
      required:
        - name
        - transportType
        - authorizationType
        - url
      properties:
        name:
          type: string
          description: Name of the MCP server.
        description:
          type: string
          description: A brief description of the MCP server's capabilities.
        transportType:
          type: string
          description: Type of transport used by the MCP server.
          enum:
            - stdio
            - streamable_http
            - sse
        authorizationType:
          type: string
          description: Type of authorization used by the MCP server.
          enum:
            - none
            - bearer
            - inherit
            - oauth2.0
        authorizationScope:
          type: string
          description: OAuth2.0 authorization scope to request.
        url:
          type: string
          format: uri
          description: URL of the MCP server.
        redirectUrl:
          type: string
          format: uri
          description: Redirect URI for OAuth2.0 authorization.
        token:
          type: string
          description: Bearer token to be used in MCP client.
    AgentsExpert:
      type: object
      required:
        - id
        - type
        - name
        - description
        - systemPrompt
      properties:
        type:
          type: string
          enum:
            - expert
        id:
          type: string
          description: The unique identifier of the expert.
        name:
          type: string
          description: The name of the expert. Must be unique.
          pattern: ^[a-zA-Z0-9_\.-]+$
        description:
          type: string
          description: A brief description of the expert's capabilities.
        systemPrompt:
          type: string
          description: >
            The system prompt that defines the expert's behavior and
            expectations.
        mcpServers:
          type: array
          description: >
            A list of MCP servers that the expert can call. If omitted, the
            expert can't call any MCP Servers.
          items:
            $ref: '#/components/schemas/AgentsMCPServer'
    AgentsExpertReference:
      type: object
      required:
        - type
        - id
        - name
      description: >
        A reference to an expert returned by the API. The expert's id and name
        are always provided. systemPrompt is included only when a registry
        expert was created with a custom system prompt.
      properties:
        type:
          type: string
          enum:
            - reference
        id:
          type: string
          description: The unique identifier of the expert.
        name:
          type: string
          description: The name of the expert.
          pattern: ^[a-zA-Z0-9_\.-]+$
        systemPrompt:
          type: string
          description: >
            Optional. Additional system instructions appended to the default
            system prompt when creating an expert from the registry, extending
            the expert's behavior.
        resolvedConfig:
          type: object
          description: >
            The fully resolved configuration for this expert: schema defaults
            from the registry expert deep-merged with any `config` override
            supplied at creation. Present only when the source registry expert
            defined a `configSchema`.
          additionalProperties: true
    AgentsMCPServer:
      type: object
      required:
        - id
        - name
        - transportType
        - authorizationType
        - url
      properties:
        id:
          type: string
          description: Unique identifier for the MCP server.
        name:
          type: string
          description: Name of the MCP server.
        transportType:
          type: string
          description: Type of transport used by the MCP server.
          enum:
            - stdio
            - streamable_http
            - sse
        authorizationType:
          type: string
          description: Type of authorization used by the MCP server.
          enum:
            - none
            - bearer
            - inherit
            - oauth2.0
        authorizationScope:
          type: string
          description: OAuth2.0 authorization scope to request.
        url:
          type: string
          format: uri
          description: URL of the MCP server.
        redirectUrl:
          type:
            - string
            - 'null'
          format: uri
          description: Redirect URI for OAuth2.0 authorization.
    AgentsValidationError:
      properties:
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        reason:
          type: string
          title: Reason
        howToFix:
          type: string
          title: How to Fix
        errors:
          type: array
          items:
            type: object
            properties:
              location:
                type: string
                title: Location
              reason:
                type: string
                title: Reason
          title: Errors
      type: object
      required:
        - msg
        - type
        - reason
        - howToFix
      title: AgentsValidationError
    AgentsCreateExpertReference:
      type: object
      required:
        - type
      description: >
        A reference to a registry expert when creating an agent, either id or
        name must be provided. If both are passed, the id will be used.
      properties:
        type:
          type: string
          enum:
            - reference
        id:
          type: string
          description: The unique identifier of the expert.
        name:
          type: string
          description: The name of the expert.
          pattern: ^[a-zA-Z0-9_\.-]+$
        systemPrompt:
          type: string
          description: >
            Optional. Additional system instructions appended to the default
            system prompt when creating an expert from the registry, extending
            the expert's behavior.
        config:
          type: object
          description: >
            Optional configuration override for the registry expert. Values
            provided here are deep-merged with the schema defaults declared on
            the registry expert and validated against its `configSchema`.
            Ignored when the registry expert has no schema.
          additionalProperties: true

````