> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rebelfi.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel Operation

> POST /v1/operations/:id/cancel — Cancel a pending operation

<Note>
  **Endpoint:** `POST https://api.rebelfi.io/v1/operations/:id/cancel`
</Note>

Cancel a pending operation. Only operations that haven't been submitted to the blockchain can be cancelled.

### Path Parameters

| Parameter | Type     | Required | Description            |
| --------- | -------- | -------- | ---------------------- |
| `id`      | `number` | Yes      | Operation ID to cancel |

### Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.rebelfi.io/v1/operations/123/cancel" \
    -H "x-api-key: your_api_key"
  ```

  ```typescript SDK theme={null}
  const result = await client.operations.cancel(123);
  ```
</CodeGroup>

### Example Response

```json theme={null}
{
  "operationId": 123,
  "status": "CANCELLED",
  "success": true
}
```

### Errors

| Code                       | Description                                                   |
| -------------------------- | ------------------------------------------------------------- |
| `OPERATION_NOT_FOUND`      | Operation ID doesn't exist                                    |
| `INVALID_OPERATION_STATUS` | Operation has already been submitted, confirmed, or cancelled |

<Tip>
  In most cases you don't need to cancel manually. Simply create a new operation — any pending operations for the same wallet are automatically cancelled.
</Tip>
