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"
}
Property | Type | Description |
---|---|---|
id | Integer | The partition ID. |
name | String | The 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"
]
}
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
panel_id | Path | String | Yes | The cloud node serial number. |
panel_token | Header | String | Yes | A valid panel token. |
name | Body | String | Yes | The partition name. This must be unique within a cloud node. |
users | Body | String[] | No | The 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}}
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
panel_id | Path | String | Yes | The cloud node serial number. |
partition_id | Path | Integer | Yes | The partition ID. |
panel_token | Header | String | Yes | A 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"
]
}
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
panel_id | Path | String | Yes | The cloud node serial number. |
partition_id | Path | Integer | Yes | The partition ID. |
panel_token | Header | String | Yes | A valid panel token. |
name | Body | String | Yes | The partition name. This must be unique within a cloud node. |
users | Body | String[] | Yes | The 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}}
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
panel_id | Path | String | Yes | The cloud node serial number. |
partition_id | Path | Integer | Yes | The partition ID. |
panel_token | Header | String | Yes | A 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}}
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
panel_id | Path | String | Yes | The cloud node serial number. |
page | Query | Integer | No | The zero-based page number used for pagination. The default value is 0. |
per_page | Query | Integer | No | The number of items per page used for pagination. The default value is 10 and the maximum value is 100. |
panel_token | Header | String | Yes | A 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"
}
]