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

# Update Agent

> Update an agent

Required scope: `agents:write`, `agents:all`, or `all:all`



## OpenAPI

````yaml api-reference/openapi.json patch /api/v1/agents/{id}
openapi: 3.0.0
info:
  title: OpenSink API
  description: API documentation for OpenSink
  version: 1.0.0
servers:
  - url: https://api.opensink.com
    description: Production Server
security:
  - bearerAuth: []
tags:
  - name: Sink
    description: Sink management endpoints
  - name: Sink Item
    description: Sink item endpoints
  - name: Cron Job
    description: Cron job scheduling endpoints
  - name: Cron Job Run
    description: Cron job execution history
  - name: Agent
    description: Agent management endpoints
  - name: Agent Config
    description: Agent configuration endpoints
  - name: Agent Session
    description: Agent session endpoints
  - name: Agent Session Input Request
    description: Agent session input request endpoints
  - name: Agent Session Activity
    description: Agent session activity log endpoints
paths:
  /api/v1/agents/{id}:
    patch:
      tags:
        - Agent
      summary: Update Agent
      description: |-
        Update an agent

        Required scope: `agents:write`, `agents:all`, or `all:all`
      operationId: updateAgent
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
          description: Agent ID
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 255
                  description: Agent name
                description:
                  type: string
                  description: Agent description
                  nullable: true
                execution_endpoint:
                  type: object
                  nullable: true
                  properties:
                    url:
                      type: string
                      description: Endpoint URL
                    method:
                      type: string
                      enum:
                        - POST
                        - GET
                        - PUT
                        - DELETE
                      description: HTTP method
                    headers:
                      type: object
                      additionalProperties:
                        type: string
                      description: Request headers
                    body:
                      type: object
                      additionalProperties: true
                      description: Request body
                  required:
                    - url
                    - method
                  description: Execution endpoint configuration
      responses:
        '200':
          description: An AI agent with configurable settings
          content:
            application/json:
              schema:
                type: object
                description: An AI agent with configurable settings
                properties:
                  id:
                    type: string
                    format: uuid
                    description: Unique identifier
                  workspace_id:
                    type: string
                    format: uuid
                    description: Workspace ID
                  name:
                    type: string
                    minLength: 1
                    maxLength: 255
                    description: Agent name
                  description:
                    type: string
                    description: Agent description
                    nullable: true
                  config_id:
                    type: string
                    format: uuid
                    description: Current active config ID
                    nullable: true
                  status:
                    type: string
                    enum:
                      - running
                      - waiting_for_input
                      - completed
                      - failed
                    nullable: true
                    description: Agent status based on latest session
                  execution_endpoint:
                    type: object
                    nullable: true
                    properties:
                      url:
                        type: string
                        description: Endpoint URL
                      method:
                        type: string
                        enum:
                          - POST
                          - GET
                          - PUT
                          - DELETE
                        description: HTTP method
                      headers:
                        type: object
                        additionalProperties:
                          type: string
                        description: Request headers
                      body:
                        type: object
                        additionalProperties: true
                        description: Request body
                    required:
                      - url
                      - method
                    description: Execution endpoint configuration
                  created_at:
                    type: string
                    format: date-time
                    description: Creation timestamp
                  updated_at:
                    type: string
                    format: date-time
                    description: Last update timestamp
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Bad request
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Unauthorized
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Insufficient permissions
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Not found
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key authentication

````