# Bookings session rule create

`POST /bookings/sessions/rules` · Rivier · bookings

Sessions of a group service that repeat on weekdays at a time on the clock of its location, from a date until another (or open). Rivier makes them forward as far as the service takes bookings, and keeps making them; without a capacity of its own each takes the service's and follows it when it changes.

- Scope: bookings:admin
- Sdk: bookings.sessionRule.create
- Cli: bookings session rule create

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "serviceId": {
      "type": "string",
      "format": "uuid"
    },
    "weekdays": {
      "type": "array",
      "items": {
        "type": "integer",
        "minimum": 1,
        "maximum": 7
      },
      "minItems": 1,
      "maxItems": 7
    },
    "time": {
      "type": "string",
      "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
    },
    "durationMinutes": {
      "type": "integer",
      "minimum": 5,
      "maximum": 1440
    },
    "capacity": {
      "type": "integer",
      "minimum": 1,
      "maximum": 10000
    },
    "from": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "until": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    }
  },
  "required": [
    "serviceId",
    "weekdays",
    "time",
    "from"
  ],
  "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/bookings/sessions/rules' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "serviceId": "string",
  "weekdays": [
    0
  ],
  "time": "string",
  "from": "string"
}'
```
