On this page
article
step 2 - Add a Room to the Property
Create Room
-
API: createRoom
-
Purpose & Use Cases: Create a new room for a property.
-
Request:
| Attribute Name | Data Type | Required | Details |
|---|---|---|---|
| propertyId | ID | Yes | Identifier for the related Property object |
| externalId | NonEmptyString | No | Unique external identifier for the room |
| name | NonEmptyString | Yes | Name of the room |
| category | RoomCategory | Yes | Category of the room; Possible values: ENTIRE_PLACE PRIVATE_ROOM SHARED_ROOM |
| bedCount | NaturalNumber | Yes | Number of beds in the room |
| floors | Int[] | No | List of floors where the room is located |
| maxOccupancy | NaturalNumber | No | Maximum occupancy of the room |
| dualOccupancy | DualOccupancy | No | Indicates if dual occupancy is allowed for the room; Possible values: DUAL_OCCUPANCY_ALLOWED FREE_DUAL_OCCUPANCY CHARGED_DUAL_OCCUPANCY DUAL_OCCUPANCY_NOT_ALLOWED |
| bathroomType | BathroomTypeCategory | Yes | Bathroom type of the room; Possible values: PRIVATE_ENSUITE PRIVATE_NON_ENSUITE SHARED_ENSUITE SHARED_NON_ENSUITE MIXED |
| kitchenArrangement | KitchenArrangement | No | Whether the kitchen is private or shared; Possible values: PRIVATE SHARED |
| bedroomCountMin | NaturalNumber | No | Minimum number of beds in the room |
| bedroomCountMax | NaturalNumber | No | Maximum number of beds in the room |
| bathroomCount | Float | No | Number of bathrooms in the room |
| kitchenCount | Float | No | Number of kitchen in the room |
| genderMix | GenderMix | No | Gender mix allowed in the room; Possible values: MALE_ONLY FEMALE_ONLY MIXED |
| dietaryPreference | DietaryPreference | No | Dietary preferences for the room; Possible values: VEGETARIAN |
| smokingPreference | SmokingPreference | No | Smoking preferences for the room; Possible values: NON_SMOKING SMOKING |
| lastFurnished | YearMonth | No | Last furnished month in format ISO 8601 (YYYY-MM) |
| facilities | RoomFacility[] | No | Facility list of the room; Possible values: AIR_CONDITIONING BATHROOM CHAIRS CLOSET DESK DOOR_LOCK HEATING KITCHEN TELEVISION WIFI |
| bedSizeType | BedSizeType | Yes | Size type of the bed in the room; Possible values: UNIFIED DIFFERENT |
| bedSizes | BedSizesInput[] | No | List of bed sizes in the room; BedSizeInput is an object includes, bedType: BedType, lengthInCM: PositiveInteger, widthInCM: PositiveInteger, bedCount: NaturalNumber; BedType has possible values: SINGLE_BED DOUBLE_BED SMALL_DOUBLE_BED KING_BED KING_SINGLE_BED CALIFORNIA_KING_BED GRAND_KING_BED QUEEN_BED KING_SIZE_BED TWIN_BED BUNK_BED |
| roomSize | RoomSizesInput | No | Object describing the size of the room; RoomSizesInput is an object includes, descriptor: RoomSizeType, minimum: Int!, maximum: Int!, unitOfArea: RoomSizeUnit; RoomSizeType has possible values: EXACT BETWEEN MORE_THANRoomSizeUnit has possible values: SQM SQFT |
QUERY
mutation CreateRoom($input: CreateRoomInput) {
createRoom(input: $input) {
room {
id
name
propertyId
externalId
category
bedCount
bathroomCount
bathroomType
kitchenCount
bedroomCountMin
bedroomCountMax
maxOccupancy
genderMix
dietaryPreference
floors
dualOccupancy
kitchenArrangement
lastFurnished
facilities
bedSizeType
bedSizes {
bedType
lengthInCM
widthInCM
bedCount
}
smokingPreference
}
}
}
GRAPHQL VARIABLES
{
"input": {
"bathroomType": "PRIVATE_ENSUITE",
"bedCount": 20,
"bedSizeType": "UNIFIED",
"category": "PRIVATE_ROOM",
"name": "open api create room",
"propertyId": "eyJ0eXBlIjoiUHJvcGVydHkiLCJpZCI6MTA0NDc3Nn0",
"externalId":"create externalId",
"bedSizes": [
{
"bedCount": 20
}]
}
}
- Response:
{
"data": {
"createRoom": {
"room": {
"id": "eyJ0eXBlIjoiVW5pdFR5cGUiLCJpZCI6MTAwNzUyMTJ9",
"name": "open api create room",
"propertyId": "eyJ0eXBlIjoiUHJvcGVydHkiLCJpZCI6MTA0NDc3Nn0=",
"externalId": "create externalId",
"category": "PRIVATE_ROOM",
"bedCount": 20,
"bathroomCount": 0,
"bathroomType": "PRIVATE_ENSUITE",
"kitchenCount": 0,
"bedroomCountMin": 0,
"bedroomCountMax": 0,
"maxOccupancy": null,
"genderMix": null,
"dietaryPreference": null,
"floors": null,
"dualOccupancy": null,
"kitchenArrangement": null,
"lastFurnished": null,
"facilities": [
null
],
"bedSizeType": "UNIFIED",
"bedSizes": [
{
"bedType": null,
"lengthInCM": null,
"widthInCM": null,
"bedCount": 20
}
],
"smokingPreference": null
}
}
}
}
- Error Message:
| Error Message | Description |
|---|---|
| bedSizes cannot be empty when input.bedCount is not empty | Unable to create a room because bedSizes is empty while bedCount is specified |
| input.bedCount must be greater than or equals to the total number of beds | Unable to create a room because when bedSizeType = DIFFERENT, bedCount must be greater than or equal to the total number of beds calculated from bedSizes |
| input.floors must be smaller than 47 | Unable to create a room because one or more values in floors exceed the limit of 47 |
Update Room
-
API: updateRoom
-
Purpose & Use Cases: Update the details of an existing room for a property.
-
Request:
| Attribute Name | Data Type | Required | Details |
|---|---|---|---|
| id | DecodedUnitTypeID | Yes | Unique identifier for the object |
| externalId | NonEmptyString | No | Unique external identifier for the room |
| name | NonEmptyString | No | Name of the room |
| category | RoomCategory | No | Category of the room; Possible values: ENTIRE_PLACE PRIVATE_ROOM SHARED_ROOM |
| bedCount | NaturalNumber | No | Number of beds in the room |
| floors | Int[] | No | List of floors where the room is located |
| maxOccupancy | NaturalNumber | No | Maximum occupancy of the room |
| dualOccupancy | DualOccupancy | No | Indicates if dual occupancy is allowed for the room; Possible values: DUAL_OCCUPANCY_ALLOWED FREE_DUAL_OCCUPANCY CHARGED_DUAL_OCCUPANCY DUAL_OCCUPANCY_NOT_ALLOWED |
| bathroomType | BathroomTypeCategory | No | Bathroom type of the room; Possible values: PRIVATE_ENSUITE PRIVATE_NON_ENSUITE SHARED_ENSUITE SHARED_NON_ENSUITE MIXED |
| kitchenArrangement | KitchenArrangement | No | Whether the kitchen is private or shared; Possible values: PRIVATE SHARED |
| bedroomCountMin | NaturalNumber | No | Minimum number of beds in the room |
| bedroomCountMax | NaturalNumber | No | Maximum number of beds in the room |
| bathroomCount | Float | No | Number of bathrooms in the room |
| kitchenCount | Float | No | Number of kitchen in the room |
| genderMix | GenderMix | No | Gender mix allowed in the room; Possible values: MALE_ONLY FEMALE_ONLY MIXED |
| dietaryPreference | DietaryPreference | No | Dietary preferences for the room; Possible values: VEGETARIAN |
| smokingPreference | SmokingPreference | No | Smoking preferences for the room; Possible values: NON_SMOKING SMOKING |
| lastFurnished | YearMonth | No | Last furnished month in format ISO 8601 (YYYY-MM) |
| facilities | RoomFacility[] | No | Facility list of the room; Possible values: AIR_CONDITIONING BATHROOM CHAIRS CLOSET DESK DOOR_LOCK HEATING KITCHEN TELEVISION WIFI |
| bedSizeType | BedSizeType | No | Size type of the bed in the room; Possible values: UNIFIED DIFFERENT |
| bedSizes | BedSizesInput[] | No | List of bed sizes in the room; BedSizeInput is an object includes, bedType: BedType, lengthInCM: PositiveInteger, widthInCM: PositiveInteger, bedCount: NaturalNumber; BedType has possible values: SINGLE_BED DOUBLE_BED SMALL_DOUBLE_BED KING_BED KING_SINGLE_BED CALIFORNIA_KING_BED GRAND_KING_BED QUEEN_BED KING_SIZE_BED TWIN_BED BUNK_BED |
| roomSize | RoomSizesInput | No | Object describing the size of the room; RoomSizesInput is an object includes, descriptor: RoomSizeType, minimum: Int!, maximum: Int!, unitOfArea: RoomSizeUnit; RoomSizeType has possible values: EXACT BETWEEN MORE_THANRoomSizeUnit has possible values: SQM SQFT |
QUERY
mutation UpdateRoom($input: UpdateRoomInput) {
updateRoom(input: $input) {
room {
id
name
propertyId
externalId
category
bedCount
bathroomCount
bathroomType
kitchenCount
bedroomCountMin
bedroomCountMax
maxOccupancy
genderMix
dietaryPreference
floors
dualOccupancy
kitchenArrangement
lastFurnished
facilities
bedSizeType
bedSizes {
bedType
lengthInCM
widthInCM
bedCount
}
smokingPreference
}
}
}
GRAPHQL VARIABLES
{
"input": {
"id":"eyJ0eXBlIjoiVW5pdFR5cGUiLCJpZCI6MTAwNzUyMTJ9",
"name":"update room name",
"externalId":"update externalId01",
"bedSizes": [
{
"bedCount": 20
}],
"bathroomCount": 20,
"bathroomType": "PRIVATE_ENSUITE",
"bedSizeType": "UNIFIED",
"bedroomCountMax": null,
"bedroomCountMin": null,
"category": "PRIVATE_ROOM",
"dietaryPreference": "VEGETARIAN",
"dualOccupancy": "CHARGED_DUAL_OCCUPANCY"
}
}
- Response:
{
"data": {
"updateRoom": {
"room": {
"id": "eyJ0eXBlIjoiVW5pdFR5cGUiLCJpZCI6MTAwNzUyMTJ9",
"name": "update room name",
"propertyId": "eyJ0eXBlIjoiUHJvcGVydHkiLCJpZCI6MTA0NDc3Nn0=",
"externalId": "update externalId01",
"category": "PRIVATE_ROOM",
"bedCount": 20,
"bathroomCount": 20,
"bathroomType": "PRIVATE_ENSUITE",
"kitchenCount": 0,
"bedroomCountMin": null,
"bedroomCountMax": null,
"maxOccupancy": null,
"genderMix": null,
"dietaryPreference": "VEGETARIAN",
"floors": null,
"dualOccupancy": "CHARGED_DUAL_OCCUPANCY",
"kitchenArrangement": null,
"lastFurnished": null,
"facilities": [
null
],
"bedSizeType": "UNIFIED",
"bedSizes": [
{
"bedType": null,
"lengthInCM": null,
"widthInCM": null,
"bedCount": 20
}
],
"smokingPreference": null
}
}
}
}
Delete Room
-
API: deleteRoom
-
Purpose & Use Cases: Delete a room from a property.
-
Request:
| Attribute Name | Data Type | Required | Details |
|---|---|---|---|
| id | DecodedUnitTypeID | Yes | Unique identifier for the object |
QUERY
mutation DeleteRoom($input: DeleteRoomInput) {
deleteRoom(input: $input) {
result
}
}
GRAPHQL VARIABLES
{
"input": {
"id": "eyJ0eXBlIjoiVW5pdFR5cGUiLCJpZCI6MTAwNzUyMTR9"
}
}
- Response:
{
"data": {
"deleteRoom": {
"result": true
}
}
}
Get Rooms
-
API: getRooms
-
Purpose & Use Cases: Retrieve all rooms of a specific property.
-
Request:
| Attribute Name | Data Type | Required | Details |
|---|---|---|---|
| propertyId | ID | Yes | Identifier for the related Property object |
| pageNumber | Int | No | The number of the page |
| pageSize | Int | No | The size of the page |
QUERY
query GetRooms($propertyId: ID!, $pageNumber: Int, $pageSize: Int) {
getRooms(propertyId: $propertyId, pageNumber: $pageNumber, pageSize: $pageSize) {
pageInfo {
total
totalPages
currentPage
pageSize
}
rooms {
id
name
propertyId
externalId
category
bedCount
bathroomCount
bathroomType
kitchenCount
bedroomCountMin
bedroomCountMax
maxOccupancy
genderMix
dietaryPreference
floors
dualOccupancy
kitchenArrangement
lastFurnished
facilities
bedSizeType
bedSizes {
bedCount
}
links {
id
roomId
link
enabled
}
images {
id
type
category
contentType
filename
imageHash
active
status
hero
}
roomSize {
descriptor
minimum
maximum
unitOfArea
}
smokingPreference
videos {
id
path
size
videoHash
fileName
active
status
}
}
}
}
GRAPHQL VARIABLES
{
"propertyId": "eyJ0eXBlIjoiUHJvcGVydHkiLCJpZCI6MTA0NDc3Nn0",
"pageNumber": 1,
"pageSize": 1
}
- Response:
{
"data": {
"getRooms": {
"pageInfo": {
"total": 8,
"totalPages": 8,
"currentPage": 1,
"pageSize": 1
},
"rooms": [
{
"id": "eyJ0eXBlIjoiVW5pdFR5cGUiLCJpZCI6MTAwNzUxMzJ9",
"name": "Untitled Room 01",
"propertyId": "eyJ0eXBlIjoiUHJvcGVydHkiLCJpZCI6MTA0NDc3Nn0=",
"externalId": null,
"category": "PRIVATE_ROOM",
"bedCount": 8,
"bathroomCount": 0,
"bathroomType": "PRIVATE_ENSUITE",
"kitchenCount": 0,
"bedroomCountMin": 0,
"bedroomCountMax": 0,
"maxOccupancy": null,
"genderMix": null,
"dietaryPreference": null,
"floors": [],
"dualOccupancy": null,
"kitchenArrangement": "SHARED",
"lastFurnished": null,
"facilities": [
null
],
"bedSizeType": "UNIFIED",
"bedSizes": [
{
"bedCount": null
}
],
"links": null,
"images": [],
"roomSize": null,
"smokingPreference": null,
"videos": null
}
]
}
}
}
Get Room
-
API: getRoom
-
Purpose & Use Cases: Retrieve the details of a room for a property using its unique ID.
-
Request:
| Attribute Name | Data Type | Required | Details |
|---|---|---|---|
| id | ID | No | Unique identifier for the object |
| roomExternalId | NonEmptyString | No | Unique external identifier for the room |
| propertyExternalId | NonEmptyString | No | Unique external identifier for the property |
QUERY
query GetRoom($getRoomId: ID,
$propertyExternalId: String,
$roomExternalId: String
) {
getRoom(id: $getRoomId,
roomExternalId: $roomExternalId,
propertyExternalId: $propertyExternalId) {
room {
id
name
propertyId
externalId
category
bedCount
bathroomCount
bathroomType
kitchenCount
bedroomCountMin
bedroomCountMax
maxOccupancy
genderMix
dietaryPreference
floors
dualOccupancy
kitchenArrangement
lastFurnished
facilities
bedSizeType
bedSizes {
bedCount
}
links {
id
roomId
link
enabled
}
images {
id
type
category
contentType
filename
imageHash
active
status
hero
}
roomSize {
descriptor
minimum
maximum
unitOfArea
}
smokingPreference
videos {
id
path
size
videoHash
fileName
active
status
}
}
}
}
GRAPHQL VARIABLES
{
"roomExternalId": "update externalId01",
"propertyExternalId": "update property externalId"
}
- Response:
{
"data": {
"getRoom": {
"room": {
"id": "eyJ0eXBlIjoiVW5pdFR5cGUiLCJpZCI6MTAwNzUyMTF9",
"name": "update room name",
"propertyId": "eyJ0eXBlIjoiUHJvcGVydHkiLCJpZCI6MTA0NDc3Nn0=",
"externalId": "update externalId01",
"category": "PRIVATE_ROOM",
"bedCount": 20,
"bathroomCount": 20,
"bathroomType": "PRIVATE_ENSUITE",
"kitchenCount": 0,
"bedroomCountMin": null,
"bedroomCountMax": null,
"maxOccupancy": null,
"genderMix": null,
"dietaryPreference": "VEGETARIAN",
"floors": null,
"dualOccupancy": "CHARGED_DUAL_OCCUPANCY",
"kitchenArrangement": null,
"lastFurnished": null,
"facilities": [
null
],
"bedSizeType": "UNIFIED",
"bedSizes": [
{
"bedCount": 20
}
],
"links": null,
"images": [],
"roomSize": null,
"smokingPreference": null,
"videos": null
}
}
}
}
- Error Message:
| Error Message | Description |
|---|---|
| only one id is needed | Unable to retrieve room data because both args.id and externalId were provided simultaneously. Only one identifier is allowed |
| id is required — at least one id must be provided | Unable to retrieve room data because neither args.id nor externalId was provided |
| externalPropertyId is required when using externalId on this endpoint | Unable to retrieve room data because externalId is provided without specifying propertyExternalId |
| Property ${propertyExternalId} is invalid | Unable to retrieve room data because the propertyExternalId is invalid or does not correspond to an existing property |
Room object
| Attribute Name | Data Type | Details |
|---|---|---|
| id | ID | Unique identifier for the object |
| propertyId | ID | Identifier for the related Property object |
| externalId | NonEmptyString | Unique external identifier for the room |
| name | NonEmptyString | Name of the room |
| category | RoomCategory | Category of the room; Possible values: ENTIRE_PLACE PRIVATE_ROOM SHARED_ROOM |
| bedCount | NaturalNumber | Number of beds in the room |
| floors | Int[] | List of floors where the room is located |
| maxOccupancy | NaturalNumber | Maximum occupancy of the room |
| dualOccupancy | DualOccupancy | Indicates if dual occupancy is allowed for the room; Possible values: DUAL_OCCUPANCY_ALLOWED FREE_DUAL_OCCUPANCY CHARGED_DUAL_OCCUPANCY DUAL_OCCUPANCY_NOT_ALLOWED |
| bathroomType | BathroomTypeCategory | Bathroom type of the room; Possible values: PRIVATE_ENSUITE PRIVATE_NON_ENSUITE SHARED_ENSUITE SHARED_NON_ENSUITE MIXED |
| kitchenArrangement | KitchenArrangement | Whether the kitchen is private or shared; Possible values: PRIVATE SHARED |
| bedroomCountMin | NaturalNumber | Minimum number of beds in the room |
| bedroomCountMax | NaturalNumber | Maximum number of beds in the room |
| bathroomCount | Float | Number of bathrooms in the room |
| kitchenCount | Float | Number of kitchen in the room |
| genderMix | GenderMix | Gender mix allowed in the room; Possible values: MALE_ONLY FEMALE_ONLY MIXED |
| dietaryPreference | DietaryPreference | Dietary preferences for the room; Possible values: VEGETARIAN |
| smokingPreference | SmokingPreference | Smoking preferences for the room; Possible values: NON_SMOKING SMOKING |
| lastFurnished | YearMonth | Last furnished month in format ISO 8601 (YYYY-MM) |
| facilities | RoomFacility[] | Facility list of the room; Possible values: AIR_CONDITIONING BATHROOM CHAIRS CLOSET DESK DOOR_LOCK HEATING KITCHEN TELEVISION WIFI |
| bedSizeType | BedSizeType | Size type of the bed in the room; Possible values: UNIFIED DIFFERENT |
| bedSizes | BedSizesInput[] | List of bed sizes in the room; BedSizeInput is an object includes, bedType: BedType, lengthInCM: PositiveInteger, widthInCM: PositiveInteger, bedCount: NaturalNumber; BedType has possible values: SINGLE_BED DOUBLE_BED SMALL_DOUBLE_BED KING_BED KING_SINGLE_BED CALIFORNIA_KING_BED GRAND_KING_BED QUEEN_BED KING_SIZE_BED TWIN_BED BUNK_BED |
| roomSize | RoomSizesInput | Object describing the size of the room; RoomSizesInput is an object includes, descriptor: RoomSizeType, minimum: Int!, maximum: Int!, unitOfArea: RoomSizeUnit; RoomSizeType has possible values: EXACT BETWEEN MORE_THANRoomSizeUnit has possible values: SQM SQFT |