Skip to main content
Version: 1.0

People

Introduction

People represent credential holders in the access control system.

The person object

{
"id": 1,
"firstName": "John",
"lastName": "Wiegand",
"email": "john@example.com",
"photoUrl": "https://panel-1234ABC.pdk.io:443/images/250f7660-267a-11ee-bcc3-a3fcec96bc14",
"partition": 0,
"enabled": true,
"activeDate": "2023-07-17T09:00:00",
"expireDate": "2023-07-21T17:00:00",
"customAttributes": {
"employee_id": 1234567
},
"metadata": {},
"groups": [
{
"id": 1,
"name": "Test Group",
"partition": 0,
"metadata": {}
}
],
"credentials": [
{
"id": 1,
"personId": 1,
"credentialNumber": 1234567,
"facilityCode": null,
"description": null,
"types": ["card"]
},
{
"id": 2,
"personId": 1,
"credentialNumber": null,
"facilityCode": null,
"description": "Pending",
"types": ["touch", "token"]
}
]
}
PropertyTypeDescription
idIntegerThe person ID.
firstNameStringThe person's first name.
lastNameStringThe person's last name.
emailStringThe person's email address.
photoUrlStringThe URL of the person's photo.
partitionIntegerThe ID of the partition that this person is associated with.
enabledBooleanWhether rules will be processed for this person.
activeDateStringThe date rules will start processing for this person. This is formatted as YYYY-MM-DDTHH:mm:ss.
expireDateStringThe date rules will stop processing for this person. This is formatted as YYYY-MM-DDTHH:mm:ss.
pinStringThe person's PIN code.
duressPinStringThe person's duress PIN code.
customAttributesObjectAn object containing custom field values for this person.
metadataObjectA user-defined metadata object.
groupsObject[]An array of group objects representing the groups this person is assigned to.
credentialsObject[]An array of credential objects representing the credentials issued to this person.

Basic Endpoints

Create a person

Request

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

{
"firstName": "John",
"lastName": "Wiegand"
}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
panel_tokenHeaderStringYesA valid panel token.
firstNameBodyStringYesThe person's first name. The maximum length is 35 characters.
lastNameBodyStringYesThe person's last name. The maximum length is 35 characters.
emailBodyStringNoThe person's email address.
partitionBodyIntegerNoThe ID of the partition that this person should be associated with.
enabledBodyBooleanNoWhether rules should be processed for this person. The default value is true.
activeDateBodyStringNoThe date to start processing rules for this person. This is formatted as YYYY-MM-DDTHH:mm:ss.
expireDateBodyStringNoThe date to stop processing rules for this person. This is formatted as YYYY-MM-DDTHH:mm:ss.
pinBodyStringNoThe person's PIN code. Possible values include a string of digits or null.
duressPinBodyStringNoThe person's duress PIN code. Possible values include a string of digits or null.
customAttributesBodyObjectNoAn object containing custom field values for this person.
metadataBodyObjectNoA user-defined metadata object. The data storage limit is 10 KB.

Response

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

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

{
"id": 1
}

Retrieve a person

Request

GET https://panel-{{panel_id}}.pdk.io/api/persons/{{person_id}} HTTP/1.1
Authorization: Bearer {{panel_token}}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
person_idPathIntegerYesThe person ID.
panel_tokenHeaderStringYesA valid panel token.
tip

If you need to retrieve a person by a field other than the person ID (e.g. email address), you can preview a people report using the desired field as a filter.

Response

The response contains a person object.

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

{
"id": 1,
"firstName": "John",
"lastName": "Wiegand",
"email": "john@example.com",
"partition": 0,
"enabled": true,
"activeDate": "2023-07-17T09:00:00",
"expireDate": "2023-07-21T17:00:00",
"customAttributes": {
"employee_id": 1234567
},
"metadata": {},
"groups": [
{
"id": 1,
"name": "Test Group",
"partition": 0,
"metadata": {}
}
],
"credentials": [
{
"id": 1,
"personId": 1,
"credentialNumber": 1234567,
"facilityCode": null,
"description": null,
"types": ["card"]
},
{
"id": 2,
"personId": 1,
"credentialNumber": null,
"facilityCode": null,
"description": "Pending",
"types": ["touch", "token"]
}
]
}

Update a person

Request

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

{
"firstName": "John",
"lastName": "Wiegand",
"partition": 0,
"enabled": true,
"activeDate": null,
"expireDate": null,
"pin": null,
"duressPin": null
}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
person_idPathIntegerYesThe person ID.
panel_tokenHeaderStringYesA valid panel token.
firstNameBodyStringYesThe person's first name. The maximum length is 35 characters.
lastNameBodyStringYesThe person's last name. The maximum length is 35 characters.
emailBodyStringNoThe person's email address.
partitionBodyIntegerYesThe ID of the partition that this person should be associated with.
enabledBodyBooleanYesWhether rules should be processed for this person. The default value is true.
activeDateBodyStringYesThe date to start processing rules for this person. This is formatted as YYYY-MM-DDTHH:mm:ss.
expireDateBodyStringYesThe date to stop processing rules for this person. This is formatted as YYYY-MM-DDTHH:mm:ss.
pinBodyStringYesThe person's PIN code. Possible values include a string of digits or null.
duressPinBodyStringYesThe person's duress PIN code. Possible values include a string of digits or null.
customAttributesBodyObjectNoAn object containing custom field values for this person.
metadataBodyObjectNoA user-defined metadata object. The data storage limit is 10 KB.

Response

HTTP/1.1 204 No Content

Delete a person

Request

DELETE https://panel-{{panel_id}}.pdk.io/api/persons/{{person_id}} HTTP/1.1
Authorization: Bearer {{panel_token}}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
person_idPathIntegerYesThe person ID.
panel_tokenHeaderStringYesA valid panel token.

Response

HTTP/1.1 204 No Content

List all people

Request

GET https://panel-{{panel_id}}.pdk.io/api/persons 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 person objects.

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

[
{
"id": 1,
"firstName": "John",
"lastName": "Wiegand",
"email": "john@example.com",
"partition": 0,
"enabled": true,
"activeDate": "2023-07-17T09:00:00",
"expireDate": "2023-07-21T17:00:00",
"customAttributes": {
"employee_id": 1234567
},
"metadata": {},
"groups": [
{
"id": 1,
"name": "Test Group",
"partition": 0,
"metadata": {}
}
],
"credentials": [
{
"id": 1,
"personId": 1,
"credentialNumber": 1234567,
"facilityCode": null,
"description": null,
"types": ["card"]
},
{
"id": 2,
"personId": 1,
"credentialNumber": null,
"facilityCode": null,
"description": "Pending",
"types": ["touch", "token"]
}
]
}
]

List all people in a group

Request

GET https://panel-{{panel_id}}.pdk.io/api/groups/{{group_id}}/persons HTTP/1.1
Authorization: Bearer {{panel_token}}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
group_idPathIntegerYesThe group ID.
panel_tokenHeaderStringYesA valid panel token.

Response

The response contains an array of person objects.

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

[
{
"id": 1,
"firstName": "John",
"lastName": "Wiegand",
"email": "john@example.com",
"partition": 0,
"enabled": true,
"activeDate": "2023-07-17T09:00:00",
"expireDate": "2023-07-21T17:00:00",
"customAttributes": {
"employee_id": 1234567
},
"metadata": {},
"groups": [
{
"id": 1,
"name": "Test Group",
"partition": 0,
"metadata": {}
}
],
"credentials": [
{
"id": 1,
"personId": 1,
"credentialNumber": 1234567,
"facilityCode": null,
"description": null,
"types": ["card"]
},
{
"id": 2,
"personId": 1,
"credentialNumber": null,
"facilityCode": null,
"description": "Pending",
"types": ["touch", "token"]
}
]
}
]

List all entities for many people

This endpoint allows you to retrieve the groups, devices, rules, and floor groups associated with many people. For users familiar with Windows environments, this is similar to a resultant set of policy (RSOP) report.

Request

GET https://panel-{{panel_id}}.pdk.io/api/rsop/persons?ids=1,2,3 HTTP/1.1
Authorization: Bearer {{panel_token}}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
idsQueryStringYesA comma-delimited list of person IDs.
panel_tokenHeaderStringYesA valid panel token.

Response

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

{
"date": "2023-07-19T13:03:26-07:00",
"persons": [
{
"id": 1,
"enabled": true,
"groups": [
{
"id": 1,
"name": "Test Group"
}
],
"doors": [
{
"id": 1,
"activeRuleId": 1,
"allowed": true,
"name": "Test Device 1",
"created": "2023-07-17 14:42:01",
"type": "primaryReader",
"publicIcon": "swingingDoor",
"readerType": null,
"securedReadsOnly": false,
"supportBleCredentials": true,
"readerSerialNumber": "032500000001773C"
}
],
"rules": [
{
"id": 1,
"type": "door",
"active": true,
"allow": true,
"authenticationPolicy": "cardOrPin",
"startTime": "00:00",
"stopTime": "24:00",
"recurring": ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
},
{
"id": 2,
"type": "elevator",
"active": true,
"authenticationPolicy": "cardOrPin",
"startTime": "00:00",
"stopTime": "24:00",
"recurring": ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
}
],
"floorGroups": [
{
"id": 1,
"activeRuleId": 2,
"allowed": true,
"name": "Test Floor Group",
"readerPort": {
"id": 2,
"name": "Test Device 2",
"type": "elevatorReader"
},
"floors": [
{
"id": 3,
"name": "Test Device 3",
"type": "floorRelay"
}
]
}
]
}
]
}
PropertyTypeDescription
dateStringAn ISO 8601 timestamp representing the current time.
personsObject[]An array of people and their associated entities.
persons.idIntegerThe person ID.
persons.enabledBooleanWhether the person is enabled.
persons.doorsObject[]An array of device objects representing the devices associated with the person.
persons.floorGroupsObject[]An array of floor group objects representing the floor groups associated with the person.
persons.groupsObject[]An array of group objects representing the groups associated with the person.
persons.rulesObject[]An array of rule objects representing the rules associated with the person.

Update a person's photo

Request

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

{
"base64": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAAAAAAcD2kOAAABZklEQVR4Ae3XAYnDMBTG8RqogBqIgRqogBiYgRiogBqYgRiIgBh4Bj5Rd13yIAs5uHHrGwffH2DNI+MH3cLWCR+KMGHChAkTJkz4tQgTJkyYMGHChAkTJkyYcIqDZDAXlOQevqtLiYPSr+B1GhQH84iztOnaHQDiNGi9AA7txCUrWF1tsYJ7JvwFvq2PlvqeUlJ4qYMyq5/vFoI7X2dBWktTu/v2wnHSm9jfiYAmKXvu53X29aI0dbvfC8enG5kTbGEHzRiednNY9BQd+XJ4DaUDZ27S3C5Xwv3RvLcjL3YwfDubkx2M0MtWMHJYmul1sB/8xKbgVM4mx6m1Kx2tYcjyIRjeFJZtU8qZwar5fF4d5TzhGrj/I7DXQxT0a+0vg9tinrvJnG1g6UcHbGBgn5v1fMAMhuxOlz7jLXCOj6D9+AiTyxMMnitbMp8WCRMmTJgwYcKECRMmTJgwYcKECRMmTPhfwV9kH2srWmFAYQAAAABJRU5ErkJggg=="
}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
person_idPathIntegerYesThe person ID.
panel_tokenHeaderStringYesA valid panel token.
base64BodyStringYesThe photo encoded as a data URL.

Response

HTTP/1.1 204 No Content

Preview a people file import

Request

POST https://panel-{{panel_id}}.pdk.io/api/persons/import/preview HTTP/1.1
Authorization: Bearer {{panel_token}}
Content-Type: application/json
Want-Digest: sha-265

{
"csv": "First Name,Last Name\nJohn, Wiegand\nJames, Maxwell\nMichael, Faraday"
}

ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
panel_tokenHeaderStringYesA valid panel token.
csvBodyStringYesA CSV string containing a list of people to be imported. A CSV template can be downloaded here.
partitionBodyIntegerNoThe partition ID.
upsertBodyBooleanNoWhether the import should update or delete existing records.
info

Including the Want-Digest header in the request will produce a Digest header in the response. The value provided in the Digest header will be required if conflicts need to be resolved when importing people from a file.

Response

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

{
"toBeCreated": 3,
"toBeUpdated": 0,
"toBeDeleted": 0,
"conflicts": [
{
"line": 2,
"firstName": "John",
"lastName": "Wiegand",
"matches": [
{
"id": 1,
"firstName": "John",
"lastName": "Wiegand"
}
]
}
]
}
PropertyTypeDescription
toBeCreatedIntegerThe number of people that would be created by this import.
toBeUpdatedIntegerThe number of people that would be updated by this import.
toBeDeletedIntegerThe number of people that would be deleted by this import.
conflictsObject[]A list of conflicts that will need to be resolved when executing this import.
conflicts.lineIntegerThe line number of the conflict.
conflicts.idIntegerThe ID of the person associated with the conflict.
conflicts.firstNameStringThe first name of the person associated with the conflict.
conflicts.lastNameStringThe last name of the person associated with the conflict.
conflicts.matchesObject[]An array of conflicting person objects. Note that only the id, firstName, and lastName properties are included.

Import people from a file

tip

This endpoint is intended for one-time import operations (e.g. importing records from an old access control system). Ongoing data synchronization should be implemented using individual requests, which are more efficient and allow for more granular error handling.

Request

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

{
"csv": "First Name,Last Name\nJohn, Wiegand\nJames, Maxwell\nMichael, Faraday",
"resolutions": [
{
"line": 2,
"decision": "skip"
}
]
}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
panel_tokenHeaderStringYesA valid panel token.
digestHeaderStringSometimesThe digest value obtained from the Digest header in the response of the preview a people file import endpoint. This is required if the import has conflicts that need to be resolved.
csvBodyStringYesA CSV string containing a list of people to be imported. A CSV template can be downloaded here.
resolutionsBodyObject[]SometimesAn array of objects describing how individual conflicts should be handled. This is required if the import has conflicts that need to be resolved.
resolutions.lineBodyIntegerYesThe line number of the conflict.
resolutions.decisionBodyStringYesHow the conflict should be handled. Possible values include create, update, delete, and skip.
partitionBodyIntegerNoThe partition ID.
upsertBodyBooleanNoWhether the import should update or delete existing records.

Response

The response contains an array of person objects representing the people that were created or updated.

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

[
{
"id": 1,
"firstName": "John",
"lastName": "Wiegand",
...
},
{
"id": 2,
"firstName": "James",
"lastName": "Maxwell",
...
},
{
"id": 3,
"firstName": "Michael",
"lastName": "Faraday",
...
}
]

Delete many people

Request

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

{
"persons": [1, 2, 3]
}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
panel_tokenHeaderStringYesA valid panel token.
personsBodyInteger[]YesA list of person IDs representing people who should be deleted.

Response

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

{
"deleted": [1, 2, 3]
}
PropertyTypeDescription
deletedInteger[]A list of person IDs representing people who were deleted.