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

# Update an Agent

> This request can be used to update Hybrid Agents. The following fields can be updated:

- name - The name of the Agent.
- description - The description for the agent.
- enableAutoUpdates - Enabling Automatic Updates for the Agent. Note, this cannot be set for Snowflake Agents.
- restrictedAccess - Set to true and use in conjunction with the Allow list if you wish to restrict the use of the agent to specified Environments and Projects.
- trackName - The version track name for the Agent (CURRENT or STABLE). Note, Snowflake agents cannot be updated.

Please note, all the above fields are optional



## OpenAPI

````yaml /openapi/public-api-endpoint-reference.yaml patch /v1/agents/{agentId}
openapi: 3.1.0
info:
  title: Maia Public REST API
  version: '1.0'
servers:
  - description: EU1
    url: https://eu1.api.matillion.com/dpc
  - description: US1
    url: https://us1.api.matillion.com/dpc
security:
  - bearerAuth: []
tags:
  - description: Manage Schedules
    name: Schedules
  - description: Manage Connections
    name: Connections
  - description: Operations for managing Project Variables
    name: Project Variables
  - description: Manage Pipelines
    name: Pipelines
  - description: Review pipelines against quality rules
    name: Pipeline Quality Review
  - description: Execute tests within a project
    name: Test Execution
  - description: Manage your AI agent tasks
    name: AI Agent Tasks
  - description: SCIM endpoints for user/group permission management
    name: Directory Integration
  - description: Publish shared pipeline artifacts
    name: Shared Pipeline Artifacts
  - description: Manage Repositories
    name: Repositories
  - description: Report on Credit Consumption
    name: Consumption
  - description: Manage Artifacts
    name: Artifacts
  - description: Operations for data lineage and governance
    name: Data Lineage
  - description: Manage Streaming Pipelines
    name: Streaming Pipelines
  - description: Execute a pipeline
    name: Pipeline Execution
  - description: ''
    name: Environments
  - description: ''
    name: Projects
  - description: Manage Agents
    name: Agents
  - description: Operations for managing Environment-level Overrides of Project Variables
    name: Project Variable Environment Overrides
  - description: Query audit events
    name: Audit Events
  - description: Connector Profiles
    name: Connectors
paths:
  /v1/agents/{agentId}:
    patch:
      tags:
        - Agents
      summary: Update an Agent
      description: >-
        This request can be used to update Hybrid Agents. The following fields
        can be updated:


        - name - The name of the Agent.

        - description - The description for the agent.

        - enableAutoUpdates - Enabling Automatic Updates for the Agent. Note,
        this cannot be set for Snowflake Agents.

        - restrictedAccess - Set to true and use in conjunction with the Allow
        list if you wish to restrict the use of the agent to specified
        Environments and Projects.

        - trackName - The version track name for the Agent (CURRENT or STABLE).
        Note, Snowflake agents cannot be updated.


        Please note, all the above fields are optional
      operationId: updateAgent
      parameters:
        - description: The ID of the agent to update
          in: path
          name: agentId
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            examples:
              Patch Request for a single field:
                description: Example request to update only the track name of the agent
                value:
                  trackName: STABLE
              Patch Request for multiple fields:
                description: Example request updating both track name and description
                value:
                  name: Generic Agent
                  description: An updated agent description
                  trackName: STABLE
                  restrictedAccess: false
                  enableAutoUpdates: true
            schema:
              $ref: '#/components/schemas/AgentUpdate'
        required: true
      responses:
        '202':
          description: Agent successfully updated
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
                example:
                  type: https://api.matillion.com/problems/bad-request
                  title: Bad Request
                  status: 400
                  detail: Failed to read request. Please check your request body.
                  instance: /v1/agents/{agentId}
          description: Wrong request parameters used
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
                example:
                  type: https://api.matillion.com/problems/forbidden
                  title: Forbidden
                  status: 403
                  detail: You do not have permission to access this resource.
                  instance: /v1/agents/{agentId}
          description: Forbidden
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
                example:
                  type: https://api.matillion.com/problems/not-found
                  title: Not Found
                  status: 404
                  detail: The requested agent does not exist.
                  instance: /v1/agents/{agentId}
          description: Agent not found
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
                example:
                  type: https://api.matillion.com/problems/internal-server-error
                  title: Internal Server Error
                  status: 500
                  detail: Unexpected error occurred while processing the request.
                  instance: /v1/agents/{agentId}
          description: Unexpected error occurred
components:
  schemas:
    AgentUpdate:
      type: object
      properties:
        description:
          type: string
          description: The updated description to be applied to the Agent
          example: An AWS Agent
          maxLength: 500
          minLength: 0
        enableAutoUpdates:
          type: string
          description: |-
            Set whether the Agent should automatically update.

            Note, Snowflake agents cannot have this value changed.
          example: 'true'
        name:
          type: string
          description: The updated name to be applied to the Agent
          example: AWS Agent
          maxLength: 30
          minLength: 1
        restrictedAccess:
          type: string
          description: >-
            Set whether the Agent should be restricted to a specific set of
            projects. If set to true, the Agent will only be applicable to
            projects it is scoped to have access to.


            Note, this cannot be set for Streaming Agents.
          example: 'true'
        trackName:
          type: string
          description: >-
            The version track name to set for the Agent. Must be either CURRENT
            or STABLE.


            Note, Snowflake agents cannot be updated.
          enum:
            - CURRENT
            - STABLE
          example: CURRENT
    ProblemDetail:
      type: object
      properties:
        detail:
          type: string
        instance:
          type: string
        status:
          type: integer
          format: int32
        title:
          type: string
        type:
          type: string
          format: uri
        violations:
          type: array
          items:
            type: string
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      description: a valid bearer token
      scheme: bearer
      type: http

````