Skip to main content
Version: 1.0

Partitions

Introduction

Partitions can be used to create multiple access control systems with a single cloud node. Partitions might represent individual businesses within a multi-tenant office building, departments within a large company, or floors of a multi-story building. Each partition has a separate set of people, credentials, groups, and rules.

The partition object

{
"id": 1,
"name": "Test Partition"
}
PropertyTypeDescription
idIntegerThe partition ID.
nameStringThe partition name.

Basic Endpoints

Create a partition

Request

POST https://panel-{{panel_id}}.pdk.io/api/partitions HTTP/1.1
Authorization: Bearer {{panel_token}}
Content-Type: application/json

{
"name": "Test Partition",
"users": [
"6d4b2edf5b38d7000169b240",
"64529c8ba954b300028a64cf",
"5da649b8c379b20001b2e4b5"
]
}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
panel_tokenHeaderStringYesA valid panel token.
nameBodyStringYesThe partition name. This must be unique within a cloud node.
usersBodyString[]NoThe IDs of pdk.io users assigned to manage this partition. User IDs can be obtained from the permissions endpoints.

Response

The response contains the ID of the newly created partition object.

HTTP/1.1 200 OK
Content-Type: application/json

{
"id": 1
}

Retrieve a partition

GET https://panel-{{panel_id}}.pdk.io/api/partitions/{{partition_id}} HTTP/1.1
Authorization: Bearer {{panel_token}}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
partition_idPathIntegerYesThe partition ID.
panel_tokenHeaderStringYesA valid panel token.

Response

The response contains a partition object.

HTTP/1.1 200 OK
Content-Type: application/json

{
"id": 1,
"name": "Test Partition"
}

Update a partition

Request

PUT https://panel-{{panel_id}}.pdk.io/api/partitions/{{partition_id}} HTTP/1.1
Authorization: Bearer {{panel_token}}
Content-Type: application/json

{
"name": "Test Partition",
"users": [
"6d4b2edf5b38d7000169b240",
"64529c8ba954b300028a64cf",
"5da649b8c379b20001b2e4b5"
]
}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
partition_idPathIntegerYesThe partition ID.
panel_tokenHeaderStringYesA valid panel token.
nameBodyStringYesThe partition name. This must be unique within a cloud node.
usersBodyString[]YesThe IDs of pdk.io users assigned to manage this partition. User IDs can be obtained from the permissions endpoints. This value is required but it can be set to null.

Response

HTTP/1.1 204 No Content

Delete a partition

Request

DELETE https://panel-{{panel_id}}.pdk.io/api/partitions/{{partition_id}} HTTP/1.1
Authorization: Bearer {{panel_token}}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
partition_idPathIntegerYesThe partition ID.
panel_tokenHeaderStringYesA valid panel token.

Response

HTTP/1.1 204 No Content

List all partitions

GET https://panel-{{panel_id}}.pdk.io/api/partitions HTTP/1.1
Authorization: Bearer {{panel_token}}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
pageQueryIntegerNoThe zero-based page number used for pagination. The default value is 0.
per_pageQueryIntegerNoThe number of items per page used for pagination. The default value is 10 and the maximum value is 100.
panel_tokenHeaderStringYesA valid panel token.

Response

The response contains an array of partition objects.

HTTP/1.1 200 OK
Content-Type: application/json

[
{
"id": 0,
"name": "Default"
},
{
"id": 1,
"name": "Test Partition"
}
]