# Manage your rooms

ℹ️ A room is an entity used to organize tables or other components, allowing customers to book within a specific area of the restaurant.

\
⚙️ **Use the base resource URL** for the following examples, or [see complete collection](https://documenter.getpostman.com/view/50380496/2sB3dK1YWg#2fa66ba7-b915-4459-9e7c-67232d707994)

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

## 🔍 Find all rooms

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

Retrieves a list of available rooms for the specified property (e.g., restaurant) using the property ID [see more](https://documenter.getpostman.com/view/50380496/2sB3dK1YWg#2fa66ba7-b915-4459-9e7c-67232d707994)

**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/rooms" \
--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;"
```

{% endtab %}

{% tab title="Response" %}

```json
{
    "data": [
        {
            "id": 18800,
            "name": "Terrace",
            "property_id": 999643,
            "bookable": true
        },
        {
            "id": 18802,
            "name": "Indoor Room",
            "property_id": 999643,
            "bookable": true
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## 🔍 Find a room by ID

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

Retrieves details of a specific room for the given property using the room ID [see more](https://documenter.getpostman.com/view/50380496/2sB3dK1YWg#2fa66ba7-b915-4459-9e7c-67232d707994)

**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/rooms/" \
--header "Cache-Control: no-cache" \
--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;"
```

{% endtab %}

{% tab title="Response" %}

```json
{
    "data": [
        {
            "id": 18800,
            "name": "Terrace",
            "property_id": 999643,
            "bookable": true
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## 🆕 Create a new room

<mark style="color:yellow;">**`POST`**</mark> `/rooms`

Creates a new room for the specified property using the provided room details [see more](https://documenter.getpostman.com/view/50380496/2sB3dK1YWg#2fa66ba7-b915-4459-9e7c-67232d707994)

**Headers**

<table data-full-width="false"><thead><tr><th>Name</th><th>Value</th></tr></thead><tbody><tr><td><code>Content-Type</code></td><td><code>application/json</code></td></tr><tr><td><code>Authorization</code></td><td><code>Bearer &#x3C;token></code></td></tr><tr><td><code>Property</code></td><td><code>&#x3C;your_property_id></code></td></tr></tbody></table>

**Body**

| Name       | Type    | Description                                                                      |
| ---------- | ------- | -------------------------------------------------------------------------------- |
| `name`     | string  | Name of the room                                                                 |
| `bookable` | boolean | If true, the Room can be booked online; if false, it can only be booked offline. |

**Example**

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

```json
curl --location "https://api.octotable.com/octotable-pms/api/v2/rooms" \
--header "Cache-Control: no-cache" \
--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;" \
--data '{
    "name": "Main dining room"
}'
```

{% endtab %}

{% tab title="Response" %}

```json
{
    "data": [
        {
            "id": 21294,
            "property": 44477,
            "name": "Garden",
            "bookable": true,
            "table_assign": true,
            "table_dynamic": false,
            "tables": []
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## 🔄 Update a room

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

Updates the room for the specified property using the provided room details [see more](https://documenter.getpostman.com/view/50380496/2sB3dK1YWg#2fa66ba7-b915-4459-9e7c-67232d707994)

**Headers**

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

**Body**

| Name       | Type    | Description                                                                      |
| ---------- | ------- | -------------------------------------------------------------------------------- |
| `name`     | string  | Name of the room                                                                 |
| `bookable` | boolean | If true, the Room can be booked online; if false, it can only be booked offline. |

**Example**

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

```json
curl --location --request PUT "https://api.octotable.com/octotable-pms/api/v2/rooms/" \
--header "Cache-Control: no-cache" \
--header "User-Agent: PostmanRuntime/7.32.1" \
--header "Accept: */*" \
--header "Accept-Encoding: gzip, deflate, br" \
--header "Connection: keep-alive" \
--header "Authorization;" \
--header "Property;" \
--data '{
    "name": "Secondary dining room"
}'
```

{% endtab %}

{% tab title="Response" %}

```json
{
    "data": [
        {
            "id": 21309,
            "property_id": 999643,
            "name": "Secondary dining room",
            "bookable": true,
            "tables": []
        }
    ],
    "page_number": 0,
    "page_size": 0,
    "total_elements": 0,
    "total_pages": 0,
    "last_page": true,
    "links": []
}
```

{% endtab %}
{% endtabs %}

## 🗑️ Delete a room

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

Deletes an existing room from the specified property using the room ID [see more](https://documenter.getpostman.com/view/50380496/2sB3dK1YWg#2fa66ba7-b915-4459-9e7c-67232d707994)

**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/rooms/" \
--header "Cache-Control: no-cache" \
--header "User-Agent: PostmanRuntime/7.32.1" \
--header "Accept: */*" \
--header "Accept-Encoding: gzip, deflate, br" \
--header "Connection: keep-alive" \
--header "Authorization;" \
--header "Property;"
```

{% endtab %}

{% tab title="Response" %}

```json
{
```

{% endtab %}
{% endtabs %}

> **📕 ADDITIONAL NOTES** \
> \ <mark style="color:red;">**table\_assign**</mark>: This feature ensures that reservations are automatically assigned to available tables. The system places customers at tables in a way that maintains their maximum capacity limits. Initially, the system assigns tables that best match the party size to optimize space usage. For example, it will prioritize smaller tables for smaller groups. The number of people that can book depends on the minimum and maximum capacities of the available tables.
>
> **Example**: \
> \
> If your restaurant has tables with a minimum capacity of 1 and a maximum of 2 people, and tables with a minimum of 2 and a maximum of 4 people, the system will first assign reservations for two people to tables with a capacity range of 1 to 2. Once these tables are full, it will begin assigning reservations to tables with a capacity of 2 to 4, as the group size is still within the allowable range for those tables.<br>
>
> <mark style="color:red;">**table\_dynamic**</mark><mark style="color:red;">:</mark> This feature **automatically groups tables** to accommodate the size of a reservation. The system dynamically arranges tables to match the number of guests.
>
> **Example:**&#x20;
>
> If you want to accept reservations for up to 10 people but only have 2-person tables, activating the *Automatic Grouped Tables* option allows the system to combine tables until it reaches the total number of guests.
>
> Click [HERE](https://community.octotable.com/rooms-and-tables-432y5dp1/post/how-to-arrange-the-tables-in-your-restaurant-JYYNkKwGXSnSy4y) to find out more


---

# 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/publish-your-docs.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.
