Skip to main content
Version: 1.0

Devices

Introduction

Devices represent doors, gates, turnstiles, elevators, alarms, and any other devices that can be operated by a controller. Note that some events and commands may refer to devices simply as doors, such as the door.request.allowed event.

The device object

{
"id": 1,
"name": "Test Device",
"connection": 1,
"port": 1,
"partition": [
{
"id": 0,
"name": "Default"
}
],
"type": "primaryReader",
"publicIcon": "swingingDoor",
"inputTypes": ["wiegand", "unencryptedOsdp", "encryptedOsdp"],
"osdpAddress": 0,
"readerType": "red",
"readerSerialNumber": "032500000001773C",
"supportBleCredentials": true,
"securedReadsOnly": false,
"delay": 0,
"dwell": 30,
"dps": false,
"propAlarm": false,
"propDelay": 0,
"rex": false,
"forcedAlarm": false,
"autoOpenAfterFirstAllow": false,
"authenticationPolicy": "cardOrPin",
"hardwareVersion": "red1cn.d",
"serialNumber": "8003323",
"firmwareVersion": "1.1.41",
"bootloaderVersion": "1.0.44",
"startupVersion": "0.3.1",
"created": "2023-05-17 15:59:30",
"metadata": {}
}
PropertyTypeDescription
idStringThe device ID.
nameStringThe device name.
connectionIntegerThe connection ID.
portIntegerThe port number.
partitionObject[]An array of partitions that include this device.
typeStringThe device type. Possible values include primaryReader, additionalReader, ioDevice, premiumIoDevice, elevatorReader, additionalElevatorReader, and floorRelay.
publicIconStringThe device icon. Possible values include swingingDoor, swingingGate, rollUpDoor, alarm, light, fan, panicButton, sprinkler, and other.
primaryReaderIntegerThe primary reader ID. This only applies if type is set to additionalReader.
inputTypesString[]An array of allowed input types. Possible values include wiegand, unencryptedOsdp, and encryptedOsdp.
osdpAddressIntegerThe OSDP address. This only applies if inputTypes includes unencryptedOsdp or encryptedOsdp. Possible values include 0, 1, 2, and 3.
wirelessAddressStringThe wireless address of the device. This only applies if the connection type is set to wirelessCoordinator.
readerTypeStringThe reader type. Possible values include standard, touch, and red.
readerSerialNumberStringThe reader serial number.
supportBleCredentialsBooleanWhether the device supports Bluetooth credentials.
securedReadsOnlyBooleanWhether the device only supports high-security credentials.
delayIntegerThe amount of time (in tenths of a second) the relay will delay before actuating.
dwellIntegerThe amount of time (in tenths of a second) the relay will remain actuated.
dpsBooleanWhether the door position sensor (DPS) is enabled. This only applies if a DPS is installed.
propAlarmBooleanWhether the prop alarm is enabled, which triggers an alarm if a device is left open. This only applies if dps is set to true.
propDelayIntegerThe amount of time (in seconds) a device must be left open before a prop alarm is triggered. This only applies if propAlarm is set to true.
rexBooleanWhether the request to exit (REX) sensor is enabled. This only applies if a REX sensor is installed.
forcedAlarmBooleanWhether the forced alarm is enabled, which triggers an alarm if a device is forced opened. This only applies if dps is set to true.
autoOpenAfterFirstAllowBooleanWhether auto open will be enabled after the first successful access event.
authenticationPolicyStringThe authentication policy for this device. Possible values include null, cardOnly, pinOnly, cardOrPin, and cardAndPin (for two-factor authentication). Note that card refers to all types of credentials (not just cards). If a policy is set for both a rule and its corresponding device, the more restrictive policy will be enforced.
hardwareVersionStringThe controller hardware version.
serialNumberStringThe controller serial number.
firmwareVersionStringThe controller firmware version.
bootloaderVersionStringThe controller bootloader version.
startupVersionStringThe controller startup version.
createdStringThe device creation timestamp.
metadataObjectA user-defined metadata object.

Basic Endpoints

Create a device

Request

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

{
"name": "Test Device",
"connection": 1,
"port": 1
}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
panel_tokenHeaderStringYesA valid panel token.
nameBodyStringYesThe device name. This must be unique within a cloud node. The maximum length is 70 characters.
connectionBodyIntegerYesThe connection ID.
portBodyIntegerYesThe port number. This port must not be occupied by another device.
typeBodyStringNoThe device type. Possible values include primaryReader (default), additionalReader, ioDevice, premiumIoDevice, elevatorReader, additionalElevatorReader, and floorRelay.
publicIconBodyStringNoThe device icon. Possible values include swingingDoor (default), swingingGate, rollUpDoor, alarm, light, fan, panicButton, sprinkler, and other.
primaryReaderBodyIntegerNoThe primary reader ID. This only applies if type is set to additionalReader.
inputTypesBodyString[]NoAn array of allowed input types. Possible values include wiegand, unencryptedOsdp, and encryptedOsdp. All types are allowed by default.
osdpAddressBodyIntegerNoThe OSDP address. This only applies if inputTypes includes unencryptedOsdp or encryptedOsdp. Possible values include 0, 1, 2, and 3.
wirelessAddressBodyStringNoThe wireless address of the device. This only applies if the connection type is set to wirelessCoordinator.
readerTypeBodyStringNoThe reader type. Possible values include standard, touch, and red. The default is standard.
readerSerialNumberBodyStringNoThe reader serial number.
supportBleCredentialsBodyBooleanNoWhether the device should support Bluetooth credentials.
securedReadsOnlyBodyBooleanNoWhether the device should only support high-security credentials.
delayBodyIntegerNoThe amount of time (in tenths of a second) the relay should delay before actuating. The minimum value is 0 (default) and the maximum value is 9999.
dwellBodyIntegerNoThe amount of time (in tenths of a second) the relay should remain actuated. The minimum value is 1 and the maximum value is 9999. The default value is 30 (3 seconds).
dpsBodyBooleanNoWhether the door position sensor (DPS) should be enabled. This only applies if a DPS is installed. The default value is false.
propAlarmBodyBooleanNoWhether the prop alarm should be enabled, which triggers an alarm if a device is left open. This only applies if dps is set to true. The default value is false.
propDelayBodyIntegerNoThe amount of time (in seconds) a device must be left open before a prop alarm is triggered. This only applies if propAlarm is set to true. The minimum value is 0 (default) and the maximum value is 9999.
rexBodyBooleanNoWhether the request to exit (REX) sensor should be enabled. This only applies if a REX sensor is installed. The default value is false.
forcedAlarmBodyBooleanNoWhether the forced alarm should be enabled, which triggers an alarm if a device is forced opened. This only applies if dps is set to true. The default value is false.
autoOpenAfterFirstAllowBodyBooleanNoWhether auto open should be enabled after the first successful access event. The default value is false.
authenticationPolicyBodyStringNoThe authentication policy for this device. Possible values include null (default), cardOnly, pinOnly, cardOrPin, and cardAndPin (for two-factor authentication). Note that card refers to all types of credentials (not just cards). If a policy is set for both a rule and its corresponding device, the more restrictive policy will be enforced.
metadataBodyObjectNoA user-defined metadata object. The data storage limit is 10 KB.

Response

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

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

{
"id": 1
}

Retrieve a device

Request

GET https://panel-{{panel_id}}.pdk.io/api/devices/{{device_id}} HTTP/1.1
Authorization: Bearer {{panel_token}}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
device_idPathIntegerYesThe device ID.
panel_tokenHeaderStringYesA valid panel token.

Response

The response contains a device object.

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

{
"id": 1,
"name": "Test Device",
"connection": 1,
"port": 1,
"partition": [
{
"id": 0,
"name": "Default"
}
],
"type": "primaryReader",
"publicIcon": "swingingDoor",
"inputTypes": ["wiegand", "unencryptedOsdp", "encryptedOsdp"],
"osdpAddress": 0,
"readerType": "red",
"readerSerialNumber": "032500000001773C",
"supportBleCredentials": true,
"securedReadsOnly": false,
"delay": 0,
"dwell": 30,
"dps": false,
"propAlarm": false,
"propDelay": 0,
"rex": false,
"forcedAlarm": false,
"autoOpenAfterFirstAllow": false,
"authenticationPolicy": "cardOrPin",
"hardwareVersion": "red1cn.d",
"serialNumber": "8003323",
"firmwareVersion": "1.1.41",
"bootloaderVersion": "1.0.44",
"startupVersion": "0.3.1",
"created": "2023-05-17 15:59:30",
"metadata": {}
}

Update a device

Request

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

{
"name": "Test Device",
"type": "primaryReader",
"publicIcon": "swingingDoor",
"connection": 1,
"port": 1,
"delay": 0,
"dwell": 3,
"dps": false,
"rex": false,
"autoOpenAfterFirstAllow": false,
"authenticationPolicy": "cardOrPin"
}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
device_idPathIntegerYesThe device ID.
panel_tokenHeaderStringYesA valid panel token.
nameBodyStringYesThe device name. This must be unique within a cloud node. The maximum length is 70 characters.
connectionBodyIntegerYesThe connection ID.
portBodyIntegerYesThe port number. This port must not be occupied by another device.
typeBodyStringYesThe device type. Possible values include primaryReader (default), additionalReader, ioDevice, premiumIoDevice, elevatorReader, additionalElevatorReader, and floorRelay.
publicIconBodyStringYesThe device icon. Possible values include swingingDoor (default), swingingGate, rollUpDoor, alarm, light, fan, panicButton, sprinkler, and other.
primaryReaderBodyIntegerNoThe primary reader ID. This only applies if type is set to additionalReader.
inputTypesBodyString[]NoAn array of allowed input types. Possible values include wiegand, unencryptedOsdp, and encryptedOsdp. All types are allowed by default.
osdpAddressBodyIntegerNoThe OSDP address. This only applies if inputTypes includes unencryptedOsdp or encryptedOsdp. Possible values include 0, 1, 2, and 3.
wirelessAddressBodyStringNoThe wireless address of the device. This only applies if the connection type is set to wirelessCoordinator.
readerTypeBodyStringNoThe reader type. Possible values include standard, touch, and red. The default is standard.
readerSerialNumberBodyStringNoThe reader serial number.
supportBleCredentialsBodyBooleanNoWhether the device should support Bluetooth credentials.
securedReadsOnlyBodyBooleanNoWhether the device should only support high-security credentials.
delayBodyIntegerYesThe amount of time (in tenths of a second) the relay should delay before actuating. The minimum value is 0 (default) and the maximum value is 9999.
dwellBodyIntegerYesThe amount of time (in tenths of a second) the relay should remain actuated. The minimum value is 1 and the maximum value is 9999. The default value is 30 (3 seconds).
dpsBodyBooleanYesWhether the door position sensor (DPS) should be enabled. This only applies if a DPS is installed. The default value is false.
propAlarmBodyBooleanNoWhether the prop alarm should be enabled, which triggers an alarm if a device is left open. This only applies if dps is set to true. The default value is false.
propDelayBodyIntegerNoThe amount of time (in seconds) a device must be left open before a prop alarm is triggered. This only applies if propAlarm is set to true. The minimum value is 0 (default) and the maximum value is 9999.
rexBodyBooleanYesWhether the request to exit (REX) sensor should be enabled. This only applies if a REX sensor is installed. The default value is false.
forcedAlarmBodyBooleanNoWhether the forced alarm should be enabled, which triggers an alarm if a device is forced opened. This only applies if dps is set to true. The default value is false.
autoOpenAfterFirstAllowBodyBooleanYesWhether auto open should be enabled after the first successful access event. The default value is false.
authenticationPolicyBodyStringYesThe authentication policy for this device. Possible values include null (default), cardOnly, pinOnly, cardOrPin, and cardAndPin (for two-factor authentication). Note that card refers to all types of credentials (not just cards). If a policy is set for both a rule and its corresponding device, the more restrictive policy will be enforced.
metadataBodyObjectNoA user-defined metadata object.

Response

HTTP/1.1 204 No Content

Delete a device

Request

DELETE https://panel-{{panel_id}}.pdk.io/api/devices/{{device_id}} HTTP/1.1
Authorization: Bearer {{panel_token}}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
device_idPathIntegerYesThe device ID.
panel_tokenHeaderStringYesA valid panel token.

Response

HTTP/1.1 204 No Content

List all devices

Request

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

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

[
{
"id": 1,
"name": "Test Device 1",
"connection": 1,
"port": 1,
"partition": [
{
"id": 0,
"name": "Default"
}
],
"type": "primaryReader",
"publicIcon": "swingingDoor",
"inputTypes": ["wiegand", "unencryptedOsdp", "encryptedOsdp"],
"osdpAddress": 0,
"readerType": "red",
"readerSerialNumber": "032500000001773C",
"supportBleCredentials": true,
"securedReadsOnly": false,
"delay": 0,
"dwell": 30,
"dps": false,
"propAlarm": false,
"propDelay": 0,
"rex": false,
"forcedAlarm": false,
"autoOpenAfterFirstAllow": false,
"authenticationPolicy": "cardOrPin",
"hardwareVersion": "red2.?",
"serialNumber": "8003323",
"firmwareVersion": "1.1.41",
"bootloaderVersion": "1.0.44",
"startupVersion": "0.3.1",
"created": "2023-05-17 15:59:30",
"metadata": {}
},
{
"id": 2,
"name": "Test Device 2",
"connection": 1,
"port": 2,
"partition": [
{
"id": 0,
"name": "Default"
}
],
"type": "primaryReader",
"publicIcon": "swingingDoor",
"inputTypes": ["wiegand", "unencryptedOsdp", "encryptedOsdp"],
"osdpAddress": 1,
"readerType": "red",
"readerSerialNumber": "032500000001773D",
"supportBleCredentials": true,
"securedReadsOnly": false,
"delay": 0,
"dwell": 30,
"dps": false,
"propAlarm": false,
"propDelay": 0,
"rex": false,
"forcedAlarm": false,
"autoOpenAfterFirstAllow": false,
"authenticationPolicy": "cardOrPin",
"hardwareVersion": "red2.?",
"serialNumber": "8003324",
"firmwareVersion": "1.1.41",
"bootloaderVersion": "1.0.44",
"startupVersion": "0.3.1",
"created": "2023-05-17 15:59:30",
"metadata": {}
}
]

Add devices to a partition

Request

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

{
"devices": [1, 2, 3]
}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
partition_idPathIntegerYesThe partition ID.
panel_tokenHeaderStringYesA valid panel token.
devicesBodyInteger[]YesAn array of device IDs.

Response

HTTP/1.1 204 No Content

Remove a device from a partition

Request

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

Response

HTTP/1.1 204 No Content

List all devices on a partition

Request

GET https://panel-{{panel_id}}.pdk.io/api/partitions/{{partition_id}}/devices HTTP/1.1
Authorization: Bearer {{panel_token}}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
partition_idPathIntegerYesThe partition ID.
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 device objects.

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

[
{
"id": 1,
"name": "Test Device 1",
"connection": 1,
"port": 1,
"type": "primaryReader",
"publicIcon": "swingingDoor",
"inputTypes": ["wiegand", "unencryptedOsdp", "encryptedOsdp"],
"osdpAddress": 0,
"readerType": "red",
"readerSerialNumber": "032500000001773C",
"supportBleCredentials": true,
"securedReadsOnly": false,
"delay": 0,
"dwell": 30,
"dps": false,
"propAlarm": false,
"propDelay": 0,
"rex": false,
"forcedAlarm": false,
"autoOpenAfterFirstAllow": false,
"authenticationPolicy": "cardOrPin",
"hardwareVersion": "red2.?",
"serialNumber": "8003323",
"firmwareVersion": "1.1.41",
"bootloaderVersion": "1.0.44",
"startupVersion": "0.3.1",
"created": "2023-05-17 15:59:30",
"metadata": {}
},
{
"id": 2,
"name": "Test Device 2",
"connection": 1,
"port": 2,
"type": "primaryReader",
"publicIcon": "swingingDoor",
"inputTypes": ["wiegand", "unencryptedOsdp", "encryptedOsdp"],
"osdpAddress": 1,
"readerType": "red",
"readerSerialNumber": "032500000001773D",
"supportBleCredentials": true,
"securedReadsOnly": false,
"delay": 0,
"dwell": 30,
"dps": false,
"propAlarm": false,
"propDelay": 0,
"rex": false,
"forcedAlarm": false,
"autoOpenAfterFirstAllow": false,
"authenticationPolicy": "cardOrPin",
"hardwareVersion": "red2.?",
"serialNumber": "8003324",
"firmwareVersion": "1.1.41",
"bootloaderVersion": "1.0.44",
"startupVersion": "0.3.1",
"created": "2023-05-17 15:59:30",
"metadata": {}
}
]

Commands

Open and close a device as a person

Request

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

{
"personId": 1
}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
device_idPathIntegerYesThe device ID.
panel_tokenHeaderStringYesA valid panel token.
personIdBodyIntegerYesA person ID.

Response

HTTP/1.1 204 No Content

Open and close a device

Request

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

{
"delay": 30
}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
device_idPathIntegerYesThe device ID.
panel_tokenHeaderStringYesA valid panel token.
delayBodyIntegerYesThe amount of time (in tenths of a second) the device will remain open before closing. The minimum value is 0 and the maximum value is 9999.

Response

HTTP/1.1 204 No Content

Open a device

Request

POST https://panel-{{panel_id}}.pdk.io/api/devices/{{device_id}}/open HTTP/1.1
Authorization: Bearer {{panel_token}}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
device_idPathIntegerYesThe device ID.
panel_tokenHeaderStringYesA valid panel token.

Response

HTTP/1.1 204 No Content

Open a device after a delay

Request

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

{
"delay": 30
}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
device_idPathIntegerYesThe device ID.
panel_tokenHeaderStringYesA valid panel token.
delayBodyIntegerYesThe amount of delay (in tenths of a second) before the device opens. The minimum value is 0 and the maximum value is 9999.

Response

HTTP/1.1 204 No Content

Close a device

Request

POST https://panel-{{panel_id}}.pdk.io/api/devices/{{device_id}}/close HTTP/1.1
Authorization: Bearer {{panel_token}}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
device_idPathIntegerYesThe device ID.
panel_tokenHeaderStringYesA valid panel token.

Response

HTTP/1.1 204 No Content

Close a device after a delay

Request

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

{
"delay": 30
}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
device_idPathIntegerYesThe device ID.
panel_tokenHeaderStringYesA valid panel token.
delayBodyIntegerYesThe amount of delay (in tenths of a second) before the device closes. The minimum value is 0 and the maximum value is 9999.

Response

HTTP/1.1 204 No Content

Toggle a device's state

Request

POST https://panel-{{panel_id}}.pdk.io/api/devices/{{device_id}}/force_toggle HTTP/1.1
Authorization: Bearer {{panel_token}}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
device_idPathIntegerYesThe device ID.
panel_tokenHeaderStringYesA valid panel token.

Response

HTTP/1.1 204 No Content

Toggle a device's do not disturb mode

Request

POST https://panel-{{panel_id}}.pdk.io/api/devices/{{device_id}}/dnd HTTP/1.1
Authorization: Bearer {{panel_token}}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
device_idPathIntegerYesThe device ID.
panel_tokenHeaderStringYesA valid panel token.

Response

HTTP/1.1 204 No Content