# Cancel plan

Cancels a pending or active plan: scheduled pulls are skipped, the remaining reserved budget is released and the on-chain permission is revoked. Requires budget:edit.

`POST /v1/plans/{plan_id}/cancel`

Cancels a pending or active plan: scheduled pulls are skipped, the remaining reserved budget is released and the on-chain permission is revoked. Requires budget:edit.

Requires permission `budget:edit`.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `plan_id` | path | yes | Plan id (pln_...). |

## Responses

- **200**: Success.
- **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.

Example 200 response:

```json
{
  "plan": {
    "id": "id_01jd2x3k4m5n6p7q8r9s0t1v2w",
    "status": "active",
    "kind": "string",
    "offer": {
      "id": "id_01jd2x3k4m5n6p7q8r9s0t1v2w",
      "name": "Example",
      "description": "Example"
    },
    "merchant": {
      "id": "id_01jd2x3k4m5n6p7q8r9s0t1v2w",
      "name": "Example",
      "tier": "VERIFIED"
    },
    "agent": {
      "id": "id_01jd2x3k4m5n6p7q8r9s0t1v2w",
      "name": "Example"
    },
    "pulls_done": 1,
    "count": 1,
    "total_base_units": "50000",
    "amount_base_units": "50000",
    "paid_base_units": "50000",
    "period_seconds": 1,
    "asset": "USDC",
    "network": "eip155:84532"
  },
  "payments": [
    {
      "id": "id_01jd2x3k4m5n6p7q8r9s0t1v2w",
      "seq": 1,
      "amount_base_units": "50000",
      "status": "active",
      "scheduled_at": "2026-11-16T12:00:00Z",
      "pulled_at": "2026-11-16T12:00:00Z",
      "tx_ref": "string",
      "receipt_id": "rcpt_01jd2x3k4m5n6p7q8r9s0t1v2w",
      "retries": 1,
      "error": "string"
    }
  ],
  "released_base_units": "50000",
  "revoke_tx": "string"
}
```
