> ## Documentation Index
> Fetch the complete documentation index at: https://docs.koulis.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Opening Hours API — Manage Your Service Periods

> CRUD for opening hours — define services per day with open/close times, slot duration, and interval via /api/v1/restaurant/me/hours. JWT required.

The opening hours endpoints let you manage when your restaurant accepts reservations. Each record represents one service period on one day of the week — for example, a Saturday lunch service running from 12:00 to 15:00 with 90-minute slots every 30 minutes. All requests require a valid JWT Bearer token.

The `day_of_week` field maps days to integers as follows:

| Value | Day       |
| ----- | --------- |
| `0`   | Monday    |
| `1`   | Tuesday   |
| `2`   | Wednesday |
| `3`   | Thursday  |
| `4`   | Friday    |
| `5`   | Saturday  |
| `6`   | Sunday    |

***

## List opening hours

Returns all service periods configured for your restaurant.

### Endpoint

```
GET https://api.lakreme.fr/api/v1/restaurant/me/hours
```

<RequestExample>
  ```bash cURL theme={null}
  curl https://api.lakreme.fr/api/v1/restaurant/me/hours \
    -H "Authorization: Bearer YOUR_JWT_TOKEN"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  [
    {
      "id": "hrs_001",
      "day_of_week": 5,
      "service_name": "Lunch",
      "open_time": "12:00",
      "close_time": "15:00",
      "slot_duration_min": 90,
      "slot_interval_min": 30,
      "is_active": true
    },
    {
      "id": "hrs_002",
      "day_of_week": 5,
      "service_name": "Dinner",
      "open_time": "19:00",
      "close_time": "23:00",
      "slot_duration_min": 120,
      "slot_interval_min": 30,
      "is_active": true
    }
  ]
  ```
</ResponseExample>

***

## Create an opening hours entry

Adds a new service period. You can add multiple services per day — for example, a separate lunch and dinner service on the same day.

### Endpoint

```
POST https://api.lakreme.fr/api/v1/restaurant/me/hours
```

### Request body

<ParamField body="day_of_week" type="number" required>
  Day of the week as an integer. `0` = Monday through `6` = Sunday.
</ParamField>

<ParamField body="open_time" type="string" required placeholder="HH:MM">
  The time when the first reservation slot opens, in `HH:MM` format (24-hour clock). For example, `"12:00"`.
</ParamField>

<ParamField body="close_time" type="string" required placeholder="HH:MM">
  The time when the last reservation slot ends, in `HH:MM` format. For example, `"15:00"`.
</ParamField>

<ParamField body="slot_duration_min" type="number" required>
  How long each reservation lasts, in minutes. For example, `90` means tables are held for 90 minutes per booking.
</ParamField>

<ParamField body="slot_interval_min" type="number" required>
  How frequently a new slot starts, in minutes. For example, `30` means slots are offered at :00, :30, and so on within the service window.
</ParamField>

<ParamField body="service_name" type="string">
  Optional name for this service period — for example, `"Lunch"`, `"Brunch"`, or `"Dinner"`. Displayed in the booking widget to help guests identify the service.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.lakreme.fr/api/v1/restaurant/me/hours \
    -H "Authorization: Bearer YOUR_JWT_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "day_of_week": 5,
      "service_name": "Lunch",
      "open_time": "12:00",
      "close_time": "15:00",
      "slot_duration_min": 90,
      "slot_interval_min": 30
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "id": "hrs_003",
    "day_of_week": 5,
    "service_name": "Lunch",
    "open_time": "12:00",
    "close_time": "15:00",
    "slot_duration_min": 90,
    "slot_interval_min": 30,
    "is_active": true
  }
  ```
</ResponseExample>

***

## Update an opening hours entry

Updates one or more fields on an existing service period. Only include the fields you want to change.

### Endpoint

```
PATCH https://api.lakreme.fr/api/v1/restaurant/me/hours/{id}
```

<ParamField path="id" type="string" required>
  The ID of the opening hours entry to update.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X PATCH https://api.lakreme.fr/api/v1/restaurant/me/hours/hrs_003 \
    -H "Authorization: Bearer YOUR_JWT_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "close_time": "14:30",
      "is_active": false
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "hrs_003",
    "day_of_week": 5,
    "service_name": "Lunch",
    "open_time": "12:00",
    "close_time": "14:30",
    "slot_duration_min": 90,
    "slot_interval_min": 30,
    "is_active": false
  }
  ```
</ResponseExample>

***

## Delete an opening hours entry

Permanently deletes a service period. Returns `204 No Content` on success.

### Endpoint

```
DELETE https://api.lakreme.fr/api/v1/restaurant/me/hours/{id}
```

<ParamField path="id" type="string" required>
  The ID of the opening hours entry to delete.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X DELETE https://api.lakreme.fr/api/v1/restaurant/me/hours/hrs_003 \
    -H "Authorization: Bearer YOUR_JWT_TOKEN"
  ```
</RequestExample>

<ResponseExample>
  ```json 204 theme={null}
  ```
</ResponseExample>
