Skip to main content
POST
Create a space assignment
With exclusive set to true, KODE deletes every other assignment of the tenant in this building before it creates the new one. This cannot be undone. Leave exclusive out unless you mean to replace the tenant’s assignments.
Each space must be a space unit that is leasable. A level, a zone, or a space unit that is not leasable fails with 400 and the message “Invalid Spaces for Assignment”. A tenant or space that is not in this building fails with 400, and nothing is created.
The response is 200, not 201. isActive is true when the assignment has started and has not ended. An assignment with no startDate is not active. The type is always lease.

Authorizations

Authorization
string
header
required

Paste an access token from Create an access token. Tokens expire, so request a new one if you receive 401.

Path Parameters

buildingId
string
required

Building identifier from List buildings.

Body

application/json
tenantId
string
required

Identifier of the tenant. The tenant must be in this building. Required.

Pattern: \S
spaceIds
string[]
required

Identifiers of the spaces to assign. Each must be a leasable space unit in this building. Required.

Minimum array length: 1
startDate
string<date>

First day of the assignment (YYYY-MM-DD).

Example:

"2022-03-10T00:00:00.000Z"

endDate
string<date>

Last day of the assignment (YYYY-MM-DD).

Example:

"2022-03-10T00:00:00.000Z"

description
string

Free text about the assignment.

exclusive
boolean

Set to true to delete the tenant's other assignments in this building before this one is created. The default is false.

Response

The created assignment.

_id
string

Assignment identifier.

organizationId
string
createdAt
string
read-only

Date and time in UTC, with a numeric offset and no colon, for example 2026-10-28T13:51:31+0000.

Example:

"2026-10-28T13:51:31+0000"

updatedAt
string
read-only

Date and time in UTC, with a numeric offset and no colon, for example 2026-10-28T13:51:31+0000.

Example:

"2026-10-28T13:51:31+0000"

tenant
object

The tenant of the assignment.

spaces
object[]

The spaces of the assignment.

startDate
string<date>

First day of the assignment.

Example:

"2022-03-10T00:00:00.000Z"

endDate
string<date>

Last day of the assignment.

Example:

"2022-03-10T00:00:00.000Z"

type
string

Always lease.

description
string

Free text about the assignment.

isActive
boolean

true when the assignment has started and has not ended. An assignment with no start date is not active.