# Manage your tables

ℹ️ **A table** is an entity used within a room to accommodate guests. **A room component** is an entity used within a room to accommodate guests. Components can include tables, sunbeds, armchair, beach umbrella, etc.&#x20;

\
⚙️ **Use the base resource URL** for the following examples, or  [see the complete collection](https://documenter.getpostman.com/view/50380496/2sB3dK1YWg#7a9c067e-4fe3-40f3-a4b3-07c66f85aa8b)

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

## 🔍 Find all tables

<mark style="color:green;">**`GET`**</mark> `/room/{room_id}/tables?start_date=2024-11-19&pax=1&service_id={service_id}`

Retrieves a list of available tables for the specified property (e.g., restaurant) [see more](https://documenter.getpostman.com/view/50380496/2sB3dK1YWg#7a9c067e-4fe3-40f3-a4b3-07c66f85aa8b)\
To find all the table of a specific Room, you need to change the `{room_id}` parameter to the ID of the Room that was previously created, as well as change the`{service_id}` with ID of the service you want to see the availabilities for.

**Headers**

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

**Example**

{% tabs %}
{% tab title="Request" %}

```json
curl --location "https://api.octotable.com/octotable-pms/api/v2/room/18802/tables" \
--header "Cache-Control: no-cache" \
--header "Postman-Token: <calculated when request is sent>" \
--header "Host: <calculated when request is sent>" \
--header "User-Agent: PostmanRuntime/7.32.1" \
--header "Accept: */*" \
--header "Accept-Encoding: gzip, deflate, br" \
--header "Connection: keep-alive" \
--header "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJndWVzdCIsImlzcyI6Ik9DVE9SQVRFLVNSTCIsImV4cCI6MTcwMDY1MTY3MywiaWF0IjoxNjk5MzU1NjczLCJqdGkiOiI5OGJmZTVjMi1iYmUxLTRiMDItYWM1ZC00Njk5MTFlOGJjZDIiLCJncm91cHMiOlsiZ3Vlc3QiXSwicHJvcGVydHlfaWQiOjQ0NDc3fQ.VEsHWJ-_-R9HDhZ8L-PJ0mmqGMSu92Km9wRImGh-pSsz0wU4rKPll5SFlu_XLllGfz38f522z9jjlsNhtNlxhrCR3h1eFfQjyY2fM_8ZHh75KKaASL0U1pIwG1HKf2JTrMu9ceHqpfm2yJ5_KQgLipZRMfpCutOVx-5Lnq023Km0unz-Snb-XSP8gK8KMtRuutj8lkOFiZLskKHNIlIHJ4lUsKoh8C2GB7O3IOaKab3m6ETwB9oux8vWoB6pE6T14F9nNW1NhWfBzqSH3yC5ZA2WSZCDmFQjuInDS7BSsIKqPS8Z491ehOsZhycvchW7aSkWJ9uyX58ef0iJkqN0BQ" \
--header "Property: 44477"{
```

{% endtab %}

{% tab title="Response" %}

```json
{
  "data": [
    {
      "id": 148129,
      "name": "10",
      "bookable": true,
      "free": true,
      "group": false,
      "room_id": 18802,
      "table_type": "Q2"
    },
    {
      "id": 148130,
      "name": "11",
      "bookable": true,
      "free": true,
      "group": false,
      "room_id": 18802,
      "table_type": "Q2"
    },
    {
      "id": 148136,
      "name": "12",
      "bookable": true,
      "free": true,
      "group": false,
      "room_id": 18802,
      "table_type": "Q2"
    },
    {
      "id": 148131,
      "name": "13",
      "bookable": true,
      "free": true,
      "group": false,
      "room_id": 18802,
      "table_type": "Q2"
    },
    {
      "id": 148122,
      "name": "14",
      "bookable": true,
      "free": true,
      "group": false,
      "room_id": 18802,
      "table_type": "Q2"
    },
    {
      "id": 148135,
      "name": "15",
      "bookable": true,
      "free": true,
      "group": false,
      "room_id": 18802,
      "table_type": "Q2"
    },
    {
      "id": 148126,
      "name": "4",
      "bookable": true,
      "free": true,
      "group": false,
      "room_id": 18802,
      "table_type": "Q2"
    },
    {
      "id": 148134,
      "name": "5",
      "bookable": true,
      "free": true,
      "group": false,
      "room_id": 18802,
      "table_type": "Q2"
    },
    {
      "id": 148123,
      "name": "6",
      "bookable": true,
      "free": true,
      "group": false,
      "room_id": 18802,
      "table_type": "Q2"
    },
    {
      "id": 148124,
      "name": "7",
      "bookable": true,
      "free": true,
      "group": false,
      "room_id": 18802,
      "table_type": "Q2"
    },
    {
      "id": 148127,
      "name": "8",
      "bookable": true,
      "free": true,
      "group": false,
      "room_id": 18802,
      "table_type": "Q2"
    },
    {
      "id": 148125,
      "name": "9",
      "bookable": true,
      "free": true,
      "group": false,
      "room_id": 18802,
      "table_type": "Q2"
    }
  ],
  "page_number": 0,
  "page_size": 0,
  "total_elements": 0,
  "total_pages": 0,
  "last_page": true,
  "links": []
}
```

{% endtab %}
{% endtabs %}

## 🔍 Find a table

<mark style="color:green;">**`GET`**</mark> `/room/{room_id}/table/{table_id}`

Retrieves details of a specific table for the given property using the table ID [see more](https://documenter.getpostman.com/view/50380496/2sB3dK1YWg#7a9c067e-4fe3-40f3-a4b3-07c66f85aa8b)\
To find tables of different Rooms, you need to change the `{room_id}` parameter to the ID of the Room that was previously created.

**Headers**

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

**Example**

{% tabs %}
{% tab title="Request" %}

```json
curl --location "https://api.octotable.com/octotable-pms/api/v2/room/18802/table/148129" \
--header "Cache-Control: no-cache" \
--header "Postman-Token: <calculated when request is sent>" \
--header "Host: <calculated when request is sent>" \
--header "User-Agent: PostmanRuntime/7.32.1" \
--header "Accept: */*" \
--header "Accept-Encoding: gzip, deflate, br" \
--header "Connection: keep-alive" \
--header "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJndWVzdCIsImlzcyI6Ik9DVE9SQVRFLVNSTCIsImV4cCI6MTcwMDY1MTY3MywiaWF0IjoxNjk5MzU1NjczLCJqdGkiOiI5OGJmZTVjMi1iYmUxLTRiMDItYWM1ZC00Njk5MTFlOGJjZDIiLCJncm91cHMiOlsiZ3Vlc3QiXSwicHJvcGVydHlfaWQiOjQ0NDc3fQ.VEsHWJ-_-R9HDhZ8L-PJ0mmqGMSu92Km9wRImGh-pSsz0wU4rKPll5SFlu_XLllGfz38f522z9jjlsNhtNlxhrCR3h1eFfQjyY2fM_8ZHh75KKaASL0U1pIwG1HKf2JTrMu9ceHqpfm2yJ5_KQgLipZRMfpCutOVx-5Lnq023Km0unz-Snb-XSP8gK8KMtRuutj8lkOFiZLskKHNIlIHJ4lUsKoh8C2GB7O3IOaKab3m6ETwB9oux8vWoB6pE6T14F9nNW1NhWfBzqSH3yC5ZA2WSZCDmFQjuInDS7BSsIKqPS8Z491ehOsZhycvchW7aSkWJ9uyX58ef0iJkqN0BQ" \
--header "Property: {{propId}}"
```

{% endtab %}

{% tab title="Response" %}

```json
{
  "data": [
    {
      "id": 148129,
      "name": "My table",
      "bookable": true,
      "free": true,
      "group": false,
      "room_id": 18802,
      "table_type": "Q2"
    }
  ],
  "page_number": 0,
  "page_size": 0,
  "total_elements": 0,
  "total_pages": 0,
  "last_page": true,
  "links": []
}
```

{% endtab %}
{% endtabs %}

## 🆕 Create a new table

<mark style="color:yellow;">**`POST`**</mark> `/room/{room_id}/table`

Creates a new table for the specified property using the provided table details [see more](https://documenter.getpostman.com/view/50380496/2sB3dK1YWg#7a9c067e-4fe3-40f3-a4b3-07c66f85aa8b)

To create a table in different Rooms, you need to change the `{room_id}` parameter to the ID of the Room that was previously created.

⚠️ **Reserve with Google updates could take up to 24 hours to process.**

**Headers**

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

**Body**

<table><thead><tr><th width="207">Name</th><th width="188">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>name</code></td><td>string</td><td>Name of the table</td></tr><tr><td><code>bookable</code></td><td>boolean</td><td>Indicates whether a table can be booked online. When set to <strong>true</strong>, the table is available for online reservations. <br>If set to <strong>false</strong>, the table can only be booked offline, such as by phone or in-person.</td></tr><tr><td><code>free</code></td><td>boolean</td><td>This status indicates that a table is <strong>available for a new reservation</strong> and is linked to the average meal duration. <br>It means enough time has passed or is available based on the expected meal duration, making the table ready for the next booking</td></tr><tr><td><code>group</code></td><td>boolean</td><td>This concept refers to the ability to <strong>combine multiple tables</strong> to accommodate larger parties.</td></tr><tr><td><code>guest_min</code></td><td>int</td><td>The <strong>smallest number of people a table can seat</strong>. It prevents the table from being reserved for groups smaller than this number,</td></tr><tr><td><code>guest_max</code></td><td>int</td><td>The <strong>largest number of people a table can seat</strong>. This limit ensures that a table is not booked for groups exceeding its seating capacity,</td></tr></tbody></table>

**Example**

{% tabs %}
{% tab title="Request" %}

```json
curl --location "https://api.octotable.com/octotable-pms/api/v2/room/0/table" \
--header "Cache-Control: no-cache" \
--header "Postman-Token: <calculated when request is sent>" \
--header "Host: <calculated when request is sent>" \
--header "User-Agent: PostmanRuntime/7.32.1" \
--header "Accept: */*" \
--header "Accept-Encoding: gzip, deflate, br" \
--header "Connection: keep-alive" \
--header "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJndWVzdCIsImlzcyI6Ik9DVE9SQVRFLVNSTCIsImV4cCI6MTcwMDY1MTY3MywiaWF0IjoxNjk5MzU1NjczLCJqdGkiOiI5OGJmZTVjMi1iYmUxLTRiMDItYWM1ZC00Njk5MTFlOGJjZDIiLCJncm91cHMiOlsiZ3Vlc3QiXSwicHJvcGVydHlfaWQiOjQ0NDc3fQ.VEsHWJ-_-R9HDhZ8L-PJ0mmqGMSu92Km9wRImGh-pSsz0wU4rKPll5SFlu_XLllGfz38f522z9jjlsNhtNlxhrCR3h1eFfQjyY2fM_8ZHh75KKaASL0U1pIwG1HKf2JTrMu9ceHqpfm2yJ5_KQgLipZRMfpCutOVx-5Lnq023Km0unz-Snb-XSP8gK8KMtRuutj8lkOFiZLskKHNIlIHJ4lUsKoh8C2GB7O3IOaKab3m6ETwB9oux8vWoB6pE6T14F9nNW1NhWfBzqSH3yC5ZA2WSZCDmFQjuInDS7BSsIKqPS8Z491ehOsZhycvchW7aSkWJ9uyX58ef0iJkqN0BQ" \
--header "Property: 0" \
--data '{
    "name": "T8",
    "group": false,
    "guests_min": 1,
    "guests_max": 10
}'
```

{% endtab %}

{% tab title="Response" %}

```json
{
    "data": [
        {
            "id": 148129,
            "name": "Table 1",
            "bookable": true,
            "free": true,
            "group": false,
            "guests_min": 1,
            "guests_max": 4,
            "room_id": 18802
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## 🔄 Update a table

<mark style="color:blue;">**`PUT`**</mark> `/room/{room_id}/table/{table_id}`

Updates the table for the specified property using the provided table details [see more](https://documenter.getpostman.com/view/50380496/2sB3dK1YWg#7a9c067e-4fe3-40f3-a4b3-07c66f85aa8b)\
To update data of Rooms, you need to change the `{room_id}` parameter to the ID of the Room that was previously created.\
\
⚠️ **Reserve with Google updates could take up to 24 hours to process.**

**Headers**

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

**Body**

| Name        | Type    | Description                                                                                                                                                                                                                                                                    |
| ----------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `name`      | string  | Name of the table                                                                                                                                                                                                                                                              |
| `bookable`  | boolean | Indicates whether a table can be booked online. When set to **true**, the table is available for online reservations. If set to **false**, the table can only be booked offline through self reservations, such as by phone or in-person.                                      |
| `free`      | boolean | <p>This status indicates that a table is <strong>available for a new reservation</strong> and is linked to the average meal duration. <br>It means enough time has passed or is available based on the expected meal duration, making the table ready for the next booking</p> |
| `group`     | boolean | This concept refers to the ability to **combine multiple tables** to accommodate larger parties.                                                                                                                                                                               |
| `guest_min` | int     | The **smallest number of people a table can seat**. It prevents the table from being reserved for groups smaller than this number.                                                                                                                                             |
| `guest_min` | int     | The **largest number of people a table can seat**. This limit ensures that a table is not booked for groups exceeding its seating capacity.                                                                                                                                    |

**Response**

{% tabs %}
{% tab title="Request" %}

```json
curl --location --request PUT "https://api.octotable.com/octotable-pms/api/v2/room/18802/table/172221" \
--header "Cache-Control: no-cache" \
--header "Postman-Token: <calculated when request is sent>" \
--header "Host: <calculated when request is sent>" \
--header "User-Agent: PostmanRuntime/7.32.1" \
--header "Accept: */*" \
--header "Accept-Encoding: gzip, deflate, br" \
--header "Connection: keep-alive" \
--header "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJndWVzdCIsImlzcyI6Ik9DVE9SQVRFLVNSTCIsImV4cCI6MTcwMDY1MTY3MywiaWF0IjoxNjk5MzU1NjczLCJqdGkiOiI5OGJmZTVjMi1iYmUxLTRiMDItYWM1ZC00Njk5MTFlOGJjZDIiLCJncm91cHMiOlsiZ3Vlc3QiXSwicHJvcGVydHlfaWQiOjQ0NDc3fQ.VEsHWJ-_-R9HDhZ8L-PJ0mmqGMSu92Km9wRImGh-pSsz0wU4rKPll5SFlu_XLllGfz38f522z9jjlsNhtNlxhrCR3h1eFfQjyY2fM_8ZHh75KKaASL0U1pIwG1HKf2JTrMu9ceHqpfm2yJ5_KQgLipZRMfpCutOVx-5Lnq023Km0unz-Snb-XSP8gK8KMtRuutj8lkOFiZLskKHNIlIHJ4lUsKoh8C2GB7O3IOaKab3m6ETwB9oux8vWoB6pE6T14F9nNW1NhWfBzqSH3yC5ZA2WSZCDmFQjuInDS7BSsIKqPS8Z491ehOsZhycvchW7aSkWJ9uyX58ef0iJkqN0BQ" \
--header "Property: {{propId}}" \
--data '{
    "name": "My table 1",
    "bookable": true,
    "free": true,
    "group": false,
    "guests_max": 4,
    "guests_min": 1
}'
```

{% endtab %}

{% tab title="Response" %}

```json
{
  "data": [
    {
      "id": 172221,
      "name": "My table 1",
      "bookable": true,
      "free": true,
      "group": false,
      "room_id": 18802,
      "table_type": "OTHER"
    }
  ],
  "page_number": 0,
  "page_size": 0,
  "total_elements": 0,
  "total_pages": 0,
  "last_page": true,
  "links": []
}
```

{% endtab %}
{% endtabs %}

## 🗑️ Delete a table

<mark style="color:red;">**`DELETE`**</mark> `/room/{room_id}/table/{table_id}`

Deletes an existing table from the specified property using the table ID [see more](https://documenter.getpostman.com/view/50380496/2sB3dK1YWg#7a9c067e-4fe3-40f3-a4b3-07c66f85aa8b)\
To delete a table of different Rooms, you need to change the `{room_id}` parameter to the ID of the Room that was previously created.

**Headers**

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

**Response**

{% tabs %}
{% tab title="Request" %}

```json
curl --location --request DELETE "https://api.octotable.com/octotable-pms/api/v2/room/18802/table/172221" \
--header "Cache-Control: no-cache" \
--header "Postman-Token: <calculated when request is sent>" \
--header "Host: <calculated when request is sent>" \
--header "User-Agent: PostmanRuntime/7.32.1" \
--header "Accept: */*" \
--header "Accept-Encoding: gzip, deflate, br" \
--header "Connection: keep-alive" \
--header "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJndWVzdCIsImlzcyI6Ik9DVE9SQVRFLVNSTCIsImV4cCI6MTcwMDY1MTY3MywiaWF0IjoxNjk5MzU1NjczLCJqdGkiOiI5OGJmZTVjMi1iYmUxLTRiMDItYWM1ZC00Njk5MTFlOGJjZDIiLCJncm91cHMiOlsiZ3Vlc3QiXSwicHJvcGVydHlfaWQiOjQ0NDc3fQ.VEsHWJ-_-R9HDhZ8L-PJ0mmqGMSu92Km9wRImGh-pSsz0wU4rKPll5SFlu_XLllGfz38f522z9jjlsNhtNlxhrCR3h1eFfQjyY2fM_8ZHh75KKaASL0U1pIwG1HKf2JTrMu9ceHqpfm2yJ5_KQgLipZRMfpCutOVx-5Lnq023Km0unz-Snb-XSP8gK8KMtRuutj8lkOFiZLskKHNIlIHJ4lUsKoh8C2GB7O3IOaKab3m6ETwB9oux8vWoB6pE6T14F9nNW1NhWfBzqSH3yC5ZA2WSZCDmFQjuInDS7BSsIKqPS8Z491ehOsZhycvchW7aSkWJ9uyX58ef0iJkqN0BQ" \
--header "Property: {{propId}}"
```

{% endtab %}

{% tab title="Response" %}

```json
{
    "data": [
        21294
    ]
}
```

{% endtab %}
{% endtabs %}

**📕 ADDITIONAL NOTES** \
\ <mark style="color:red;">**Free:**</mark> This status signifies that a table is available for reservation, directly tied to the average meal duration set by the restaurant. It indicates that either the previous reservation has finished and sufficient time has passed, or the expected duration of a meal allows the table to be ready for another booking. This ensures the table can be booked without overlapping existing reservations and maintains a smooth transition between customers. \
\
**Example**: If a restaurant has an average meal duration (**average\_stay** take a look to Services section) of 90 minutes and a table is booked from 6:00 PM to 7:30 PM, the table's status will change to **Free** at 7:30 PM. This means it is now available for a new reservation starting from that time. The system uses this average meal duration to determine when a table becomes available again, helping to manage bookings efficiently and avoid scheduling conflicts.

\ <mark style="color:red;">**Group**</mark> <mark style="color:red;">**tables**</mark>**:** This feature allows you to combine smaller tables to accommodate larger groups. When creating a group table, you must specify the minimum and maximum number of guests that the grouped tables can accommodate. It’s important to note that grouping tables does not increase the overall availability of the restaurant, as the same number of seats is being used—only distributed across different tables. Additionally, you can choose which tables to group based on their proximity, as some tables may be closer to each other, while others may be in different sections of the restaurant.

**Example**: A restaurant has tables for 2, 4, and 6 people. If a group of 8 wants to book, the user can group two tables for 4, as long as they are close to each other, or combine a table for 2 and a table for 6 if they are near each other. When creating the group table, the user specifies that the minimum and maximum guest numbers are 8, ensuring the reservation is handled correctly. The availability of the restaurant remains unchanged, as the group table simply combines existing tables.


---

# 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-tables.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.
