# Replace a booking's metadata

`PATCH /bookings/{id}` · Rivier · bookings

Replace a booking's metadata: the caller's own data on it, such as a trip's reference. Written with a key; people see it read-only.

- Scope: bookings:write
- Graphql: Mutation.bookingsBookingUpdate
- Sdk: bookings.booking.update
- Cli: bookings booking update

## Parameters

- `id` (path, required), string

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "metadata": {
      "type": "object",
      "additionalProperties": {
        "type": "string",
        "maxLength": 500
      },
      "propertyNames": {
        "minLength": 1,
        "maxLength": 40,
        "pattern": "^[A-Za-z0-9_.:-]+$"
      }
    }
  },
  "required": [
    "metadata"
  ],
  "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 PATCH 'https://api.rivier.ai/bookings/{id}' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "metadata": {}
}'
```
