# Manage your slots

ℹ️ You have to follow the strict order of actions to get available slots: create at least one room, create at least one table and at least one service. To verify if you already have it just use the <mark style="color:green;">**GET**</mark> method to retrieve available resources. Example: <mark style="color:green;">**GET**</mark> /rooms, <mark style="color:green;">**GET**</mark> /tables, <mark style="color:green;">**GET**</mark> /services.

\
⚙️ **Use the base resource URL** for the following examples, or [see the complete collection](https://documenter.getpostman.com/view/50380496/2sB3dK1YWg#79ffebf1-b333-4f0d-981b-3299ae74856e)

```
https://api.octotable.com/octotable-pms/api/v2
```

## 🔍 Find available slots

<mark style="color:green;">**`GET`**</mark> `/bookings/slots`

Returns all time slots for this property from a start day and other filters [see more](https://documenter.getpostman.com/view/50380496/2sB3dK1YWg#79ffebf1-b333-4f0d-981b-3299ae74856e)

**Headers**

| Name            | Value                |
| --------------- | -------------------- |
| `Content-Type`  | `application/json`   |
| `Authorization` | `Bearer <token>`     |
| `Property`      | `<your_property_id>` |

**Query params**

<table><thead><tr><th width="345">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>start_date</code></td><td>date time</td><td>The start day of search</td></tr><tr><td><code>pax</code></td><td>int</td><td>The number of persons</td></tr><tr><td><code>service_id</code></td><td>int</td><td>The id of the selected service</td></tr><tr><td><code>out_of_order</code></td><td>int</td><td>In the <code>out_of_service</code> parameter, when set to <code>true</code>, the system will mark time slots as <code>disabled: true</code> <strong>only if all rooms and all tables are closed</strong> for that specific time slot.</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200 OK" %}

```json
{
    "data": [
        {
            "day": "2024-11-19",
            "available_services": [
                {
                    "id": 30601,
                    "title": "Lunch",
                    "available_slots": [
                        "12:00:00",
                        "12:30:00",
                        "13:00:00",
                        "13:30:00",
                        "14:00:00"
                    ]
                },
                {
                    "id": 30602,
                    "title": "Dinner",
                    "available_slots": [
                        "19:00:00",
                        "19:30:00",
                        "20:00:00",
                        "20:30:00",
                        "21:00:00",
                        "21:30:00",
                        "22:00:00"
                    ]
                }
            ]
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## 🔍 Find available rooms

<mark style="color:green;">**`GET`**</mark> `/bookings/rooms`

Retrieves available rooms and tables for a certain service [see more](https://documenter.getpostman.com/view/50380496/2sB3dK1YWg#79ffebf1-b333-4f0d-981b-3299ae74856e)

**Headers**

| Name            | Value                |
| --------------- | -------------------- |
| `Content-Type`  | `application/json`   |
| `Authorization` | `Bearer <token>`     |
| `Property`      | `<your_property_id>` |

**Query params**

<table><thead><tr><th width="345">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>start_date</code></td><td>date [YYYY-MM-DD]</td><td>The start date of search</td></tr><tr><td><code>start_hour</code></td><td>time [HH:mm:ss]</td><td>The start time of search</td></tr><tr><td><code>pax</code></td><td>int</td><td>The number of persons</td></tr><tr><td><code>service_id</code></td><td>int</td><td>The id of the selected service</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200 OK" %}

```json
{
    "data": [
        [
            {
                "id": 21344,
                "property_id": 999643,
                "name": "Secondary dining room",
                "bookable": true,
                "tables": [
                    {
                        "id": 172246,
                        "name": "T8",
                        "bookable": true,
                        "free": true,
                        "group": false,
                        "guests_max": 10,
                        "guests_min": 1,
                        "room_id": 21344
                    }
                ]
            }
        ]
    ]
}
```

{% endtab %}
{% endtabs %}

## Booking Engine

<mark style="color:green;">**`GET`**</mark> `/bookings/list`

Retrieves booking engine redirect links [see more](https://documenter.getpostman.com/view/50380496/2sB3dK1YWg#79ffebf1-b333-4f0d-981b-3299ae74856e)\
This endpoint returns the main redirect links of the restaurant’s booking interface

**Headers**

| Name            | Value                |
| --------------- | -------------------- |
| `Content-Type`  | `application/json`   |
| `Authorization` | `Bearer <token>`     |
| `Property`      | `<your_property_id>` |

**Response**

{% tabs %}
{% tab title="200 OK" %}

```json
{
    "data": [
        {
            "name": "BOOKING_ENGINE_PAGE",
            "link": "http://localhost:4200/restaurant/999652/booking/new"
        },
        {
            "name": "SERVICES_PAGE",
            "link": "http://localhost:4200/restaurant/999652/booking/home"
        },
        {
            "name": "WELCOME_PAGE",
            "link": "http://localhost:4200/restaurant/999652/welcome"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

**📕 ADDITIONAL NOTES** \
\
🧩 Description of Each Link

| Name                  | Description                                                                                                                                                 |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `BOOKING_ENGINE_PAGE` | This link opens the main booking interface, where users can select a date and time, view available services, and complete a reservation.                    |
| `SERVICES_PAGE`       | This link brings users to the services section. They’ll see a photo carousel and a list of all available services for reservation.                          |
| `WELCOME_PAGE`        | This link takes users to the welcome screen, which displays the restaurant’s logo and welcome message (customizable in *Configuration > Reservation Page*). |

<mark style="color:red;">**out\_of\_order**</mark>: \
\
This is an **optional parameter**.\
\
When set to `true`, the system will mark time slots as `disabled: true` **only if all rooms and tables are closed** for that specific time slot.\
If at least one table is available in any room, `disabled` will remain `false`, as the slot is still considered available.

⚠️ **Important:**\
If this parameter is **not included** in the query params, the system will ignore the out-of-service configuration.\
This means that even if a customer has closed all time slots, rooms, and tables for a given date, the API will still show those slots as available ( `disabled: false` ) unless `out_of_service=true` is explicitly passed.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://octotable-1.gitbook.io/octotable-api/getting-started-with-reservations/manage-your-slots.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
