# Add a restriction. The same rows close the direct sale

`POST /lodging/restrictions` · Rivier · bookings

Add a restriction. The same rows close the direct sale.

- Scope: bookings:write
- Mcp: rivier_lodging_restriction_set
- Graphql: Mutation.setLodgingRestriction
- Sdk: bookings.restriction.create
- Cli: bookings restriction create
- Events: bookings.restriction.created

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "propertyId": {
      "type": "string",
      "format": "uuid"
    },
    "roomTypeId": {
      "type": "string",
      "format": "uuid"
    },
    "ratePlanId": {
      "type": "string",
      "format": "uuid"
    },
    "from": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "to": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "weekdays": {
      "type": "array",
      "items": {
        "type": "integer",
        "minimum": 1,
        "maximum": 7
      },
      "minItems": 1,
      "maxItems": 7
    },
    "type": {
      "type": "string",
      "enum": [
        "closed_to_arrival",
        "closed_to_departure",
        "stop_sell",
        "min_stay",
        "max_stay",
        "min_advance",
        "max_advance"
      ]
    },
    "value": {
      "type": "integer",
      "minimum": 0,
      "maximum": 3650
    }
  },
  "required": [
    "propertyId",
    "from",
    "to",
    "type"
  ],
  "additionalProperties": false
}
```

## Responses

- `201`: 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/lodging/restrictions' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "propertyId": "string",
  "from": "string",
  "to": "string",
  "type": "closed_to_arrival"
}'
```
