---
updatedAt: 2026-05-13T13:56:22.000Z
agentTools:
  projectIndex: https://open-api-docs.guesty.com/llms.txt
---

# Rooms, Beds, and Bathrooms

Configure the rooms, beds, and bathrooms at your property.

***

title: Rooms, Beds, and Bathrooms
description: Configure the rooms, beds, and bathrooms at your property.
tags: \[room, space, bed, bathroom, shared-space, onboard-listing, onboard-property]
url: <https://open-api-docs.guesty.com/docs/bedrooms-beds>
----------------------------------------------------------

## Overview

The `Spaces` API allows you to define the sleeping arrangements at your properties. This article describes how to <Anchor label="Create" target="_blank" href="https://open-api-docs.guesty.com/reference/post_properties-spaces-unit-type-unittypeid-add">Create</Anchor>, <Anchor label="Remove" target="_blank" href="https://open-api-docs.guesty.com/reference/post_properties-spaces-space-spaceid-remove">Remove</Anchor>, <Anchor label="Edit space details" target="_blank" href="https://open-api-docs.guesty.com/reference/patch_properties-spaces-space-spaceid-details">Edit space details</Anchor>, as well as <Anchor label="editing a space's beds" target="_blank" href="https://open-api-docs.guesty.com/reference/post_properties-spaces-space-spaceid-edit">editing a space's beds</Anchor>.

<br />

> ❗️ Important
>
> * A studio can be equipped with a half or full bathroom or shared space, but a bedroom **cannot** be added.
> * If a property is listed as the entire place/apartment, a shared bathroom **cannot** be added.
> * Airbnb only permits **one shared space** per studio listing.

<br />

## Creating a Room

To retrieve the supported room and bed enums, use these endpoints:

* <Anchor label="List room-types" target="_blank" href="https://open-api-docs.guesty.com/reference/get_properties-spaces-room-types">List room-types</Anchor>
* <Anchor label="List bed-types" target="_blank" href="https://open-api-docs.guesty.com/reference/get_properties-spaces-bed-types">List bed-types</Anchor>

<br />

> 🚧 Default Room
>
> Guesty automatically creates a default bedroom for each new listing. However, for studio listings, a default shared space is inherited. Before uploading your room configurations, you should either delete this default room or modify it to reflect your specific room and bed setup.

<br />

#### Available Endpoints

| Method | Endpoint                                                                                                                                                                                                                                 |
| :----- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| POST   | <Anchor label="/properties/spaces/unit-type/\{unitTypeId}/add" target="_blank" href="https://open-api-docs.guesty.com/reference/post_properties-spaces-unit-type-unittypeid-add">/properties/spaces/unit-type/\{unitTypeId}/add</Anchor> |

<br />

#### Key Parameters

| Path Parameter | Type   | Description        | Required |
| :------------- | :----- | :----------------- | :------- |
| `unitTypeId`   | string | The property's ID. | ✔️       |

<br />

| Body Parameter   | Type   | Description                                           | Required |
| :--------------- | :----- | :---------------------------------------------------- | :------- |
| `_id`            | string | The property's ID.                                    | ✔️       |
| `name`           | string | Name of the space. E.g., Living Room or Bedroom 1.    |          |
| `type`           | string | Room type. Can be either `SHARED_SPACE` or `BEDROOM`. |          |
| `airbnb_room_id` | string | For Airbnb listings only. Take this from Airbnb.      |          |
| `beds`           | object | A list of the beds in the space.                      |          |
| `other`          | object | A list of other bed types.                            |          |

<br />

**Beds Object**

| Body Parameter | Type   | Description                                | Required |
| :------------- | :----- | :----------------------------------------- | :------- |
| `KING_BED`     | number | The number of king-size beds in the room.  |          |
| `QUEEN_BED`    | number | The number of queen-size beds in the room. |          |
| `DOUBLE_BED`   | number | The number of double beds in the room.     |          |
| `SINGLE_BED`   | number | The number of single beds in the room.     |          |
| `SOFA_BED`     | number | The number of sofa beds in the room.       |          |
| `AIR_MATTRESS` | number | The number of air mattresses in the room.  |          |
| `BUNK_BED`     | number | The number of bunk beds in the room.       |          |

<br />

**Other Object**

| Body Parameter   | Type   | Description                                 | Required |
| :--------------- | :----- | :------------------------------------------ | :------- |
| `FLOOR_MATTRESS` | number | The number of floor mattresses in the room. |          |
| `WATER_BED`      | number | The number of water beds in the room.       |          |
| `TODDLER_BED`    | number | The number of toddler beds in the room.     |          |
| `CRIB`           | number | The number of baby cribs in the room.       |          |

<br />

<Callout icon="📘" theme="info">
  You only need to include the the relevant bed types in the `beds` and `other` objects.
</Callout>

<br />

### Bedroom Example

**Request**

```curl
curl 'https://open-api.guesty.com/v1/properties/spaces/unit-type/64f03f9094d741004fda977d/add' \
--header 'accept: application/json; charset=utf-8' \
--header 'content-type: application/json' \
--data '{
    "beds": {
        "QUEEN_BED": 2
    },
    "other": {
        "CRIB": 1
    },
    "name": "Bedroom 2",
    "type": "BEDROOM"
}'
```
```javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json; charset=utf-8");
myHeaders.append("content-type", "application/json");

var raw = JSON.stringify({
  "beds": {
    "QUEEN_BED": 2
  },
  "other": {
    "CRIB": 1
  },
  "name": "Bedroom 2",
  "type": "BEDROOM"
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'manual'
};

fetch("https://open-api.guesty.com/v1/properties/spaces/unit-type/64f03f9094d741004fda977d/add", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```
```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://open-api.guesty.com/v1/properties/spaces/unit-type/64f03f9094d741004fda977d/add',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => false,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "beds": {
        "QUEEN_BED": 2
    },
    "other": {
        "CRIB": 1
    },
    "name": "Bedroom 2",
    "type": "BEDROOM"
}',
  CURLOPT_HTTPHEADER => array(
    'accept: application/json; charset=utf-8',
    'content-type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```
```python
import http.client
import json

conn = http.client.HTTPSConnection("open-api.guesty.com")
payload = json.dumps({
  "beds": {
    "QUEEN_BED": 2
  },
  "other": {
    "CRIB": 1
  },
  "name": "Bedroom 2",
  "type": "BEDROOM"
})
headers = {
  'accept': 'application/json; charset=utf-8',
  'content-type': 'application/json'
}
conn.request("POST", "/v1/properties/spaces/unit-type/64f03f9094d741004fda977d/add", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```

<br />

**Response**

```json
{
    "unitTypeId": "64f03f9094d741004fda977d",
    "bedroomsAllowed": true,
    "spaces": [
        {
            "_id": "64f0427db4f3990038e25375",
            "accountId": "62a8a2be2e53190032102a6e",
            "unitTypeId": "64f03f9094d741004fda977d",
            "beds": {
                "KING_BED": 0,
                "QUEEN_BED": 0,
                "DOUBLE_BED": 0,
                "SINGLE_BED": 0,
                "SOFA_BED": 0,
                "AIR_MATTRESS": 0,
                "BUNK_BED": 0
            },
            "name": "Default bedroom",
            "other": {
                "FLOOR_MATTRESS": 0,
                "WATER_BED": 0,
                "TODDLER_BED": 0,
                "CRIB": 0
            },
            "roomNumber": 1,
            "type": "BEDROOM"
        },
        {
            "_id": "650abb9734998c003b251257",
            "beds": {
                "KING_BED": 1,
                "QUEEN_BED": 0,
                "DOUBLE_BED": 0,
                "SINGLE_BED": 0,
                "SOFA_BED": 0,
                "AIR_MATTRESS": 0,
                "BUNK_BED": 0
            },
            "other": {
                "FLOOR_MATTRESS": 0,
                "WATER_BED": 0,
                "TODDLER_BED": 0,
                "CRIB": 1
            },
            "name": "Bedroom 1",
            "type": "BEDROOM",
            "accountId": "62a8a2be2e53190032102a6e",
            "unitTypeId": "64f03f9094d741004fda977d",
            "roomNumber": 2
        },
        {
            "_id": "650abbf5b2c6e8002bc2ebdb",
            "beds": {
                "KING_BED": 0,
                "QUEEN_BED": 2,
                "DOUBLE_BED": 0,
                "SINGLE_BED": 0,
                "SOFA_BED": 0,
                "AIR_MATTRESS": 0,
                "BUNK_BED": 0
            },
            "other": {
                "FLOOR_MATTRESS": 0,
                "WATER_BED": 0,
                "TODDLER_BED": 0,
                "CRIB": 1
            },
            "name": "Bedroom 2",
            "type": "BEDROOM",
            "accountId": "62a8a2be2e53190032102a6e",
            "unitTypeId": "64f03f9094d741004fda977d",
            "roomNumber": 3
        }
    ]
}
```

<br />

### Shared Space Example

**Request**

```curl
curl 'https://open-api.guesty.com/v1/properties/spaces/unit-type/64f03f9094d741004fda977d/add' \
--header 'accept: application/json; charset=utf-8' \
--header 'content-type: application/json' \
--data '{
    "beds": {
        "SOFA_BED": 1
    },
    "name": "Living Room",
    "type": "SHARED_SPACE"
}'
```
```javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json; charset=utf-8");
myHeaders.append("content-type", "application/json");

var raw = JSON.stringify({
  "beds": {
    "SOFA_BED": 1
  },
  "name": "Living Room",
  "type": "SHARED_SPACE"
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'manual'
};

fetch("https://open-api.guesty.com/v1/properties/spaces/unit-type/64f03f9094d741004fda977d/add", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```
```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://open-api.guesty.com/v1/properties/spaces/unit-type/64f03f9094d741004fda977d/add',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => false,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "beds": {
        "SOFA_BED": 1
    },
    "name": "Living Room",
    "type": "SHARED_SPACE"
}',
  CURLOPT_HTTPHEADER => array(
    'accept: application/json; charset=utf-8',
    'content-type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```
```python
import http.client
import json

conn = http.client.HTTPSConnection("open-api.guesty.com")
payload = json.dumps({
  "beds": {
    "SOFA_BED": 1
  },
  "name": "Living Room",
  "type": "SHARED_SPACE"
})
headers = {
  'accept': 'application/json; charset=utf-8',
  'content-type': 'application/json'
}
conn.request("POST", "/v1/properties/spaces/unit-type/64f03f9094d741004fda977d/add", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```

<br />

**Response**

```json
{
    "unitTypeId": "64f03f9094d741004fda977d",
    "bedroomsAllowed": true,
    "spaces": [
        {
            "_id": "650abc34c9da7b003a35dce9",
            "beds": {
                "KING_BED": 0,
                "QUEEN_BED": 0,
                "DOUBLE_BED": 0,
                "SINGLE_BED": 0,
                "SOFA_BED": 1,
                "AIR_MATTRESS": 0,
                "BUNK_BED": 0
            },
            "other": {
                "FLOOR_MATTRESS": 0,
                "WATER_BED": 0,
                "TODDLER_BED": 0,
                "CRIB": 0
            },
            "name": "Living Room",
            "type": "SHARED_SPACE",
            "accountId": "62a8a2be2e53190032102a6e",
            "unitTypeId": "64f03f9094d741004fda977d",
            "roomNumber": 0
        },
        {
            "_id": "64f0427db4f3990038e25375",
            "accountId": "62a8a2be2e53190032102a6e",
            "unitTypeId": "64f03f9094d741004fda977d",
            "beds": {
                "KING_BED": 0,
                "QUEEN_BED": 0,
                "DOUBLE_BED": 0,
                "SINGLE_BED": 0,
                "SOFA_BED": 0,
                "AIR_MATTRESS": 0,
                "BUNK_BED": 0
            },
            "name": "Default bedroom",
            "other": {
                "FLOOR_MATTRESS": 0,
                "WATER_BED": 0,
                "TODDLER_BED": 0,
                "CRIB": 0
            },
            "roomNumber": 1,
            "type": "BEDROOM"
        },
        {
            "_id": "650abb9734998c003b251257",
            "beds": {
                "KING_BED": 1,
                "QUEEN_BED": 0,
                "DOUBLE_BED": 0,
                "SINGLE_BED": 0,
                "SOFA_BED": 0,
                "AIR_MATTRESS": 0,
                "BUNK_BED": 0
            },
            "other": {
                "FLOOR_MATTRESS": 0,
                "WATER_BED": 0,
                "TODDLER_BED": 0,
                "CRIB": 1
            },
            "name": "Bedroom 1",
            "type": "BEDROOM",
            "accountId": "62a8a2be2e53190032102a6e",
            "unitTypeId": "64f03f9094d741004fda977d",
            "roomNumber": 2
        },
        {
            "_id": "650abbf5b2c6e8002bc2ebdb",
            "beds": {
                "KING_BED": 0,
                "QUEEN_BED": 2,
                "DOUBLE_BED": 0,
                "SINGLE_BED": 0,
                "SOFA_BED": 0,
                "AIR_MATTRESS": 0,
                "BUNK_BED": 0
            },
            "other": {
                "FLOOR_MATTRESS": 0,
                "WATER_BED": 0,
                "TODDLER_BED": 0,
                "CRIB": 1
            },
            "name": "Bedroom 2",
            "type": "BEDROOM",
            "accountId": "62a8a2be2e53190032102a6e",
            "unitTypeId": "64f03f9094d741004fda977d",
            "roomNumber": 3
        }
    ]
}
```

<br />

## Creating a bathroom

You can add spaces for full and half bathrooms.

**Type Enums**

* `FULL_BATHROOM`
* `HALF_BATHROOM`

<br />

**Request example**

```shell
curl --request POST \
     --url https://open-api.guesty.com/v1/properties/spaces/unit-type/listingId/add \
     --header 'accept: application/json; charset=utf-8' \
     --header 'authorization: Bearer {YOUR_ACCESS_TOKEN}' \
     --header 'content-type: application/json' \
     --data '
{
  "beds": {
    "KING_BED": 0,
    "QUEEN_BED": 0,
    "DOUBLE_BED": 0,
    "SINGLE_BED": 0,
    "SOFA_BED": 0,
    "AIR_MATTRESS": 0,
    "BUNK_BED": 0
  },
  "other": {
    "FLOOR_MATTRESS": 0,
    "WATER_BED": 0,
    "TODDLER_BED": 0,
    "CRIB": 0
  },
  "name": "Main bathroom",
  "type": "FULL_BATHROOM"
}
'
```

## Removing a Room

Use the <Anchor label="Retrieve spaces for a complex" target="_blank" href="https://open-api-docs.guesty.com/reference/get_properties-spaces-complex-complexid">Retrieve spaces for a complex</Anchor> or <Anchor label="Retrieve spaces for a unit-type" target="_blank" href="https://open-api-docs.guesty.com/reference/get_properties-spaces-unit-type-unittypeid">Retrieve spaces for a unit-type</Anchor> requests to get the space IDs necessary for this action. `unitTypeId` isn't required.

<br />

#### Available Endpoints

| Method | Endpoint                                                                                                                                                                                                                     |
| :----- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| POST   | <Anchor label="/properties/spaces/space/\{spaceId}/remove" target="_blank" href="https://open-api-docs.guesty.com/reference/post_properties-spaces-space-spaceid-remove">/properties/spaces/space/\{spaceId}/remove</Anchor> |

<br />

#### Key Parameters

| Path Parameter | Type   | Description                                              | Required |
| :------------- | :----- | :------------------------------------------------------- | :------- |
| `spaceId`      | string | The ID of the space you wish to remove from the listing. | ✔️       |

<br />

### Example

In this example, *Bedroom 2*, as seen above, is deleted.

<br />

**Request**

```curl
curl --request POST 'https://open-api.guesty.com/v1/properties/spaces/space/650abbf5b2c6e8002bc2ebdb/remove' \
--header 'accept: application/json; charset=utf-8'
```
```javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json; charset=utf-8");

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  redirect: 'manual'
};

fetch("https://open-api.guesty.com/v1/properties/spaces/space/650abbf5b2c6e8002bc2ebdb/remove", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```
```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://open-api.guesty.com/v1/properties/spaces/space/650abbf5b2c6e8002bc2ebdb/remove',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => false,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => array(
    'accept: application/json; charset=utf-8'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```
```python
import http.client

conn = http.client.HTTPSConnection("open-api.guesty.com")
payload = ''
headers = {
  'accept': 'application/json; charset=utf-8'
}
conn.request("POST", "/v1/properties/spaces/space/650abbf5b2c6e8002bc2ebdb/remove", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```

<br />

**Response**

The remaining spaces at the property are returned in the API response.

```json
{
    "unitTypeId": "64f03f9094d741004fda977d",
    "bedroomsAllowed": true,
    "spaces": [
        {
            "_id": "650abc34c9da7b003a35dce9",
            "beds": {
                "KING_BED": 0,
                "QUEEN_BED": 0,
                "DOUBLE_BED": 0,
                "SINGLE_BED": 0,
                "SOFA_BED": 1,
                "AIR_MATTRESS": 0,
                "BUNK_BED": 0
            },
            "other": {
                "FLOOR_MATTRESS": 0,
                "WATER_BED": 0,
                "TODDLER_BED": 0,
                "CRIB": 0
            },
            "name": "Living Room",
            "type": "SHARED_SPACE",
            "accountId": "62a8a2be2e53190032102a6e",
            "unitTypeId": "64f03f9094d741004fda977d",
            "roomNumber": 0
        },
        {
            "_id": "64f0427db4f3990038e25375",
            "accountId": "62a8a2be2e53190032102a6e",
            "unitTypeId": "64f03f9094d741004fda977d",
            "beds": {
                "KING_BED": 0,
                "QUEEN_BED": 0,
                "DOUBLE_BED": 0,
                "SINGLE_BED": 0,
                "SOFA_BED": 0,
                "AIR_MATTRESS": 0,
                "BUNK_BED": 0
            },
            "name": "Default bedroom",
            "other": {
                "FLOOR_MATTRESS": 0,
                "WATER_BED": 0,
                "TODDLER_BED": 0,
                "CRIB": 0
            },
            "roomNumber": 1,
            "type": "BEDROOM"
        },
        {
            "_id": "650abb9734998c003b251257",
            "beds": {
                "KING_BED": 1,
                "QUEEN_BED": 0,
                "DOUBLE_BED": 0,
                "SINGLE_BED": 0,
                "SOFA_BED": 0,
                "AIR_MATTRESS": 0,
                "BUNK_BED": 0
            },
            "other": {
                "FLOOR_MATTRESS": 0,
                "WATER_BED": 0,
                "TODDLER_BED": 0,
                "CRIB": 1
            },
            "name": "Bedroom 1",
            "type": "BEDROOM",
            "accountId": "62a8a2be2e53190032102a6e",
            "unitTypeId": "64f03f9094d741004fda977d",
            "roomNumber": 2
        }
    ]
}
```

<br />

## Editing a Room

Use this action to edit the name and type of space. To retrieve the supported room types, use <Anchor label="List room-types" target="_blank" href="https://open-api-docs.guesty.com/reference/get_properties-spaces-room-types">List room-types</Anchor>.

<br />

#### Available Endpoints

| Method | Endpoint                                                                                                                                                                                                                         |
| :----- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| PATCH  | <Anchor label="/properties/spaces/space/\{spaceId}/details" target="_blank" href="https://open-api-docs.guesty.com/reference/patch_properties-spaces-space-spaceid-details">/properties/spaces/space/\{spaceId}/details</Anchor> |

<br />

#### Key Parameters

| Path Parameter | Type   | Description                  | Required |
| :------------- | :----- | :--------------------------- | :------- |
| `spaceId`      | string | The ID of the space to edit. | ✔️       |

<br />

| Body Parameter   | Type   | Description                                           | Required |
| :--------------- | :----- | :---------------------------------------------------- | :------- |
| `name`           | string | Name of the space. E.g., Living Room or Bedroom 1.    |          |
| `type`           | string | Room type. Can be either `SHARED_SPACE` or `BEDROOM`. |          |
| `airbnb_room_id` | string | For Airbnb listings only. Take this from Airbnb.      |          |

<br />

### Example

This example transforms the shared space created earlier into a bedroom.

<br />

**Request**

```curl
curl --request PATCH 'https://open-api.guesty.com/v1/properties/spaces/space/650abc34c9da7b003a35dce9/details' \
--header 'accept: application/json; charset=utf-8' \
--header 'content-type: application/json' \
--data '
{
  "type": "BEDROOM",
  "name": "Bedroom 3"
}
'
```
```javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json; charset=utf-8");
myHeaders.append("content-type", "application/json");

var raw = JSON.stringify({
  "type": "BEDROOM",
  "name": "Bedroom 3"
});

var requestOptions = {
  method: 'PATCH',
  headers: myHeaders,
  body: raw,
  redirect: 'manual'
};

fetch("https://open-api.guesty.com/v1/properties/spaces/space/650abc34c9da7b003a35dce9/details", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```
```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://open-api.guesty.com/v1/properties/spaces/space/650abc34c9da7b003a35dce9/details',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => false,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'PATCH',
  CURLOPT_POSTFIELDS =>'
{
  "type": "BEDROOM",
  "name": "Bedroom 3"
}
',
  CURLOPT_HTTPHEADER => array(
    'accept: application/json; charset=utf-8',
    'content-type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```
```python
import http.client
import json

conn = http.client.HTTPSConnection("open-api.guesty.com")
payload = json.dumps({
  "type": "BEDROOM",
  "name": "Bedroom 3"
})
headers = {
  'accept': 'application/json; charset=utf-8',
  'content-type': 'application/json'
}
conn.request("PATCH", "/v1/properties/spaces/space/650abc34c9da7b003a35dce9/details", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```

<br />

**Response**

```json
{
    "unitTypeId": "64f03f9094d741004fda977d",
    "bedroomsAllowed": true,
    "spaces": [
        {
            "_id": "650abc34c9da7b003a35dce9",
            "beds": {
                "KING_BED": 0,
                "QUEEN_BED": 0,
                "DOUBLE_BED": 0,
                "SINGLE_BED": 0,
                "SOFA_BED": 1,
                "AIR_MATTRESS": 0,
                "BUNK_BED": 0
            },
            "other": {
                "FLOOR_MATTRESS": 0,
                "WATER_BED": 0,
                "TODDLER_BED": 0,
                "CRIB": 0
            },
            "name": "Bedroom 3",
            "type": "BEDROOM",
            "accountId": "62a8a2be2e53190032102a6e",
            "unitTypeId": "64f03f9094d741004fda977d",
            "roomNumber": 0
        },
        {
            "_id": "64f0427db4f3990038e25375",
            "accountId": "62a8a2be2e53190032102a6e",
            "unitTypeId": "64f03f9094d741004fda977d",
            "beds": {
                "KING_BED": 0,
                "QUEEN_BED": 0,
                "DOUBLE_BED": 0,
                "SINGLE_BED": 0,
                "SOFA_BED": 0,
                "AIR_MATTRESS": 0,
                "BUNK_BED": 0
            },
            "name": "Default bedroom",
            "other": {
                "FLOOR_MATTRESS": 0,
                "WATER_BED": 0,
                "TODDLER_BED": 0,
                "CRIB": 0
            },
            "roomNumber": 1,
            "type": "BEDROOM"
        },
        {
            "_id": "650abb9734998c003b251257",
            "beds": {
                "KING_BED": 1,
                "QUEEN_BED": 0,
                "DOUBLE_BED": 0,
                "SINGLE_BED": 0,
                "SOFA_BED": 0,
                "AIR_MATTRESS": 0,
                "BUNK_BED": 0
            },
            "other": {
                "FLOOR_MATTRESS": 0,
                "WATER_BED": 0,
                "TODDLER_BED": 0,
                "CRIB": 1
            },
            "name": "Bedroom 1",
            "type": "BEDROOM",
            "accountId": "62a8a2be2e53190032102a6e",
            "unitTypeId": "64f03f9094d741004fda977d",
            "roomNumber": 2
        }
    ]
}
```

<br />

## Editing a Room's Beds

This request lets you update the bed types and number of beds within a space at a listing. To retrieve the supported bed types, use [List bed-types](https://open-api-docs.guesty.com/reference/get_properties-spaces-bed-types).

<br />

#### Available Endpoints

| Method | Endpoint                                                                                                                         |
| :----- | :------------------------------------------------------------------------------------------------------------------------------- |
| POST   | [/properties/spaces/space/\{spaceId}/edit](https://open-api-docs.guesty.com/reference/post_properties-spaces-space-spaceid-edit) |

<br />

#### Key Parameters

| Path Parameter | Type   | Description                       | Required |
| :------------- | :----- | :-------------------------------- | :------- |
| `spaceId`      | string | The ID of the space being edited. | ✔️       |

<br />

| Body Parameter | Type   | Description                                                            | Required |
| :------------- | :----- | :--------------------------------------------------------------------- | :------- |
| `beds`         | object | A list of the beds in the space. Refer to the Beds Object table above. |          |
| `other`        | object | A list of other bed types. Refer to the Other Object table above.      |          |

<br />

#### Other Object

| Body Parameter   | Type   | Description                                 | Required |
| :--------------- | :----- | :------------------------------------------ | :------- |
| `FLOOR_MATTRESS` | number | The number of floor mattresses in the room. |          |
| `WATER_BED`      | number | The number of water beds in the room.       |          |
| `TODDLER_BED`    | number | The number of toddler beds in the room.     |          |
| `CRIB`           | number | The number of baby cribs in the room.       |          |

<br />

### Example

This example continues on from the previous one. *Bedroom 3* receives a double bed and the sofa bed is removed.

<br />

**Request**

```curl
curl 'https://open-api.guesty.com/v1/properties/spaces/space/650abc34c9da7b003a35dce9/edit' \
--header 'accept: application/json; charset=utf-8' \
--header 'content-type: application/json' \
--data '{
    "beds": {
        "DOUBLE_BED": 1,
        "SOFA_BED": 0
    }
}'
```
```javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json; charset=utf-8");
myHeaders.append("content-type", "application/json");

var raw = JSON.stringify({
  "beds": {
    "DOUBLE_BED": 1,
    "SOFA_BED": 0
  }
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'manual'
};

fetch("https://open-api.guesty.com/v1/properties/spaces/space/650abc34c9da7b003a35dce9/edit", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```
```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://open-api.guesty.com/v1/properties/spaces/space/650abc34c9da7b003a35dce9/edit',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => false,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "beds": {
        "DOUBLE_BED": 1,
        "SOFA_BED": 0
    }
}',
  CURLOPT_HTTPHEADER => array(
    'accept: application/json; charset=utf-8',
    'content-type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```
```python
import http.client
import json

conn = http.client.HTTPSConnection("open-api.guesty.com")
payload = json.dumps({
  "beds": {
    "DOUBLE_BED": 1,
    "SOFA_BED": 0
  }
})
headers = {
  'accept': 'application/json; charset=utf-8',
  'content-type': 'application/json'
}
conn.request("POST", "/v1/properties/spaces/space/650abc34c9da7b003a35dce9/edit", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```

<br />

**Response**

```json
{
    "unitTypeId": "64f03f9094d741004fda977d",
    "bedroomsAllowed": true,
    "spaces": [
        {
            "_id": "650abc34c9da7b003a35dce9",
            "beds": {
                "KING_BED": 0,
                "QUEEN_BED": 0,
                "DOUBLE_BED": 1,
                "SINGLE_BED": 0,
                "SOFA_BED": 0,
                "AIR_MATTRESS": 0,
                "BUNK_BED": 0
            },
            "other": {
                "FLOOR_MATTRESS": 0,
                "WATER_BED": 0,
                "TODDLER_BED": 0,
                "CRIB": 0
            },
            "name": "Bedroom 3",
            "type": "BEDROOM",
            "accountId": "62a8a2be2e53190032102a6e",
            "unitTypeId": "64f03f9094d741004fda977d",
            "roomNumber": 0
        },
        {
            "_id": "64f0427db4f3990038e25375",
            "accountId": "62a8a2be2e53190032102a6e",
            "unitTypeId": "64f03f9094d741004fda977d",
            "beds": {
                "KING_BED": 0,
                "QUEEN_BED": 0,
                "DOUBLE_BED": 0,
                "SINGLE_BED": 0,
                "SOFA_BED": 0,
                "AIR_MATTRESS": 0,
                "BUNK_BED": 0
            },
            "name": "Default bedroom",
            "other": {
                "FLOOR_MATTRESS": 0,
                "WATER_BED": 0,
                "TODDLER_BED": 0,
                "CRIB": 0
            },
            "roomNumber": 1,
            "type": "BEDROOM"
        },
        {
            "_id": "650abb9734998c003b251257",
            "beds": {
                "KING_BED": 1,
                "QUEEN_BED": 0,
                "DOUBLE_BED": 0,
                "SINGLE_BED": 0,
                "SOFA_BED": 0,
                "AIR_MATTRESS": 0,
                "BUNK_BED": 0
            },
            "other": {
                "FLOOR_MATTRESS": 0,
                "WATER_BED": 0,
                "TODDLER_BED": 0,
                "CRIB": 1
            },
            "name": "Bedroom 1",
            "type": "BEDROOM",
            "accountId": "62a8a2be2e53190032102a6e",
            "unitTypeId": "64f03f9094d741004fda977d",
            "roomNumber": 2
        }
    ]
}
```