# Cancel what an event set off

`POST /v1/events/{id}/cancel`

Requires an API key with the `events:write` scope. [About keys and scopes](/docs/api/authentication)

Ends the journey runs this event started that are still going, so a message waiting on a delay is never sent: track `Cart Abandoned`, then cancel it when the order arrives. A message already handed to the provider is not recalled, and the event stays in the contact's history. Cancelling twice ends nothing more. Runs end with the exit reason `cancelled`.

## Path parameters

- `id` (string, required, uuid)

## Returns

Returns `200 OK` with a `CancelledEvent` in `data`. Otherwise returns an error; [Errors](/docs/api/errors) lists every code and which to retry.

- `id` (string, required, uuid)
- `cancelledRuns` (integer, required, min 0, max 9007199254740991) — Journey runs this event started that were still going, now ended.

## Example

```bash
curl -X POST https://api.kirora.io/v1/events/018f2a4e-6b1c-7d3e-9f40-37386ae05a6b/cancel \
  -H "Authorization: Bearer $KIRORA_API_KEY"
```

Response `200`:

```json
{
  "data": {
    "id": "018f2a4e-6b1c-7d3e-9f40-37386ae05a6b",
    "cancelledRuns": 0
  }
}
```
