# Cancel a booking

`POST /bookings/{id}/cancel` · Rivier · bookings

Cancel a booking. Shows what the policy makes of it; a dry run changes nothing. Refunds and fees are separate, approved steps. A platform working in the business says by: customer when it passes on its customer's cancel (the policy applies) or platform (the default) for its own, which costs the customer nothing. The same idempotency key gives the same answer again.

- Scope: bookings:write
- Mcp: rivier_booking_cancel
- Graphql: Mutation.cancelBooking
- Sdk: bookings.booking.cancel
- Cli: bookings booking cancel
- Events: bookings.booking.cancelled

## Parameters

- `id` (path, required), string
- `dryRun` (query), string

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "reason": {
      "type": "string",
      "maxLength": 300,
      "default": ""
    },
    "by": {
      "type": "string",
      "enum": [
        "customer",
        "platform"
      ]
    },
    "idempotencyKey": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    }
  },
  "additionalProperties": false
}
```

## Responses

- `200`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X POST 'https://api.rivier.ai/bookings/{id}/cancel' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "reason": "",
  "by": "customer",
  "idempotencyKey": "string"
}'
```
