Docs navigation
Agents

Update Agent

Update Agent

PATCH/v2/agents/{agent_id}

Update an agent. Fields you omit are left unchanged. HTTP 409 with detail.code=revision_conflict means the agent changed since the revision passed as expected_revision. detail.expected and detail.current carry both revisions. Read the agent again, reapply your change, and retry with the current revision. HTTP 409 with a string detail means mcp_servers omits a server that has a connected OAuth session. Send that server again to keep it, or pass expected_revision to confirm its removal.

Path Parameters

agent_idstring · uuidrequired

Request Body

titlestringoptional
instructionsstringoptional
runtime_kindstringoptional

Harness used by future tasks. Existing tasks keep their runtime.

mcp_serversarray<object>optional
expected_revisionintegeroptional

Revision the update was made against, as GET /v2/cli/agents/{agent_id}/revision returns it. When set, the update applies only if the agent is still at that revision; otherwise 409 with detail.code=revision_conflict. Also confirms removing MCP servers that have a connected OAuth session.

skillsarray<object>optional
secretsobjectoptional
metadataobjectoptional
default_modelstringoptional
shared_folder_enabledbooleanoptional
machine_sizestring · xs | s | m | l | xloptional

T-shirt size labels for sandbox compute tiers. All five labels are part of the public contract so tiers can be added without renaming, but only the sizes present in ``SIZE_RESOURCES`` are provisionable today. ``XS`` and ``XL`` are reserved: XL is blocked on the Daytona per-sandbox resource caps (4 vCPU / 8 GiB), XS on demand.

entrypointstringoptional
Request
curl --request PATCH \
  --url https://api.brainbaselabs.com/v2/agents/{agent_id} \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "title": "string",
  "instructions": "string",
  "runtime_kind": "claude_code",
  "mcp_servers": [
    {
      "name": "string",
      "url": "string",
      "command": "string",
      "args": [
        "string"
      ],
      "env": {
        "property1": "string",
        "property2": "string"
      },
      "headers": {
        "property1": "string",
        "property2": "string"
      },
      "is_enabled": true
    }
  ],
  "expected_revision": 0,
  "skills": [
    {
      "source": "string"
    }
  ],
  "secrets": {
    "property1": "string",
    "property2": "string"
  },
  "metadata": {
    "property1": "string",
    "property2": "string"
  },
  "default_model": "string",
  "shared_folder_enabled": true,
  "machine_size": "xs",
  "entrypoint": "string"
}'
Response
json
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "owner_user_id": "65139110-7c3c-4777-b692-80c218be3b9d",
  "title": "string",
  "instructions": "string",
  "runtime_kind": "string",
  "machine_kind": "string",
  "machine_size": "xs",
  "default_model": "string",
  "accelerator": {
    "kind": "gpu",
    "count": 1,
    "models": [
      "string"
    ]
  },
  "mcp_servers": [
    {
      "name": "string",
      "url": "string",
      "command": "string",
      "args": [
        "string"
      ],
      "env": {
        "property1": "string",
        "property2": "string"
      },
      "headers": {
        "property1": "string",
        "property2": "string"
      },
      "is_enabled": true
    }
  ],
  "skills": [
    {
      "source": "string"
    }
  ],
  "secrets": {
    "property1": "string",
    "property2": "string"
  },
  "metadata": {
    "property1": "string",
    "property2": "string"
  },
  "shared_folder_enabled": false,
  "entrypoint": "",
  "pinned_version_id": "acdd174b-fedb-4cc2-a413-d2bf36fbaf58",
  "pinned_at": "2019-08-24T14:15:22Z",
  "pinned_by": "ac854365-bd10-457f-99b2-5ae470e208e2",
  "template_warnings": [
    "string"
  ],
  "created_at": "2019-08-24T14:15:22Z"
}