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

# Opening hours

> Read and replace weekly delivery and pickup schedules for a location.

Opening hours contain separate weekly schedules for `delivery` and `pickup`.

| Action  | Endpoint                                        | Permission                   |
| ------- | ----------------------------------------------- | ---------------------------- |
| Read    | `GET /v1/locations/{location_id}/opening_hours` | `openingHoursSettings.read`  |
| Replace | `PUT /v1/locations/{location_id}/opening_hours` | `openingHoursSettings.write` |

Each schedule has a key for every weekday. A day contains an array of `{ "from": "HH:MM", "to": "HH:MM" }` ranges; an empty array means closed. Times are local wall-clock times in the location's configured timezone.

<Note>
  A time range cannot cross midnight. For opening hours from 11:00 on Monday until 02:00 on Tuesday morning, configure `monday` with `{ "from": "11:00", "to": "23:59" }` and `tuesday` with `{ "from": "00:00", "to": "02:00" }`.
</Note>

## Read the current schedule

```bash theme={null}
curl https://server.chataigne.ai/v1/locations/loc_r8v4n2c6tz/opening_hours \
  -H "x-api-key: $CHATAIGNE_API_KEY"
```

## Replace the schedule

<Warning>
  `PUT` replaces the schedule. Send every weekday for both delivery and pickup, including empty arrays for closed days. Do not send only the days that changed.
</Warning>

```bash theme={null}
curl https://server.chataigne.ai/v1/locations/loc_r8v4n2c6tz/opening_hours \
  -X PUT \
  -H "x-api-key: $CHATAIGNE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "delivery": {
      "monday": [{"from":"11:30","to":"14:00"},{"from":"18:00","to":"22:30"}],
      "tuesday": [{"from":"11:30","to":"14:00"},{"from":"18:00","to":"22:30"}],
      "wednesday": [{"from":"11:30","to":"14:00"},{"from":"18:00","to":"22:30"}],
      "thursday": [{"from":"11:30","to":"14:00"},{"from":"18:00","to":"22:30"}],
      "friday": [{"from":"11:30","to":"14:00"},{"from":"18:00","to":"23:00"}],
      "saturday": [{"from":"18:00","to":"23:00"}],
      "sunday": []
    },
    "pickup": {
      "monday": [{"from":"11:00","to":"22:30"}],
      "tuesday": [{"from":"11:00","to":"22:30"}],
      "wednesday": [{"from":"11:00","to":"22:30"}],
      "thursday": [{"from":"11:00","to":"22:30"}],
      "friday": [{"from":"11:00","to":"23:00"}],
      "saturday": [{"from":"11:00","to":"23:00"}],
      "sunday": []
    }
  }'
```

Use [Special closings](/location-organization-management/special-closings) for one-off closures without changing the recurring weekly schedule.
