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

# Update an agent

> Partial update. host_id and plugin_ids are not accepted here and are dropped silently.



## OpenAPI

````yaml /openapi.json post /api/v1/agents/{id}
openapi: 3.0.3
info:
  title: 2501 Public API
  version: v1
  description: >-
    The stable, versioned HTTP API for driving 2501 as code. See the API
    Overview for authentication, the org_id rule, cursor pagination, and the
    error envelope.
servers:
  - url: https://{command_center_host}
    variables:
      command_center_host:
        default: your-command-center-host
        description: Your Command Center host
security:
  - bearerAuth: []
paths:
  /api/v1/agents/{id}:
    post:
      tags:
        - Agents
      summary: Update an agent
      description: >-
        Partial update. host_id and plugin_ids are not accepted here and are
        dropped silently.
      parameters:
        - schema:
            type: string
          required: true
          name: id
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 100
                main_engine:
                  type: string
                  minLength: 1
                secondary_engine:
                  type: string
                  minLength: 1
                specialty_id:
                  type: string
                remote_execution:
                  type: boolean
                credential_config:
                  type: array
                  items:
                    type: object
                    properties:
                      order:
                        type: integer
                        minimum: 1
                      is_required:
                        type: boolean
                        default: true
                      credential_id:
                        type: string
                      credential_role:
                        type: string
                        enum:
                          - ssh_username
                          - ssh_password
                          - ssh_private_key
                          - ssh_public_key
                    required:
                      - order
                      - credential_id
                      - credential_role
                accessible_credential_ids:
                  type: array
                  items:
                    type: string
                disabled_rule_ids:
                  type: array
                  items:
                    type: string
      responses:
        '200':
          description: The updated agent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agent'
        '400':
          description: >-
            Bad request - a field is missing, malformed, or not allowed
            (VALIDATION_FAILED, BAD_REQUEST, INVALID_CURSOR)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: >-
            No credentials, or a key that is invalid, revoked, or expired
            (UNAUTHORIZED)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Authenticated but not allowed (FORBIDDEN, ORG_ACCESS_DENIED,
            LICENSE_CAP_REACHED, LICENSE_EXPIRED)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No such row that this caller can see (NOT_FOUND)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Agent:
      type: object
      properties:
        id:
          type: string
          example: agt_a9bf5a2b-...
        name:
          type: string
          example: linux-ops - web-01
        status:
          type: string
          enum:
            - idle
            - running
            - error
            - archived
        org_id:
          type: string
          example: org_460b541c-...
        tenant_id:
          type: string
          example: ten_115bea44-...
        host_id:
          type: string
          nullable: true
          example: hst_8272f9b4-...
        specialty_id:
          type: string
          example: spc_9e274f8c-...
        main_engine:
          type: string
          example: qwen3-coder-480b
        secondary_engine:
          type: string
          example: qwen3-coder-30b
        remote_execution:
          type: boolean
        credential_config:
          type: array
          nullable: true
          items:
            type: object
            properties:
              credential_id:
                type: string
                example: crd_1f3c8a90-...
              credential_role:
                type: string
                enum:
                  - ssh_username
                  - ssh_password
                  - ssh_private_key
                  - ssh_public_key
              order:
                type: integer
              is_required:
                type: boolean
            required:
              - credential_id
              - credential_role
              - order
              - is_required
        disabled_rule_ids:
          type: array
          items:
            type: string
        accessible_credential_ids:
          type: array
          items:
            type: string
        created_at:
          type: string
          format: date-time
          example: '2026-08-26T10:00:26.380Z'
        updated_at:
          type: string
          format: date-time
          example: '2026-08-26T10:00:26.380Z'
      required:
        - id
        - name
        - status
        - org_id
        - tenant_id
        - host_id
        - specialty_id
        - main_engine
        - secondary_engine
        - remote_execution
        - credential_config
        - disabled_rule_ids
        - accessible_credential_ids
        - created_at
        - updated_at
    Error:
      type: object
      properties:
        code:
          type: string
          example: VALIDATION_FAILED
        message:
          type: string
          example: Validation failed
        request_id:
          type: string
          example: req_3702b7e7-...
        field:
          type: string
          description: Set when one input is at fault
        errors:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
              message:
                type: string
            required:
              - field
              - message
          description: Set when several inputs are at fault
        details:
          type: object
          additionalProperties:
            nullable: true
      required:
        - code
        - message
        - request_id
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An API key minted in Command Center (Settings -> API Keys), sent as
        `Authorization: Bearer 2501_ak_...`. A Command Center session cookie is
        also accepted.

````