# Cancel an Operation

> Coming soon, upon request — this feature is turned on for your tenant by the Aurea team. [Contact us](https://www.aureahub.com/contact)

Cancel one of your own operations while nothing of it was sent: what it prepared can no longer be broadcast.

## Overview

- **Only where your tenant has operation records** [Coming soon, upon request](https://docs.aureahub.com/docs/feature-availability.md) ([Operations & Fees](https://docs.aureahub.com/docs/guide-operations.md)). Otherwise there is no operation to cancel, and every id answers `404` `OPERATION_NOT_FOUND`.
- **Waiting for the client's signature** (`PENDING_SIGNATURE` `awaiting_client_signature` — a client-side or MPC wallet's send, approval or swap handed out to sign): what the client was handed can no longer be broadcast, and a prepared transaction's nonce is free again for the wallet's next preparation.
- **Held for approval** (`PENDING_AUTHORIZATION` `awaiting_approval`, institutional tenants): its approval request is `withdrawn` — an approver deciding afterwards gets `409` `APPROVAL_NOT_PENDING` ([Approvals](https://docs.aureahub.com/docs/guide-approvals.md)).
- **Held for your institution callback** (`PENDING_AUTHORIZATION` `awaiting_callback`, institutional tenants): its callback request is `cancelled` — Aurea asks your endpoint no more ([Institution Callback & Co-Signer](https://docs.aureahub.com/docs/guide-institution-callback.md)). Once your endpoint approved it, it is going on: `409` `OPERATION_IN_PROGRESS`.
- In each case it ends `CANCELLED`, `failureReason` `OPERATION_CANCELLED`, with an `operation.state_changed` event to the endpoints that name it. Its transaction, when it has one — never broadcast — is `cancelled` too: [Get Transaction](https://docs.aureahub.com/docs/tx-get.md) answers `status` `cancelled`, and nothing else of it changes.
- **Its broadcast afterwards** is refused before anything runs: `409` `OPERATION_CANCELLED` (`This operation was cancelled: what it prepared can no longer be broadcast`, `details.operationId`) — for a prepared transaction possibly `409` `PREPARED_TX_CANCELLED` (`This transaction's operation was cancelled: it can no longer be broadcast`). Prepare a new one.
- Cancelling a cancelled operation answers it again, `200`. A cancel and a broadcast at the same moment: one of them wins — never both.
- **Once something was sent**, a cancel is refused (`409`, `details.state` the operation's state). Dropping a sent transaction (replacement by fee) is coming.

| Status | details.code | When |
| --- | --- | --- |
| 409 | OPERATION_ALREADY_BROADCAST | `This operation was already handed to its chain or its provider: it can no longer be cancelled` — `BROADCASTING`, `CONFIRMING`, `COMPLETED` or `CANCELLING`, or its broadcast got there first. |
| 409 | OPERATION_FINAL | `This operation has already ended` — `FAILED`, `BLOCKED` or `REJECTED`. |
| 409 | OPERATION_IN_PROGRESS | `This operation is being signed or sent by the call that started it: it cannot be cancelled now` — passing its first steps, approved (by its approvers or your institution callback) and going on, or being signed by Aurea. |
| 403 | OPERATION_CANCEL_FORBIDDEN | `Only the operation's initiator, with the permission that starts it, may cancel it` |
| 404 | OPERATION_NOT_FOUND | `Operation not found` — not one you may read, or none (and every id while recording is off). |

## Who May Cancel

- **Only the operation's initiator**, holding the permission that starts it — the roles that sign: `user`, `owner`, `tenantadmin`, `signer`. Any other role: `403` `Your role does not have permission to perform this action.`
- A tenant administrator who may read the operation but did not start it: `403` `OPERATION_CANCEL_FORBIDDEN`. So is an operation no user starts through a money route — an MPC signature of a digest, a message signed. Another user's operation, for an end user: `404`.

## Endpoint

### `POST /v1/operations/{id}/cancel`

Authentication: bearer token required.

Cancels one's own operation before anything of it is broadcast.

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string (uuid) | yes | The operation's id |

**Responses**

`200` Cancelled

```json
{
  "id": "1d7a3c52-8e4b-4f19-a0c6-2b9e7d5f3a18",
  "type": "TRANSFER",
  "state": "CANCELLED",
  "subState": null,
  "failureReason": "OPERATION_CANCELLED",
  "legacyStatus": "cancelled",
  "origin": "transactions.create",
  "userId": "5d2c1b0a-9e8f-4a7b-8c6d-5e4f3a2b1c0d",
  "walletId": "7c1e9b24-3f5a-4d8e-9b6c-1a2f3e4d5c6b",
  "chain": "base",
  "chainId": 8453,
  "isTestnet": false,
  "asset": "native",
  "amount": "1000000000000000000",
  "destination": "0x8ba1f109551bD432803012645Ac136ddd64DBA72",
  "externalTxId": null,
  "idempotencyKey": "order-7781",
  "transactionId": "4b2e6f81-0c3d-4a5e-9f7b-8d1c2e3f4a5b",
  "preparedTxId": "9e3d1a7c-5b2f-4c68-8a0e-3f6b1d9c4e27",
  "providerRef": null,
  "tokenizedOperationId": null,
  "txHashes": [],
  "createdAt": "2026-10-07T12:01:44.120Z",
  "updatedAt": "2026-10-07T12:02:30.402Z",
  "finishedAt": "2026-10-07T12:02:30.402Z",
  "sourceAccountId": "5d2c1b0a-9e8f-4a7b-8c6d-5e4f3a2b1c0d",
  "events": [
    { "seq": 1, "state": "SUBMITTED", "subState": null, "failureReason": null, "txHash": null, "at": "2026-10-07T12:01:44.120Z" },
    { "seq": 2, "state": "PENDING_SCREENING", "subState": "not_gated", "failureReason": null, "txHash": null, "at": "2026-10-07T12:01:44.120Z" },
    { "seq": 3, "state": "PENDING_ENRICHMENT", "subState": "not_gated", "failureReason": null, "txHash": null, "at": "2026-10-07T12:01:44.120Z" },
    { "seq": 4, "state": "PENDING_POLICY", "subState": "not_gated", "failureReason": null, "txHash": null, "at": "2026-10-07T12:01:44.120Z" },
    { "seq": 5, "state": "PENDING_AUTHORIZATION", "subState": "not_gated", "failureReason": null, "txHash": null, "at": "2026-10-07T12:01:44.120Z" },
    { "seq": 6, "state": "QUEUED", "subState": "not_gated", "failureReason": null, "txHash": null, "at": "2026-10-07T12:01:44.120Z" },
    { "seq": 7, "state": "PENDING_SIGNATURE", "subState": "awaiting_client_signature", "failureReason": null, "txHash": null, "at": "2026-10-07T12:01:44.120Z" },
    { "seq": 8, "state": "CANCELLED", "subState": null, "failureReason": "OPERATION_CANCELLED", "txHash": null, "at": "2026-10-07T12:02:30.402Z" }
  ]
}
```

`409` Already sent

```json
{
  "statusCode": 409,
  "error": "ConflictError",
  "message": "This operation was already handed to its chain or its provider: it can no longer be cancelled",
  "details": { "code": "OPERATION_ALREADY_BROADCAST", "state": "CONFIRMING" }
}
```

`403` Not the initiator

```json
{
  "statusCode": 403,
  "error": "ForbiddenError",
  "message": "Only the operation's initiator, with the permission that starts it, may cancel it",
  "details": { "code": "OPERATION_CANCEL_FORBIDDEN" }
}
```

`404` Not found

```json
{
  "statusCode": 404,
  "error": "NotFoundError",
  "message": "Operation not found",
  "details": { "code": "OPERATION_NOT_FOUND" }
}
```

**Example request**

```bash
curl -X POST https://api.aureahub.com/v1/operations/1d7a3c52-8e4b-4f19-a0c6-2b9e7d5f3a18/cancel \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

---

Web version: https://docs.aureahub.com/#operation-cancel
