# Revoke agent

Revokes the agent on every rail: credentials, open approvals and pending payments at once, then closes cards, cancels plans and sweeps spending wallets, and adds a signed revocation receipt. Console session or API key with agent:revoke; a console session needs a passkey step-up within the last 5 minutes. Cannot be undone.

`POST /v1/agents/{id}/revoke`

Revokes the agent on every rail: credentials, open approvals and pending payments at once, then closes cards, cancels plans and sweeps spending wallets, and adds a signed revocation receipt. Console session or API key with agent:revoke; a console session needs a passkey step-up within the last 5 minutes. Cannot be undone.

Requires permission `agent:revoke`.

## Parameters

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

## Request body

```json
{
  "sweep": true,
  "webauthn_assertion": {}
}
```

## 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
{
  "revocation": {
    "agent_id": "agt_01jd2x3k4m5n6p7q8r9s0t1v2w",
    "status": "active",
    "revoked_at": "2026-11-16T12:00:00Z",
    "receipt_id": "rcpt_01jd2x3k4m5n6p7q8r9s0t1v2w"
  },
  "effects": {
    "credentials_active": 1,
    "open_approvals": 1,
    "reserved_intents": 1,
    "reserved_base_units": "50000",
    "cards_active": 1,
    "plans_active": 1,
    "spending_wallets_with_balance": 1,
    "spending_wallet_balance_base_units": "50000",
    "in_flight": [
      {
        "intent_id": "pi_01jd2x3k4m5n6p7q8r9s0t1v2w",
        "status": "active",
        "amount_base_units": "50000",
        "asset": "USDC",
        "network": "eip155:84532",
        "rail": "x402"
      }
    ],
    "lines": [
      "string"
    ],
    "credentials_revoked": 1,
    "approvals_invalidated": 1,
    "intents_denied": 1,
    "intent_ids": [
      "pi_01jd2x3k4m5n6p7q8r9s0t1v2w"
    ]
  }
}
```
