> ## Documentation Index
> Fetch the complete documentation index at: https://learn.nexudus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create FloorPlanDesk

> Create a new FloorPlanDesk record.

A **FloorPlanDesk** (referred to as a *floor plan unit* in the UI) represents a specific area or room placed on a floor plan. Each unit typically maps to a bookable resource or a space assigned to a customer through a contract.

There are five unit types controlled by `ItemType`:

| ItemType      | Typical use                                                   |
| ------------- | ------------------------------------------------------------- |
| Office        | Private office assigned to a customer via a contract          |
| DedicatedDesk | Desk permanently assigned to a customer via a contract        |
| HotDesk       | Shared desk bookable via a resource or assigned to a contract |
| Room          | Meeting room or bookable space linked to a resource           |
| Other         | Any area that does not match the types above                  |

Link a unit to a `Resource` via `ResourceId` to let customers book it through the floor plan view on the Members Portal. Assign it to one or more contracts via `CoworkerContractIds` to track occupancy.

Units can be monitored by an IoT sensor (`SensorId`). The last sensor reading is exposed via `SensorLastValue` and `IsSensorOccupied`.

Position and size on the canvas are maintained by the floor plan editor. `AvailableFromTime` / `AvailableToTime` allow time-bounded availability windows.

## Authentication

<Note>
  This endpoint requires OAuth2 authentication. Include a valid bearer token in the `Authorization` header.
  The authenticated user must be a full unrestricted administrator or have the **`FloorPlanDesk-Create`** role.
</Note>

## Enums

<Accordion title="eFloorPlanItemType — ItemType values">
  | Value | Name          |
  | ----- | ------------- |
  | 1     | Office        |
  | 2     | DedicatedDesk |
  | 3     | HotDesk       |
  | 4     | Other         |
  | 5     | Room          |
</Accordion>

<Accordion title="eCoworkerRecordType">
  | Value | Name       |
  | ----- | ---------- |
  | 1     | Individual |
  | 2     | Company    |
</Accordion>

<Accordion title="eSensorType">
  | Value | Name                     |
  | ----- | ------------------------ |
  | 1     | PresenceDetection        |
  | 2     | PeopleCounter            |
  | 3     | Temperature              |
  | 4     | Humidity                 |
  | 5     | Light                    |
  | 6     | Noise                    |
  | 7     | CO2                      |
  | 8     | VolatileOrganicCompounds |
  | 9     | HarmfulParticulates      |
  | 10    | Touch                    |
  | 11    | Water                    |
  | 12    | AtmosphericPressure      |
  | 13    | Power                    |
  | 14    | OpenClosed               |
  | 99    | Other                    |
</Accordion>

## Request Body

### Required Fields

<ParamField body="FloorPlanId" type="integer" required>
  ID of the floor plan this unit belongs to.
</ParamField>

<ParamField body="Name" type="string" required>
  Display name of the floor plan unit (e.g. 'Office 3', 'Hot Desk 12').
</ParamField>

<ParamField body="ItemType" type="integer" required>
  Type of area this unit represents: Office, DedicatedDesk, HotDesk, Room, or Other.
</ParamField>

<ParamField body="Size" type="number" required>
  Floor area of this unit (e.g. in sq ft or sq m, depending on the location's unit setting).
</ParamField>

<ParamField body="Capacity" type="number" required>
  Number of people this unit can accommodate at the same time.
</ParamField>

<ParamField body="Price" type="number" required>
  Indicative price displayed on the floor plan view (informational only; actual billing is handled by products and contracts).
</ParamField>

<ParamField body="PositionX" type="integer" required>
  X coordinate of this unit's position on the floor plan canvas.
</ParamField>

<ParamField body="PositionY" type="integer" required>
  Y coordinate of this unit's position on the floor plan canvas.
</ParamField>

<ParamField body="PositionZ" type="integer" required>
  Z-index (draw order) of this unit on the floor plan canvas; higher values render on top.
</ParamField>

### Optional Fields

<ParamField body="CoworkerId" type="integer">
  ID of the customer assigned to this unit (used for dedicated desks and offices).
</ParamField>

<ParamField body="SensorId" type="integer">
  ID of the IoT sensor monitoring occupancy or environmental conditions in this unit.
</ParamField>

<ParamField body="ResourceId" type="integer">
  ID of the bookable resource linked to this unit, enabling customers to book it via the floor plan view.
</ParamField>

<ParamField body="SizeIsLinkedToArea" type="boolean">
  When true, the Size value is automatically calculated from the drawn shape area on the floor plan canvas.
</ParamField>

<ParamField body="Area" type="string">
  Computed area of the drawn shape on the floor plan canvas, set automatically by the editor.
</ParamField>

<ParamField body="Notes" type="string">
  Internal notes about this unit, visible to admins only.
</ParamField>

<ParamField body="Available" type="boolean">
  Whether this unit is currently available for assignment or booking.
</ParamField>

<ParamField body="AvailableToAi" type="boolean">
  Whether this unit is available to any AI channels (Email, Chat or WhatsApp) for recommendations for private offices;.
</ParamField>

<ParamField body="NotesForAi" type="string">
  Notes or instructions for AI channels to consider when recommending this unit for private offices (e.g. 'great natural light but a bit noisy').
</ParamField>

<ParamField body="ShowPriceForAi" type="boolean">
  Whether to show the price of this unit in AI channel recommendations and responses based on users' budget preferences.
</ParamField>

<ParamField body="PriceForAi" type="number">
  Override price to show in AI channel recommendations and responses based on users' budget preferences (if not set, the regular Price value is used).
</ParamField>

<ParamField body="AccessControlGroupId" type="string">
  Access control group identifier that governs door/entry access for this unit.
</ParamField>

<ParamField body="TunnelPrivateGroupId" type="string">
  Network tunnel group identifier for private network access scoped to this unit.
</ParamField>

<ParamField body="CoworkerContractIds" type="string">
  Comma-separated list of contract IDs currently assigned to this unit.
</ParamField>

<ParamField body="CoworkerContractFullNames" type="string">
  Comma-separated list of customer names from contracts assigned to this unit.
</ParamField>

<ParamField body="CoworkerContractStartDates" type="string">
  Comma-separated list of start dates for contracts assigned to this unit.
</ParamField>

<ParamField body="AvailableFromTime" type="string">
  UTC date/time from which this unit becomes available.
</ParamField>

<ParamField body="AvailableToTime" type="string">
  UTC date/time until which this unit is available.
</ParamField>

<ParamField body="AvailableFromTimeLocal" type="string">
  Local date/time from which this unit becomes available (derived from AvailableFromTime).
</ParamField>

<ParamField body="AvailableToTimeLocal" type="string">
  Local date/time until which this unit is available (derived from AvailableToTime).
</ParamField>

<ParamField body="ArchilogicUniqueId" type="string">
  Unique identifier linking this unit to its corresponding element in an Archilogic 3D model.
</ParamField>

<ParamField body="FloorPlanLayoutAssetUniqueId" type="string">
  Unique identifier linking this unit to a component in the associated floor plan layout template.
</ParamField>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST \
    "https://spaces.nexudus.com/api/sys/floorplandesks" \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "FloorPlanId": 0,
      "Name": "",
      "ItemType": 0,
      "Size": 0,
      "Capacity": 0,
      "Price": 0,
      "PositionX": 0,
      "PositionY": 0,
      "PositionZ": 0
  }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/sys/floorplandesks',
    {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        FloorPlanId: 0,
        Name: '',
        ItemType: 0,
        Size: 0,
        Capacity: 0,
        Price: 0,
        PositionX: 0,
        PositionY: 0,
        PositionZ: 0
      })
    }
  );

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://spaces.nexudus.com/api/sys/floorplandesks',
      headers={
          'Authorization': 'Bearer YOUR_TOKEN',
          'Content-Type': 'application/json'
      },
      json={
          'FloorPlanId': 0,
          'Name': '',
          'ItemType': 0,
          'Size': 0,
          'Capacity': 0,
          'Price': 0,
          'PositionX': 0,
          'PositionY': 0,
          'PositionZ': 0
      }
  )

  data = response.json()
  ```
</CodeGroup>

## Response

### 200

<ResponseField name="Status" type="integer">
  HTTP status code. `200` on success.
</ResponseField>

<ResponseField name="Message" type="string">
  A human-readable message confirming the creation.
</ResponseField>

<ResponseField name="Value" type="object">
  Contains the `Id` of the newly created record.
</ResponseField>

<ResponseField name="WasSuccessful" type="boolean">
  `true` if the floorplandesk was created successfully.
</ResponseField>

<ResponseField name="Errors" type="array">
  `null` on success.
</ResponseField>

```json Example Response theme={null}
{
  "Status": 200,
  "Message": "FloorPlanDesk was successfully created.",
  "Value": {
    "Id": 87654321
  },
  "OpenInDialog": false,
  "OpenInWindow": false,
  "RedirectURL": null,
  "JavaScript": null,
  "UpdatedOn": "2025-01-15T10:30:00Z",
  "UpdatedBy": "admin@example.com",
  "Errors": null,
  "WasSuccessful": true
}
```

### 400

<ResponseField name="Message" type="string">
  A summary of the validation error(s), in the format `PropertyName: error message`.
</ResponseField>

<ResponseField name="Value" type="any">
  `null` on validation failure.
</ResponseField>

<ResponseField name="Errors" type="object[]">
  Array of validation errors.

  <Expandable>
    <ResponseField name="AttemptedValue" type="any">
      The value that was submitted for the field, or `null` if missing.
    </ResponseField>

    <ResponseField name="Message" type="string">
      The validation error message.
    </ResponseField>

    <ResponseField name="PropertyName" type="string">
      The name of the property that failed validation.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="WasSuccessful" type="boolean">
  `false` when the request fails validation.
</ResponseField>

```json Example Response theme={null}
{
  "Message": "Name: is a required field",
  "Value": null,
  "Errors": [
    {
      "AttemptedValue": null,
      "Message": "is a required field",
      "PropertyName": "Name"
    }
  ],
  "WasSuccessful": false
}
```
