---
title: "Update agent"
method: POST
path: "/v1/agents/{agent_id}"
tags: ["Agents"]
---

# Update agent

`POST /v1/agents/{agent_id}`

## Request

- Base URL: `https://api.sandbase.ai`
- URL: `https://api.sandbase.ai/v1/agents/{agent_id}`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

OpenAI SDK-style partial update. Only the listed fields are accepted; supplied fields replace the saved values and create a new version. No row_version is needed. Archived Agents return 404.

## Headers

- `Idempotency-Key` string
- `OpenAI-Beta` 'agents=v1'

## Request body

- AgentUpdateRequest: SDK-style partial update. description and note are not accepted here; use PATCH for them.
  - `name` string
  - `model` string
  - `instructions` string
  - `metadata` object
  - `service_tier` 'auto' | 'default' | 'flex' | 'priority' | 'fast'
  - `runtime_profile` 'codex' | 'claude' | 'mcode'
  - `tools` object[]
  - `text` AgentText
    - `format` object
      - `type` 'text' | 'json_schema', required
      - `schema` object: Required for json_schema; its type must be object.
    - `verbosity` 'low' | 'medium' | 'high'
  - `reasoning` AgentReasoning
    - `effort` 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'null', nullable
    - `summary` 'concise' | 'detailed' | 'auto' | 'null', nullable
  - `skills` AgentSkillRef[]
    - `skill_id` string, required: Skill ID (`skl_` prefix) owned by your organization or available from the public Skills catalog.
    - `version` string, nullable: Pinned Skill version. For a new binding, null resolves the current default when the Agent is saved. For an existing binding, null retains its pinned version; pass an explicit version to upgrade.
  - `mcp_connections` AgentMCPConnectionRef[]
    - `connection_id` string, required: MCP connection ID (`mcp_` prefix), or builtin:sandbase for the built-in SandBase server.
    - `server_label` string, required: Label unique within the Agent.
    - `allowed_tools` string[], nullable: null allows every tool; an empty array allows none.
    - `required` boolean: Whether the Session must load this server.

## Response `200`

Updated Agent

- Agent
  - `id` string, required: Agent ID (`agt_` prefix).
  - `object` 'agent', required
  - `model` string, required
  - `name` string, nullable, required
  - `instructions` string, nullable, required
  - `tools` object[], required
  - `text` AgentText, required
    - `format` object
      - `type` 'text' | 'json_schema', required
      - `schema` object: Required for json_schema; its type must be object.
    - `verbosity` 'low' | 'medium' | 'high'
  - `reasoning` object, required
  - `service_tier` string, required
  - `multi_agent` object, required: Always reports enabled false.
  - `visibility` 'private' | 'public', required
  - `status` 'active' | 'archived', required
  - `version` integer, required: Current version number.
  - `row_version` integer, required: Compare-and-set token for PATCH, archive, unarchive, and restore.
  - `projection_status` string, required: Whether the current version is ready for execution. Sessions require ready.
  - `runtime_profile` 'codex' | 'claude' | 'mcode', required
  - `description` string, required
  - `metadata` object, required
  - `mcp_connections` AgentMCPConnectionRef[], required
    - `connection_id` string, required: MCP connection ID (`mcp_` prefix), or builtin:sandbase for the built-in SandBase server.
    - `server_label` string, required: Label unique within the Agent.
    - `allowed_tools` string[], nullable: null allows every tool; an empty array allows none.
    - `required` boolean: Whether the Session must load this server.
  - `skills` AgentSkillRef[], required
    - `skill_id` string, required: Skill ID (`skl_` prefix) owned by your organization or available from the public Skills catalog.
    - `version` string, nullable: Pinned Skill version. For a new binding, null resolves the current default when the Agent is saved. For an existing binding, null retains its pinned version; pass an explicit version to upgrade.
  - `created_at` integer, required: Unix seconds.
  - `updated_at` integer, required: Unix seconds.
  - `archived_at` integer, nullable, required: Unix seconds.
  - `failure_code` string

## Other responses

- `400`: invalid_request (malformed JSON, unknown fields, failed validation, or an unsupported option)
- `401`: unauthorized: missing, malformed, or conflicting API key headers
- `402`: spending_limit_exceeded: API key spending limit or organization balance exhausted
- `403`: insufficient_scope (scoped key) or org_disabled
- `404`: not_found: the resource does not exist in this organization
- `409`: conflict: stale row_version, lifecycle state, or Idempotency-Key reused with a different body
- `502`: executor_rejected or executor_contract_error from the execution layer
- `503`: authorization_unavailable, admission_unavailable, executor_unavailable, storage_unavailable, or internal_error

---

[API](https://skmtc.dev/sandbase/apis/sandbase-api.md) · [All operations](https://skmtc.dev/sandbase/apis/sandbase-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sandbase/apis/sandbase-api/revisions/d40df2467ba2?raw)
