# Add or Update Function Space

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

#### Request Body

| Name                      | Type    | Description                                                                                                                                                            |
| ------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id                        | integer | The unique id of the function space to update (Leave empty if adding a new space )                                                                                     |
| venueId                   | integer | The unique id of the venue to which the function space belongs                                                                                                         |
| name                      | string  | The name of the function space (Required when the ID parameter is missing)                                                                                             |
| description               | string  | The description of the function space                                                                                                                                  |
| categoryId                | integer | The categoryId id of the function space                                                                                                                                |
| hasLayouts                | boolean | Whether or not the function space has layout                                                                                                                           |
| minPax                    | integer | The minimum pax of the function space (Required when the ID parameter is missing)                                                                                      |
| maxPax                    | integer | The maximum pax of the function space (Required when the ID parameter is missing)                                                                                      |
| maxNumBookings            | integer | The maximum number bookings of the function space (Required when the ID parameter is missing)                                                                          |
| area                      | integer | The usable floor area of the function space                                                                                                                            |
| length                    | integer | The usable length of the function space                                                                                                                                |
| width                     | integer | The usable width of the function space                                                                                                                                 |
| heightMaximum             | integer | The usable width of the function space                                                                                                                                 |
| heightMinimum             | integer | The mminimum height of the function space                                                                                                                              |
| floorPressureMaximum      | integer | The maximum floor pressure allowed for the function space                                                                                                              |
| isViewable                | boolean | Whether or not the function space is viewable on marketplace (Required when the ID parameter is missing)                                                               |
| eventTypes                | array   | The event type ids applied to the function space                                                                                                                       |
| marketplaceName           | string  | The name of the space displayed in marketplace and booking engines                                                                                                     |
| hasSmallerSpaces          | boolean | Whether or not this space can be divided into smaller, individual spaces (Required when the ID parameter is missing)                                                   |
| partSpaceIds              | array   | The smallest individual spaces that are available within this space. Also include the smallest spaces that overlap other spaces (Only used when hasSmallerSpaces=true) |
| includedInReportDashboard | boolean | Whether or not this space should be included in the reporting dashboard calculations (e.g. CI revenue per function space)                                              |
| threeDScanId              | string  | The 3D scan ID which will show 3D view of your space on iVvy                                                                                                           |
| useIntegrationPartner     | boolean | Whether this function space is integrated with ResDiary                                                                                                                |

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

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

{% endtab %}
{% endtabs %}

#### Example Request

**Add function space**

```javascript
{
    "venueId": 1,
    "name": "test",
    "minPax": 5,
    "maxPax": 0,
    "maxNumBookings": 50,
    "isViewable": false,
    "hasSmallerSpaces": false
}
```

**Update function space**

```javascript
{
    "id": 7,
    "venueId": 1,
    "name": "test",
    "minPax": 5,
    "maxPax": 0,
    "maxNumBookings": 50,
    "isViewable": false,
    "hasSmallerSpaces": false
}
```

#### Returns

| Property | Description                                         |
| -------- | --------------------------------------------------- |
| success  | Whether or not the function space was added/updated |
| id       | The unique id of the function space                 |

#### Throws

| Code                 | Description                       |
| -------------------- | --------------------------------- |
| Specific Code: 24385 | The function space does not exist |
| Specific Code: 24386 | An unknown error has occurred     |
| Specific Code: 24387 | The request contains invalid data |
| Specific Code: 24388 | The request contains invalid data |


---

# 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://developer.ivvy.com/venues/venuedata/add-or-update-function-space.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.
