# ing.opn.booking.cancel

> Cancels a booking, as its host or a holder of its manage token.

- Kind: procedure
- Authority: booking.opn.ing
- Lexicon: 1
- Published by [opn.ing](https://lexicon.garden/identity/did:plc:fd7yovynbzbli5i7m6tu76cl), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:fd7yovynbzbli5i7m6tu76cl/ing.opn.booking.cancel)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:fd7yovynbzbli5i7m6tu76cl/ing.opn.booking.cancel/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:fd7yovynbzbli5i7m6tu76cl/ing.opn.booking.cancel/analytics)

## Procedure (`ing.opn.booking.cancel`)

Type: procedure · POST

### Input (application/json)

- `reason` (string)
  - Constraints: maxLength: 2000
- `token` (string): The booking's manage token, from the email sent to its guest. Not needed by the host.
  - Constraints: maxLength: 128
- `uid` (string, required): The booking's id.
  - Constraints: maxLength: 64

### Output (application/json)

- `booking` (ref, required)
  - Reference: `ing.opn.booking.defs#bookingView`

### Errors

- `BookingNotFound`: No description in schema.
- `BookingNotActive`: No description in schema.
- `CancellingDisabled`: No description in schema.
- `InvalidAnswer`: No description in schema.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Cancels a booking, as its host or a holder of its manage token.",
      "errors": [
        {
          "name": "BookingNotFound"
        },
        {
          "name": "BookingNotActive"
        },
        {
          "name": "CancellingDisabled"
        },
        {
          "name": "InvalidAnswer"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "reason": {
              "maxLength": 2000,
              "type": "string"
            },
            "token": {
              "description": "The booking's manage token, from the email sent to its guest. Not needed by the host.",
              "maxLength": 128,
              "type": "string"
            },
            "uid": {
              "description": "The booking's id.",
              "maxLength": 64,
              "type": "string"
            }
          },
          "required": [
            "uid"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "booking": {
              "ref": "ing.opn.booking.defs#bookingView",
              "type": "ref"
            }
          },
          "required": [
            "booking"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "ing.opn.booking.cancel",
  "lexicon": 1
}
```
