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

# Update an agent

> Update an agent



## OpenAPI

````yaml https://api.tembo.io/public-api/openapi/public patch /v1/agents/{agentId}
openapi: 3.1.0
info:
  title: Tembo Public API
  description: Public API Endpoints for Tembo
  version: 1.0.0
servers:
  - url: https://api.tembo.io
    description: Tembo API
  - url: https://{deployment-origin}/api/public-api
    description: Self-hosted Tembo
    variables:
      deployment-origin:
        default: tembo.example.com
        description: Hostname of your self-hosted Tembo deployment
security: []
paths:
  /v1/agents/{agentId}:
    patch:
      tags:
        - Agents
      summary: Update an agent
      description: Update an agent
      operationId: updateAgent
      parameters:
        - in: path
          name: agentId
          schema:
            type: string
            format: uuid
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                expectedUpdatedAt:
                  type: string
                  format: date-time
                name:
                  type: string
                  minLength: 1
                  maxLength: 200
                key:
                  type:
                    - string
                    - 'null'
                  minLength: 1
                  maxLength: 200
                jsonContent:
                  type:
                    - object
                    - 'null'
                  additionalProperties:
                    $ref: '#/components/schemas/AgentJsonValue'
                  description: >-
                    Agent document JSON. This normally contains a TipTap
                    document rooted at { "type": "doc", "content": [...] };
                    unknown and future nodes, marks, attributes, and extensions
                    are preserved.
                  example:
                    type: doc
                    content:
                      - type: paragraph
                        content:
                          - type: text
                            text: Review the latest changes.
                mcpServers:
                  type: array
                  items:
                    type: string
                    minLength: 1
                    maxLength: 200
                  maxItems: 100
                agent:
                  type:
                    - string
                    - 'null'
                  minLength: 1
                  maxLength: 200
                agentOptions:
                  type: object
                  additionalProperties:
                    $ref: '#/components/schemas/AgentJsonValue'
                  description: >-
                    Runtime-specific Agent options. Common options include
                    reasoningLevel, mode, speed, and goal; unknown options are
                    preserved and validated by the selected Agent runtime when
                    used.
                  example:
                    reasoningLevel: high
                    mode: planning
                    speed: fast
                    goal:
                      enabled: true
                      objective: Review the pull request
                userState:
                  type: object
                  additionalProperties:
                    $ref: '#/components/schemas/AgentJsonValue'
                sandboxSize:
                  type:
                    - string
                    - 'null'
                    - 'null'
                  enum:
                    - nano
                    - micro
                    - small
                    - medium
                    - large
                    - xl
                    - xxl
                    - ultra
                    - null
                    - null
                projectId:
                  anyOf:
                    - type: string
                      format: uuid
                    - type: string
                      const: tembo
                    - type: 'null'
                templateId:
                  type:
                    - string
                    - 'null'
                  maxLength: 200
                script:
                  type:
                    - string
                    - 'null'
                  maxLength: 100000
                artifactType:
                  type:
                    - string
                    - 'null'
                    - 'null'
                  enum:
                    - PullRequest
                    - ToolCall
                    - Plan
                    - Response
                    - File
                    - Service
                    - Source
                    - null
                    - null
                autoDetectRepositories:
                  type: boolean
                repositoryIds:
                  type: array
                  items:
                    type: string
                    format: uuid
                  maxItems: 250
                enabled:
                  type: boolean
                archived:
                  type: boolean
              additionalProperties: false
      responses:
        '200':
          description: Update an agent
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  name:
                    type: string
                  key:
                    type:
                      - string
                      - 'null'
                  sandboxSize:
                    type:
                      - string
                      - 'null'
                    enum:
                      - nano
                      - micro
                      - small
                      - medium
                      - large
                      - xl
                      - xxl
                      - ultra
                      - null
                  projectId:
                    type:
                      - string
                      - 'null'
                  templateId:
                    type:
                      - string
                      - 'null'
                  script:
                    type:
                      - string
                      - 'null'
                  artifactType:
                    type:
                      - string
                      - 'null'
                    enum:
                      - PullRequest
                      - ToolCall
                      - Plan
                      - Response
                      - File
                      - Service
                      - Source
                      - null
                  autoDetectRepositories:
                    type: boolean
                    default: true
                  createdAt:
                    type: string
                    format: date-time
                  updatedAt:
                    type: string
                    format: date-time
                  archivedAt:
                    type:
                      - string
                      - 'null'
                    format: date-time
                  enabledAt:
                    type:
                      - string
                      - 'null'
                    format: date-time
                  organizationId:
                    type:
                      - string
                      - 'null'
                    minLength: 1
                    maxLength: 255
                  organizationName:
                    type:
                      - string
                      - 'null'
                  createdBy:
                    type:
                      - string
                      - 'null'
                  jsonContent:
                    type:
                      - object
                      - 'null'
                    additionalProperties:
                      $ref: '#/components/schemas/AgentJsonValue'
                    description: >-
                      Agent document JSON. This normally contains a TipTap
                      document rooted at { "type": "doc", "content": [...] };
                      unknown and future nodes, marks, attributes, and
                      extensions are preserved.
                    example:
                      type: doc
                      content:
                        - type: paragraph
                          content:
                            - type: text
                              text: Review the latest changes.
                  agent:
                    type:
                      - string
                      - 'null'
                  agentOptions:
                    type: object
                    additionalProperties:
                      $ref: '#/components/schemas/AgentJsonValue'
                    description: >-
                      Runtime-specific Agent options. Common options include
                      reasoningLevel, mode, speed, and goal; unknown options are
                      preserved and validated by the selected Agent runtime when
                      used.
                    example:
                      reasoningLevel: high
                      mode: planning
                      speed: fast
                      goal:
                        enabled: true
                        objective: Review the pull request
                  mcpServers:
                    type: array
                    items:
                      type: string
                      minLength: 1
                      maxLength: 200
                    maxItems: 100
                  userState:
                    type:
                      - object
                      - 'null'
                    additionalProperties:
                      $ref: '#/components/schemas/AgentJsonValue'
                  codeRepositories:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                        name:
                          type: string
                        owner:
                          type:
                            - string
                            - 'null'
                        integrationId:
                          type: string
                          format: uuid
                        integrationType:
                          type: string
                      required:
                        - id
                        - name
                        - owner
                        - integrationId
                        - integrationType
                      additionalProperties: false
                    maxItems: 250
                  lastRun:
                    type:
                      - object
                      - 'null'
                    properties:
                      id:
                        type: string
                        format: uuid
                      sessionId:
                        type:
                          - string
                          - 'null'
                      status:
                        type: string
                      runTime:
                        type: integer
                      createdAt:
                        type: string
                        format: date-time
                      updatedAt:
                        type: string
                        format: date-time
                      errorMessage:
                        type:
                          - string
                          - 'null'
                    required:
                      - id
                      - sessionId
                      - status
                      - runTime
                      - createdAt
                      - updatedAt
                      - errorMessage
                    additionalProperties: false
                  runCount:
                    type: integer
                    minimum: 0
                  scheduleCount:
                    type: integer
                    minimum: 0
                  triggerCount:
                    type: integer
                    minimum: 0
                  hasPausedSchedule:
                    type: boolean
                  hasPausedTrigger:
                    type: boolean
                  integrationIds:
                    type: array
                    items:
                      type: string
                      format: uuid
                  integrationTypes:
                    type: array
                    items:
                      type: string
                required:
                  - id
                  - name
                  - key
                  - sandboxSize
                  - projectId
                  - templateId
                  - script
                  - artifactType
                  - autoDetectRepositories
                  - createdAt
                  - updatedAt
                  - archivedAt
                  - enabledAt
                  - organizationId
                  - organizationName
                  - createdBy
                  - jsonContent
                  - agent
                  - agentOptions
                  - mcpServers
                  - userState
                  - codeRepositories
                  - lastRun
                  - runCount
                  - scheduleCount
                  - triggerCount
                  - hasPausedSchedule
                  - hasPausedTrigger
                  - integrationIds
                  - integrationTypes
                additionalProperties: false
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '409':
          description: Resource conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '500':
          description: Agent operation failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
      security:
        - apiKey: []
components:
  schemas:
    AgentJsonValue:
      anyOf:
        - type: 'null'
        - type: boolean
        - type: number
        - type: string
        - type: array
          items:
            $ref: '#/components/schemas/AgentJsonValue'
        - type: object
          additionalProperties:
            $ref: '#/components/schemas/AgentJsonValue'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer

````