# Add or Update Guest Room

<mark style="color:green;">`POST`</mark> `[PlatformAddress]/api/1.0/venue?action=addOrUpdateGuestRoom`

#### Request Body

| Name              | Type    | Description                                               |
| ----------------- | ------- | --------------------------------------------------------- |
| id                | integer | The unique id of the guest room                           |
| venueId           | integer | The unique id of the venue to which the rate plan belongs |
| name              | string  | The name of the venue room                                |
| code              | string  | The unique code assigned to the room                      |
| categoryIds       | array   | An array of category ids to which the room belongs.       |
| capacity          | integer | The total number of this room type at the venue.          |
| description       | string  | A html formatted description of the room.                 |
| numStandardAdults | integer | The number of standard adults allowed in the room.        |
| numExtraAdults    | integer | The number of standard adults allowed in the room.        |
| extraAdultCost    | number  | The price of adding an extra adult to the room.           |
| canSmoke          | bool    | Whether or not smoking is allowed in the room.            |
| active            | bool    | Whether or not venue room is active on marketplace.       |
| marketplaceName   | bool    | Whether or not venue room is active on marketplace.       |

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

```
{
  "success": true,
  "id": 10
}
```

{% endtab %}
{% endtabs %}

### Example Request

#### Add Guest Room

```javascript
{
  "venueId": "1",
  "name": "Room 3.3",
  "extraAdultCost": "15",
  "categoryIds": [
    1,2
  ],
  "capacity": 10,
  "description": "this is testing",
  "numStandardAdults": 5,
  "numExtraAdults": 0,
  "canSmoke": "0",
  "active": "0"
}
```

#### Update Guest Room

```javascript
{
  "venueId": "1",
  "name": "Room 3.4",
  "id": 54
}
```

### Returns

| Property | Description                                              |
| -------- | -------------------------------------------------------- |
| success  | Whether or not the Space Blockout was added to the venue |
| id       | The unique id of the Space Blockout                      |

### Throws

| Code                 | Description                       |
| -------------------- | --------------------------------- |
| Specific Code: 24312 | The room does not exist           |
| Specific Code: 24313 | An error has occurred             |
| Specific Code: 24314 | The request contains invalid data |
| Specific Code: 24315 | An unknown error has occurred     |
