> ## 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. central_ids is accepted whatever the license says. While the license does not include Central, a task of an agent that runs in a Central fails when it starts.



## OpenAPI

````yaml /0.23/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. central_ids is accepted whatever the license says.
        While the license does not include Central, a task of an agent that runs
        in a Central fails when it starts.
      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
                central_ids:
                  type: array
                  items:
                    type: string
                  maxItems: 16
                  description: >-
                    Assigned Centrals. Adds command environments alongside the
                    Host; existing tasks retain their captured choices.
                host_id:
                  type: string
                  description: >-
                    The current Host ID, accepted from clients that send the
                    whole agent back. Changing an existing Host returns 400. A
                    Host can be assigned to a hostless agent. Central
                    assignments preserve the Host.
                main_engine:
                  type: string
                  nullable: true
                  minLength: 1
                  description: >-
                    A model key, or null to inherit the default main engine.
                    Left out, it keeps its value. A key equal to the model the
                    engine inherits keeps following the default, unless
                    pin_engines is true.
                secondary_engine:
                  type: string
                  nullable: true
                  minLength: 1
                  description: >-
                    A model key, or null to inherit the default secondary
                    engine. Left out, it keeps its value. A key equal to the
                    model the engine inherits keeps following the default,
                    unless pin_engines is true.
                pin_engines:
                  type: boolean
                  description: >-
                    true makes a key equal to the model an engine inherits a
                    model of its own. Left out, an engine that inherits and
                    receives exactly that key keeps following the default, so an
                    agent read and sent back stays as it was.
                specialty_id:
                  type: string
                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
              additionalProperties: false
      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,
            STEP_UP_REFUSED, TWO_FACTOR_ENROLLMENT_REQUIRED,
            LICENSE_CAP_REACHED, LICENSE_EXPIRED, FEATURE_NOT_LICENSED with
            details.feature and details.reason `not_licensed`)
          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-...
        specialty:
          allOf:
            - $ref: '#/components/schemas/Specialty'
            - nullable: true
              description: null only on an archived agent whose specialty was deleted
        main_engine:
          type: string
          example: qwen3-coder-480b
          description: >-
            The model key the main engine uses: its own, else the inherited
            default
        main_engine_source:
          type: string
          enum:
            - agent
            - organization
            - tenant
          description: >-
            agent: the engine has a model of its own. organization or tenant:
            the engine inherits the default model of that level.
        secondary_engine:
          type: string
          example: qwen3-coder-30b
          description: >-
            The model key the secondary engine uses: its own, else the inherited
            default
        secondary_engine_source:
          type: string
          enum:
            - agent
            - organization
            - tenant
          description: >-
            agent: the engine has a model of its own. organization or tenant:
            the engine inherits the default model of that level.
        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
        plugin_count:
          type: integer
          minimum: 0
          description: >-
            How many plugins are assigned to the agent, present on the agents
            list and search and on a host's agents
        plugins:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                example: plg_3d1e9a72-...
              name:
                type: string
            required:
              - id
              - name
          description: >-
            The plugins assigned to the agent, sorted by name, present on the
            agents list and search and on a host's agents
        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
        - specialty
        - main_engine
        - main_engine_source
        - secondary_engine
        - secondary_engine_source
        - 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
    Specialty:
      type: object
      properties:
        id:
          type: string
          example: spc_c8f1a2d4-...
        key:
          type: string
          description: Slug derived from the name on create
          example: LINUX_ADMIN
        name:
          type: string
          example: Linux Admin
        prompt:
          type: string
        description:
          type: string
        execution_mode:
          type: string
          nullable: true
          enum:
            - investigate_only
            - auto
            - null
          description: >-
            The mode of the agents with this specialty. investigate_only is
            Plan: each change waits for approval. auto makes changes without
            approval. null follows the organization.
        owner_id:
          type: string
          nullable: true
        org_id:
          type: string
          nullable: true
          description: null is tenant-wide - it governs every org in the tenant
        tenant_id:
          type: string
          example: ten_115bea44-...
        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
        - key
        - name
        - prompt
        - description
        - execution_mode
        - owner_id
        - org_id
        - tenant_id
        - created_at
        - updated_at
  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.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.