# Update agent

Renames an agent or changes its team, mandate, rails, kind or budget alert. Console session or API key with agent:create; a revoked agent can't be changed (409).

`PATCH /v1/agents/{id}`

Renames an agent or changes its team, mandate, rails, kind or budget alert. Console session or API key with agent:create; a revoked agent can't be changed (409).

Requires permission `agent:create`.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `id` | path | yes | Agent id (agt_...). |

## Request body

```json
{
  "name": "Example",
  "team_id": "team_01jd2x3k4m5n6p7q8r9s0t1v2w",
  "mandate_id": "mdt_01jd2x3k4m5n6p7q8r9s0t1v2w",
  "rails": [
    "x402"
  ],
  "kind": "string",
  "budget_alert": true
}
```

## Responses

- **200**: Success.
- **400**: Invalid request: a field is missing or malformed (VALIDATION_ERROR).
- **401**: No valid session, API key or agent credential (UNAUTHENTICATED, AGENT_CREDENTIAL_INVALID).
- **403**: Authenticated but not allowed: missing permission, passkey step-up required, or denied by policy.
- **404**: The resource does not exist or belongs to another organization.
- **409**: Conflicts with the current state, for example a reused Idempotency-Key or an illegal state change.

Example 200 response:

```json
{
  "agent": {
    "id": "id_01jd2x3k4m5n6p7q8r9s0t1v2w",
    "name": "Example",
    "status": "active",
    "kind": "string",
    "rails": [
      "x402"
    ],
    "team": {
      "id": "id_01jd2x3k4m5n6p7q8r9s0t1v2w",
      "name": "Example"
    },
    "team_id": "team_01jd2x3k4m5n6p7q8r9s0t1v2w",
    "mandate_id": "mdt_01jd2x3k4m5n6p7q8r9s0t1v2w",
    "mandate": {
      "id": "id_01jd2x3k4m5n6p7q8r9s0t1v2w",
      "version": 1,
      "name": "Example",
      "status": "active",
      "expires_at": "2026-11-16T12:00:00Z",
      "limits": {},
      "allowed_rails": [
        "string"
      ]
    },
    "budget": {
      "id": "id_01jd2x3k4m5n6p7q8r9s0t1v2w",
      "limit": "string",
      "committed": "string",
      "spent": "50000",
      "reserved": "50000",
      "available": "50000",
      "asset": "USDC"
    },
    "last_activity_at": "2026-11-16T12:00:00Z",
    "frozen_reason": "string",
    "revoked_at": "2026-11-16T12:00:00Z",
    "created_at": "2026-11-16T12:00:00Z"
  }
}
```
