---
title: "Create a unit group"
method: POST
path: "/inventory/v0-nsfw/unit-groups"
tags: ["UnitGroup"]
---

# Create a unit group

`POST /inventory/v0-nsfw/unit-groups`

## Request

- Base URL: `https://api.apaleo.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.apaleo.com/inventory/v0-nsfw/unit-groups`
- Auth: OAuth 2
  - Implicit: `https://identity.apaleo.com/connect/authorize`
  - Scopes: `unitgroups.create`, `setup.manage`, `admin`

Use this call to create a new unit group.<br>You must have at least one of these scopes: 'unitgroups.create, setup.manage'.

## Headers

- `Idempotency-Key` string

## Request body

- CreateUnitGroupModel
  - `code` string, required: The code for the unit group that can be shown in reports and table views
  - `propertyId` string, required: The id of the property where unit group will be created
  - `name` object, required: The name for the unit group
  - `description` object, required: The description for the unit group
  - `maxPersons` integer, required: Maximum number of persons for the unit group
  - `rank` integer, nullable: The unit group rank Restrictions: - Should be greater or equal to one
  - `type` 'BedRoom' | 'MeetingRoom' | 'EventSpace' | 'ParkingLot', nullable: The unit group type
  - `connectedUnitGroups` CreateConnectedUnitGroupModel[], nullable: The list of connected unit groups this unit group is composed of
    - `unitGroupId` string, required: The connected unit group id
    - `memberCount` integer, required: The number of units for this connected unit group

## Response `201`

Creation of the new unit group was successful.

- UnitGroupCreatedModel
  - `id` string, required: The unit group id

## Other responses

- `400`: Bad request.
- `401`: You are unauthorized.
- `403`: Forbidden.
- `404`: The Request-URI could not be found.
- `415`: Unsupported media type.
- `422`: Validation errors in the request body or query params.
- `499`: Client closed request.
- `500`: An unexpected error occurred.
- `503`: The server is currently unavailable. Please try later.

---

[API](https://skmtc.dev/apaleo/apis/apaleo-inventory-api-not-safe-for-work.md) - [All operations](https://skmtc.dev/apaleo/apis/apaleo-inventory-api-not-safe-for-work/llms.txt) - [OpenAPI document](https://skmtc.dev/apaleo/apis/apaleo-inventory-api-not-safe-for-work/revisions/64434c68f85d?raw)
