Skip to main content
Version: 2.0

Rules

Introduction

Rules determine how an access control system will respond in a given scenario. Rules are divided into 4 categories: holder rules, group rules, auto open rules, and system event rules.

The rule object

{
"id": "584e6c47-a7cd-44f1-aba0-0453858dfd41",
"type": "access",
"allow": true,
"authenticationPolicy": "cardOrPin",
"devices": [
{
"id": "35347d04-a99c-4a58-ab32-1317b832507a",
"name": "Test Device",
"cloudNode": {
"id": "7d829ff4-53e8-4d76-8762-1022ccdeae39",
"name": "Test Cloud Node",
"serialNumber": "1234ABC"
}
}
],
"startTime": "09:00",
"stopTime": "17:00",
"recurring": ["Mon", "Tue", "Wed", "Thu", "Fri"]
}
PropertyTypeDescription
idStringThe rule ID.
nameStringThe rule name.
partitionStringThe partition ID.
typeStringThe rule type. Possible values include access, antiPassback, autoOpen, elevator, event, and systemEvent.
allowBooleanWhether access will be granted or denied.
authenticationPolicyStringThe authentication policy for this rule. Possible values include cardOnly, pinOnly, cardOrPin, and cardAndPin (for two-factor authentication). Note that card refers to all types of credentials (not just cards).
devicesObject[]An array of devices associated with this rule.
devices.idStringThe device ID.
devices.nameStringThe device name.
devices.cloudNode.idStringThe ID of the cloud node associated with the device.
devices.cloudNode.nameStringThe name of the cloud node associated with the device.
devices.cloudNode.serialNumberStringThe serial number of the cloud node associated with the device.
startTimeStringThe rule start time using 24-hour HH:MM format.
stopTimeStringThe rule stop time using 24-hour HH:MM format.
recurringString[]The days of the week this rule will be active. Possible values include Mon, Tue, Wed, Thu, Fri, Sat, and Sun.
singleDateStringThe specific date this rule will be active. This is formatted as YYYY-MM-DD.
floorGroupsObject[]An array of floor group objects representing the floor groups associated with this rule. Note that only the id and name properties are included.
triggerTypeStringThe event rule trigger type. This only applies if type is set to event or systemEvent. When type is set to event, possible values include whenAllowed, whenDeniedExplicit, whenDeniedNoRules, onDuress, alwaysOnValidCard, onDoubleSwipeAllow, onTripleSwipeAllow, and onQuadrupleSwipeAllow. When type is set to systemEvent, possible values include allPropCleared, onAnyDuress, onCardNotFound, onCardSwipe, onComLoss, onComLossCleared, onDoorClose, onDoorForced, onDoorOpen, onDoorPropped, onPropCleared, onRexClose, and onRexOpen.
actionStringThe event rule action. This only applies if type is set to event or systemEvent. Possible values include sendEmail, doNotDisturb, forceToggle, forceOpen, forceClose, open, close, lockdownOn, lockdownOff, delayOpen, delayClose, and openClose.
emailTemplateObjectThe email template. This only applies if action is set to sendEmail.
emailTemplate.toString[]An array of recipient email addresses.
emailTemplate.subjectStringThe email template subject.
emailTemplate.bodyStringThe email template body. This may include email template variables.
delayStringThe action delay in HH:MM:SS format. This only applies if action is set to delayOpen, delayClose, or openClose.
sourceDevicesObject[]An array of devices associated with an anti-passback or system event rule. For anti-passback rules, these represent the entry devices.
exitDevicesObject[]An array of devices associated with an anti-passback rule. This only applies if type is set to antiPassback.
expirationIntegerThe duration (in seconds) of an anti-passback rule. This only applies if type is set to antiPassback.
targetStringWhether the target devices of a system event rule are the same as the source devices or individually selected. This only applies if type is set to systemEvent. Possible values include source and selected.
targetDevicesObject[]An array of devices associated with a system event rule. This only applies if target is set to selected.

Anti-passback rules

In locations where it makes sense to have both entrance and exit readers, it may also make sense to enforce anti-passback rules. For example, once users enter a parking garage, they should not be able to enter again until after they've exited. This prevents users from passing credentials back to other users for unauthorized reuse (hence the name "anti-passback").

Email template variables

The emailTemplate.body property may include the following email template variables.

VariableDescription
<%time%>The time of the event.
Example: 2023-07-11 17:39:49
<%logname%>The holder's name (if applicable).
Example: John Wiegand
<%logevent%>A short description of the event trigger.
Example: Credentials Input
<%logdoor%>The name of the device associated with the event.
Example: Test Device
<%logresult%>A short description of the result.
Example: Access Allowed
<%loginfo%>A long description of the event.
Example: Person "John Wiegand" has requested access to the device "Test Device". Access allowed. Person used card for requesting access.
<%logcardno%>The credential number (if applicable).
Example: 1234567

Holder Rules

Create a holder rule

Request

POST https://systems.pdk.io/{{system_id}}/holders/{{holder_id}}/rules HTTP/1.1
Authorization: Bearer {{system_token}}
Content-Type: application/json

{
"type": "access",
"allow": true,
"devices": [
"35347d04-a99c-4a58-ab32-1317b832507a"
],
"authenticationPolicy": "cardOrPin",
"startTime": "09:00",
"stopTime": "17:00",
"recurring": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
]
}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
holder_idPathStringYesThe holder ID.
system_tokenHeaderStringYesA valid system token.
typeBodyStringYesThe rule type. Possible values include access, elevator, antiPassback and event.
allowBodyBooleanSometimesWhether access should be granted or denied. This is required if type is set to access or antiPassback`.
devicesBodyString[]SometimesThe IDs of the devices associated with this rule. This is required if type is set to access.
startTimeBodyStringYesThe rule start time using 24-hour HH:MM format.
stopTimeBodyStringYesThe rule stop time using 24-hour HH:MM format. This must be greater than startTime.
recurringBodyString[]SometimesThe days of the week this rule should be active. Possible values include Mon, Tue, Wed, Thu, Fri, Sat, and Sun. This is required if singleDate is omitted.
singleDateBodyStringSometimesThe specific date this rule should be active. This should be formatted as YYYY-MM-DD. Dates in the past are not allowed. This is required if recurring is omitted.
authenticationPolicyBodyStringNoThe authentication policy for this rule. Possible values include cardOnly, pinOnly, cardOrPin, and cardAndPin (for two-factor authentication). Note that card refers to all types of credentials (not just cards). The default value is cardOnly.
floorGroupsBodyString[]SometimesThe IDs of the floor groups associated with this rule. This is required if type is set to elevator.
nameBodyStringSometimesThe event rule name. This is required if type is set to event. The maximum length is 70 characters.
triggerTypeBodyStringSometimesThe event rule trigger type. This is required if type is set to event. Possible values include whenAllowed, whenDeniedExplicit, whenDeniedNoRules, onDuress, alwaysOnValidCard, onDoubleSwipeAllow, onTripleSwipeAllow, and onQuadrupleSwipeAllow.
actionBodyStringSometimesThe event rule action. This is required if type is set to event. Possible values include sendEmail, doNotDisturb, forceToggle, forceOpen, forceClose, open, close, lockdownOn, lockdownOff, delayOpen, delayClose, and openClose.
emailTemplateBodyObjectSometimesThe email template. This is required if action is set to sendEmail.
emailTemplate.toBodyString[]YesAn array of recipient email addresses. Example: ["john@example.com"]
emailTemplate.subjectBodyStringYesThe email template subject.
emailTemplate.bodyBodyStringYesThe email template body. Email template variables may be used for customization.
delayBodyStringNoThe action delay in HH:MM:SS format. This only applies if action is set to delayOpen, delayClose, or openClose. The minimum value is 00:00:01.
sourceDevicesBodyString[]SometimesThe IDs of the source devices associated with an anti-passback or system event rule. This is required if type is set to antiPassback or systemEvent. For anti-passback rules, these represent the entry devices.
exitDevicesBodyString[]SometimesThe IDs of the exit devices associated with an anti-passback rule. This is required if type is set to antiPassback.
expirationBodyIntegerSometimesThe duration (in seconds) of an anti-passback rule. This is required if type is set to antiPassback.
targetBodyStringSometimesWhether the target devices of a system event rule should be the same as the source devices or individually selected. This is required if type is set to systemEvent. Possible values include source and selected.
targetDevicesBodyString[]SometimesThe IDs of the target devices associated with a system event rule. This is required if target is set to selected.

Response

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

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

{
"id": "584e6c47-a7cd-44f1-aba0-0453858dfd41"
}

Retrieve a holder rule

Request

GET https://systems.pdk.io/{{system_id}}/holders/{{holder_id}}/rules/{{rule_id}} HTTP/1.1
Authorization: Bearer {{system_token}}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
holder_idPathStringYesThe holder ID.
rule_idPathStringYesThe rule ID.
system_tokenHeaderStringYesA valid system token.

Response

The response contains a rule object.

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

{
"id": "584e6c47-a7cd-44f1-aba0-0453858dfd41",
"type": "access",
"allow": true,
"authenticationPolicy": "cardOrPin",
"devices": [
{
"id": "35347d04-a99c-4a58-ab32-1317b832507a",
"name": "Test Device",
"cloudNode": {
"id": "7d829ff4-53e8-4d76-8762-1022ccdeae39",
"name": "Test Cloud Node",
"serialNumber": "1234ABC"
}
}
],
"startTime": "09:00",
"stopTime": "17:00",
"recurring": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
]
}

Update a holder rule

Request

PUT https://systems.pdk.io/{{system_id}}/holders/{{holder_id}}/rules/{{rule_id}} HTTP/1.1
Authorization: Bearer {{system_token}}
Content-Type: application/json

{
"type": "access",
"allow": true,
"devices": [
"35347d04-a99c-4a58-ab32-1317b832507a"
],
"authenticationPolicy": "cardOrPin",
"startTime": "09:00",
"stopTime": "17:00",
"recurring": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
]
}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
holder_idPathStringYesThe holder ID.
rule_idPathStringYesThe rule ID.
system_tokenHeaderStringYesA valid system token.
typeBodyStringYesThe rule type. This can't be changed and must match the value that was used when the rule was created. Possible values include access, antiPassback, elevator, and event.
allowBodyBooleanSometimesWhether access should be granted or denied. This is required if type is set to access or antiPassback.
devicesBodyString[]SometimesThe IDs of the devices associated with this rule. This is required if type is set to access.
startTimeBodyStringYesThe rule start time using 24-hour HH:MM format.
stopTimeBodyStringYesThe rule stop time using 24-hour HH:MM format. This must be greater than startTime.
recurringBodyString[]SometimesThe days of the week this rule should be active. Possible values include Mon, Tue, Wed, Thu, Fri, Sat, and Sun. This is required if singleDate is omitted.
singleDateBodyStringSometimesThe specific date this rule should be active. This should be formatted as YYYY-MM-DD. Dates in the past are not allowed. This is required if recurring is omitted.
authenticationPolicyBodyStringNoThe authentication policy for this rule. Possible values include cardOnly, pinOnly, cardOrPin, and cardAndPin (for two-factor authentication). Note that card refers to all types of credentials (not just cards). The default value is cardOnly.
floorGroupsBodyString[]SometimesThe IDs of the floor groups associated with this rule. This is required if type is set to elevator.
nameBodyStringSometimesThe event rule name. This is required if type is set to event. The maximum length is 70 characters.
triggerTypeBodyStringSometimesThe event rule trigger type. This is required if type is set to event. Possible values include whenAllowed, whenDeniedExplicit, whenDeniedNoRules, onDuress, alwaysOnValidCard, onDoubleSwipeAllow, onTripleSwipeAllow, and onQuadrupleSwipeAllow.
actionBodyStringSometimesThe event rule action. This is required if type is set to event. Possible values include sendEmail, doNotDisturb, forceToggle, forceOpen, forceClose, open, close, lockdownOn, lockdownOff, delayOpen, delayClose, and openClose.
emailTemplateBodyObjectSometimesThe email template. This is required if action is set to sendEmail.
emailTemplate.toBodyString[]YesAn array of recipient email addresses. Example: ["john@example.com"]
emailTemplate.subjectBodyStringYesThe email template subject.
emailTemplate.bodyBodyStringYesThe email template body. Email template variables may be used for customization.
delayBodyStringNoThe action delay in HH:MM:SS format. This only applies if action is set to delayOpen, delayClose, or openClose. The minimum value is 00:00:01.
sourceDevicesBodyString[]SometimesThe IDs of the source devices associated with an anti-passback or system event rule. This is required if type is set to antiPassback or systemEvent. For anti-passback rules, these represent the entry devices.
exitDevicesBodyString[]SometimesThe IDs of the exit devices associated with an anti-passback rule. This is required if type is set to antiPassback.
expirationBodyIntegerSometimesThe duration (in seconds) of an anti-passback rule. This is required if type is set to antiPassback.
targetBodyStringSometimesWhether the target devices of a system event rule should be the same as the source devices or individually selected. This is required if type is set to systemEvent. Possible values include source and selected.
targetDevicesBodyString[]SometimesThe IDs of the target devices associated with a system event rule. This is required if target is set to selected.

Response

HTTP/1.1 204 No Content

Delete a holder rule

Request

DELETE https://systems.pdk.io/{{system_id}}/holders/{{holder_id}}/rules/{{rule_id}} HTTP/1.1
Authorization: Bearer {{system_token}}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
holder_idPathStringYesThe holder ID.
rule_idPathStringYesThe rule ID.
system_tokenHeaderStringYesA valid system token.

Response

HTTP/1.1 204 No Content

List all holder rules

Request

GET https://systems.pdk.io/{{system_id}}/holders/{{holder_id}}/rules HTTP/1.1
Authorization: Bearer {{system_token}}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
holder_idPathStringYesThe holder 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.
system_tokenHeaderStringYesA valid system token.

Response

The response contains an array of rule objects.

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

[
{
"id": "584e6c47-a7cd-44f1-aba0-0453858dfd41",
"type": "access",
"allow": true,
"authenticationPolicy": "cardOrPin",
"devices": [
{
"id": "35347d04-a99c-4a58-ab32-1317b832507a",
"name": "Test Device",
"cloudNode": {
"id": "7d829ff4-53e8-4d76-8762-1022ccdeae39",
"name": "Test Cloud Node",
"serialNumber": "1234ABC"
}
}
],
"startTime": "09:00",
"stopTime": "17:00",
"recurring": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
]
}
]

List all anti-passback restrictions

This endpoint allows you to list all anti-passback restrictions for a holder.

Request

GET https://systems.pdk.io/{{system_id}}/holders/{{holder_id}}/restrictions HTTP/1.1
Authorization: Bearer {{system_token}}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
holder_idPathStringYesThe holder ID.
system_tokenHeaderStringYesA valid system token.

Response

The response contains an array of anti-passback restriction objects.

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

[
{
"ruleId": "1bb6347f-5928-4806-b277-6d0d8424af7a",
"allow": false,
"sourceDevices": [
{
"id": "2bc698fe-a964-4bb0-b505-2369acf49262",
"name": "Test Device 1"
}
],
"exitDevices": [
{
"id": "16f44de1-01cb-43f1-af50-1d2667686d58",
"name": "Test Device 2"
}
],
"expiresAt": "2023-07-18T17:15:51.658Z"
}
]
PropertiesTypeDescription
ruleIdStringThe rule ID.
allowBooleanWhether access will be granted or denied.
sourceDevicesObject[]An array of device objects representing the entry devices associated with the anti-passback rule.
exitDevicesObject[]An array of device objects representing the exit devices associated with the anti-passback rule.
expiresAtStringAn ISO 8601 timestamp representing the time at which the anti-passback restriction expires.

Clear an anti-passback restriction

This endpoint allows you to clear a specific anti-passback restriction for a holder.

Request

POST https://systems.pdk.io/{{system_id}}/holders/{{holder_id}}/restrictions/clear HTTP/1.1
Authorization: Bearer {{system_token}}
Content-Type: application/json

{
"ruleId": "1bb6347f-5928-4806-b277-6d0d8424af7a"
}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
holder_idPathStringYesThe holder ID.
system_tokenHeaderStringYesA valid system token.
ruleIdBodyStringYesThe rule ID.

Response

HTTP/1.1 204 No Content

Clear all anti-passback restrictions

This endpoint allows you to clear all anti-passback restrictions for a holder.

Request

POST https://systems.pdk.io/{{system_id}}/holders/{{holder_id}}/restrictions/clear-all HTTP/1.1
Authorization: Bearer {{system_token}}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
holder_idPathStringYesThe holder ID.
system_tokenHeaderStringYesA valid system token.

Response

HTTP/1.1 204 No Content

Group Rules

Create a group rule

Request

POST https://systems.pdk.io/{{system_id}}/groups/{{group_id}}/rules HTTP/1.1
Authorization: Bearer {{system_token}}
Content-Type: application/json

{
"type": "access",
"allow": true,
"devices": [
"35347d04-a99c-4a58-ab32-1317b832507a"
],
"authenticationPolicy": "cardOrPin",
"startTime": "09:00",
"stopTime": "17:00",
"recurring": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
]
}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
group_idPathStringYesThe group ID.
system_tokenHeaderStringYesA valid system token.
typeBodyStringYesThe rule type. Possible values include access, antiPassback, elevator, and event.
allowBodyBooleanSometimesWhether access should be granted or denied. This is required if type is set to access or antiPassback.
devicesBodyString[]SometimesThe IDs of the devices associated with this rule. This is required if type is set to access.
startTimeBodyStringYesThe rule start time using 24-hour HH:MM format.
stopTimeBodyStringYesThe rule stop time using 24-hour HH:MM format. This must be greater than startTime.
recurringBodyString[]NoThe days of the week this rule should be active. Possible values include Mon, Tue, Wed, Thu, Fri, Sat, and Sun. This is required if singleDate is omitted.
singleDateBodyStringNoThe specific date this rule should be active. This should be formatted as YYYY-MM-DD. Dates in the past are not allowed. This is required if recurring is omitted.
authenticationPolicyBodyStringNoThe authentication policy for this rule. Possible values include cardOnly, pinOnly, cardOrPin, and cardAndPin (for two-factor authentication). Note that card refers to all types of credentials (not just cards). The default value is cardOnly.
floorGroupsBodyString[]SometimesThe IDs of the floor groups associated with this rule. This is required if type is set to elevator.
nameBodyStringSometimesThe event rule name. This is required if type is set to event. The maximum length is 70 characters.
triggerTypeBodyStringSometimesThe event rule trigger type. This is required if type is set to event. Possible values include whenAllowed, whenDeniedExplicit, whenDeniedNoRules, onDuress, alwaysOnValidCard, onDoubleSwipeAllow, onTripleSwipeAllow, and onQuadrupleSwipeAllow.
actionBodyStringSometimesThe event rule action. This is required if type is set to event. Possible values include sendEmail, doNotDisturb, forceToggle, forceOpen, forceClose, open, close, lockdownOn, lockdownOff, delayOpen, delayClose, and openClose.
emailTemplateBodyObjectSometimesThe email template. This is required if action is set to sendEmail.
emailTemplate.toBodyString[]YesAn array of recipient email addresses. Example: ["john@example.com"]
emailTemplate.subjectBodyStringYesThe email template subject.
emailTemplate.bodyBodyStringYesThe email template body. Email template variables may be used for customization.
delayBodyStringNoThe action delay in HH:MM:SS format. This only applies if action is set to delayOpen, delayClose, or openClose. The minimum value is 00:00:01.
sourceDevicesBodyString[]SometimesThe IDs of the source devices associated with a system event rule. This is required if type is set to systemEvent.
targetBodyStringSometimesWhether the target devices of a system event rule should be the same as the source devices or individually selected. This is required if type is set to systemEvent. Possible values include source and selected.
targetDevicesBodyString[]SometimesThe IDs of the target devices associated with a system event rule. This is required if target is set to selected.

Response

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

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

{
"id": "584e6c47-a7cd-44f1-aba0-0453858dfd41"
}

Retrieve a group rule

Request

GET https://systems.pdk.io/{{system_id}}/groups/{{group_id}}/rules/{{rule_id}} HTTP/1.1
Authorization: Bearer {{system_token}}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
group_idPathStringYesThe group ID.
rule_idPathStringYesThe rule ID.
system_tokenHeaderStringYesA valid system token.

Response

The response contains a rule object.

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

{
"id": "584e6c47-a7cd-44f1-aba0-0453858dfd41",
"type": "access",
"allow": true,
"authenticationPolicy": "cardOrPin",
"devices": [
{
"id": "35347d04-a99c-4a58-ab32-1317b832507a",
"name": "Test Device",
"cloudNode": {
"id": "7d829ff4-53e8-4d76-8762-1022ccdeae39",
"name": "Test Cloud Node",
"serialNumber": "1234ABC"
}
}
],
"startTime": "09:00",
"stopTime": "17:00",
"recurring": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
]
}

Update a group rule

Request

PUT https://systems.pdk.io/{{system_id}}/groups/{{group_id}}/rules/{{rule_id}} HTTP/1.1
Authorization: Bearer {{system_token}}
Content-Type: application/json

{
"type": "access",
"allow": true,
"devices": [
"35347d04-a99c-4a58-ab32-1317b832507a"
],
"authenticationPolicy": "cardOrPin",
"startTime": "09:00",
"stopTime": "17:00",
"recurring": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
]
}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
group_idPathStringYesThe group ID.
rule_idPathStringYesThe rule ID.
system_tokenHeaderStringYesA valid system token.
typeBodyStringYesThe rule type. This can't be changed and must match the value that was used when the rule was created. Possible values include access, antiPassback, elevator, and event.
allowBodyBooleanSometimesWhether access should be granted or denied. This is required if type is set to access or antiPassback.
devicesBodyString[]SometimesThe IDs of the devices associated with this rule. This is required if type is set to access.
startTimeBodyStringYesThe rule start time using 24-hour HH:MM format.
stopTimeBodyStringYesThe rule stop time using 24-hour HH:MM format. This must be greater than startTime.
recurringBodyString[]SometimesThe days of the week this rule should be active. Possible values include Mon, Tue, Wed, Thu, Fri, Sat, and Sun. This is required if singleDate is omitted.
singleDateBodyStringSometimesThe specific date this rule should be active. This should be formatted as YYYY-MM-DD. Dates in the past are not allowed. This is required if recurring is omitted.
authenticationPolicyBodyStringNoThe authentication policy for this rule. Possible values include cardOnly, pinOnly, cardOrPin, and cardAndPin (for two-factor authentication). Note that card refers to all types of credentials (not just cards). The default value is cardOnly.
floorGroupsBodyString[]SometimesThe IDs of the floor groups associated with this rule. This is required if type is set to elevator.
nameBodyStringSometimesThe event rule name. This is required if type is set to event. The maximum length is 70 characters.
triggerTypeBodyStringSometimesThe event rule trigger type. This is required if type is set to event. Possible values include whenAllowed, whenDeniedExplicit, whenDeniedNoRules, onDuress, alwaysOnValidCard, onDoubleSwipeAllow, onTripleSwipeAllow, and onQuadrupleSwipeAllow.
actionBodyStringSometimesThe event rule action. This is required if type is set to event. Possible values include sendEmail, doNotDisturb, forceToggle, forceOpen, forceClose, open, close, lockdownOn, lockdownOff, delayOpen, delayClose, and openClose.
emailTemplateBodyObjectSometimesThe email template. This is required if action is set to sendEmail.
emailTemplate.toBodyString[]YesAn array of recipient email addresses. Example: ["john@example.com"]
emailTemplate.subjectBodyStringYesThe email template subject.
emailTemplate.bodyBodyStringYesThe email template body. Email template variables may be used for customization.
delayBodyStringNoThe action delay in HH:MM:SS format. This only applies if action is set to delayOpen, delayClose, or openClose. The minimum value is 00:00:01.
sourceDevicesBodyString[]SometimesThe IDs of the source devices associated with an anti-passback or system event rule. This is required if type is set to antiPassback or systemEvent. For anti-passback rules, these represent the entry devices.
exitDevicesBodyString[]SometimesThe IDs of the exit devices associated with an anti-passback rule. This is required if type is set to antiPassback.
expirationBodyIntegerSometimesThe duration (in seconds) of an anti-passback rule. This is required if type is set to antiPassback.
targetBodyStringSometimesWhether the target devices of a system event rule should be the same as the source devices or individually selected. This is required if type is set to systemEvent. Possible values include source and selected.
targetDevicesBodyString[]SometimesThe IDs of the target devices associated with a system event rule. This is required if target is set to selected.

Response

HTTP/1.1 204 No Content

Delete a group rule

Request

DELETE https://systems.pdk.io/{{system_id}}/groups/{{group_id}}/rules/{{rule_id}} HTTP/1.1
Authorization: Bearer {{system_token}}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
group_idPathStringYesThe group ID.
rule_idPathStringYesThe rule ID.
system_tokenHeaderStringYesA valid system token.

Response

HTTP/1.1 204 No Content

List all group rules

Request

GET https://systems.pdk.io/{{system_id}}/groups/{{group_id}}/rules HTTP/1.1
Authorization: Bearer {{system_token}}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
group_idPathStringYesThe group 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.
system_tokenHeaderStringYesA valid system token.

Response

The response contains an array of rule objects.

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

[
{
"id": "584e6c47-a7cd-44f1-aba0-0453858dfd41",
"type": "access",
"allow": true,
"authenticationPolicy": "cardOrPin",
"devices": [
{
"id": "35347d04-a99c-4a58-ab32-1317b832507a",
"name": "Test Device",
"cloudNode": {
"id": "7d829ff4-53e8-4d76-8762-1022ccdeae39",
"name": "Test Cloud Node",
"serialNumber": "1234ABC"
}
}
],
"startTime": "09:00",
"stopTime": "17:00",
"recurring": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
]
}
]

Auto Open Rules

Create an auto open rule

Request

POST https://systems.pdk.io/{{system_id}}/auto-open HTTP/1.1
Authorization: Bearer {{system_token}}
Content-Type: application/json

{
"allow": true,
"devices": [
"35347d04-a99c-4a58-ab32-1317b832507a"
],
"startTime": "09:00",
"stopTime": "17:00",
"recurring": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
]
}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
system_tokenHeaderStringYesA valid system token.
allowBodyBooleanYesWhether access should be granted or denied.
devicesBodyString[]YesThe IDs of the devices associated with this rule.
startTimeBodyStringYesThe rule start time using 24-hour HH:MM format.
stopTimeBodyStringYesThe rule stop time using 24-hour HH:MM format. This must be greater than startTime.
recurringBodyString[]SometimesThe days of the week this rule should be active. Possible values include Mon, Tue, Wed, Thu, Fri, Sat, and Sun. This is required if singleDate is omitted.
singleDateBodyStringSometimesThe specific date this rule should be active. This should be formatted as YYYY-MM-DD. Dates in the past are not allowed. This is required if recurring is omitted.
nameBodyStringNoThe auto open rule name.
partitionBodyStringNoThe partition ID.

Response

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

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

{
"id": "79171b1f-06e2-4a96-95cf-00d266f474d2"
}

Retrieve an auto open rule

Request

GET https://systems.pdk.io/{{system_id}}/auto-open/{{rule_id}} HTTP/1.1
Authorization: Bearer {{system_token}}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
rule_idPathStringYesThe rule ID.
system_tokenHeaderStringYesA valid system token.

Response

The response contains a rule object.

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

{
"id": "79171b1f-06e2-4a96-95cf-00d266f474d2",
"name": null,
"partition": "619cceb0-ac58-4b15-a8ec-32efcb0476ba",
"type": "autoOpen",
"allow": true,
"devices": [
{
"id": "35347d04-a99c-4a58-ab32-1317b832507a",
"name": "Test Device",
"cloudNode": {
"id": "7d829ff4-53e8-4d76-8762-1022ccdeae39",
"name": "Test Cloud Node",
"serialNumber": "1234ABC"
}
}
],
"startTime": "09:00",
"stopTime": "17:00",
"recurring": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
]
}

Update an auto open rule

Request

PUT https://systems.pdk.io/{{system_id}}/auto-open/{{rule_id}} HTTP/1.1
Authorization: Bearer {{system_token}}
Content-Type: application/json

{
"allow": true,
"devices": [
"35347d04-a99c-4a58-ab32-1317b832507a"
],
"startTime": "09:00",
"stopTime": "17:00",
"recurring": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
]
}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
rule_idPathStringYesThe rule ID.
system_tokenHeaderStringYesA valid system token.
allowBodyBooleanYesWhether access should be granted or denied.
devicesBodyString[]YesThe IDs of the devices associated with this rule.
startTimeBodyStringYesThe rule start time using 24-hour HH:MM format.
stopTimeBodyStringYesThe rule stop time using 24-hour HH:MM format. This must be greater than startTime.
recurringBodyString[]SometimesThe days of the week this rule should be active. Possible values include Mon, Tue, Wed, Thu, Fri, Sat, and Sun. This is required if singleDate is omitted.
singleDateBodyStringSometimesThe specific date this rule should be active. This should be formatted as YYYY-MM-DD. Dates in the past are not allowed. This is required if recurring is omitted.
nameBodyStringNoThe auto open rule name.
partitionBodyStringNoThe partition ID.

Response

HTTP/1.1 204 No Content

Delete an auto open rule

Request

DELETE https://systems.pdk.io/{{system_id}}/auto-open/{{rule_id}} HTTP/1.1
Authorization: Bearer {{system_token}}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
rule_idPathStringYesThe rule ID.
system_tokenHeaderStringYesA valid system token.

Response

HTTP/1.1 204 No Content

List all auto open rules

Request

GET https://systems.pdk.io/{{system_id}}/auto-open HTTP/1.1
Authorization: Bearer {{system_token}}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system 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.
system_tokenHeaderStringYesA valid system token.

Response

The response contains an array of rule objects.

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

[
{
"id": "79171b1f-06e2-4a96-95cf-00d266f474d2",
"name": null,
"partition": "619cceb0-ac58-4b15-a8ec-32efcb0476ba",
"type": "autoOpen",
"allow": true,
"devices": [
{
"id": "35347d04-a99c-4a58-ab32-1317b832507a",
"name": "Test Device",
"cloudNode": {
"id": "7d829ff4-53e8-4d76-8762-1022ccdeae39",
"name": "Test Cloud Node",
"serialNumber": "1234ABC"
}
}
],
"startTime": "09:00",
"stopTime": "17:00",
"recurring": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
]
}
]

System Event Rules

Create a system event rule

Request

POST https://systems.pdk.io/{{system_id}}/system-events HTTP/1.1
Authorization: Bearer {{system_token}}
Content-Type: application/json

{
"name": "Test System Event Rule",
"triggerType": "onDoorPropped",
"sourceDevices": [
"35347d04-a99c-4a58-ab32-1317b832507a"
],
"action": "sendEmail",
"emailTemplate": {
"to": [
"john@example.com"
],
"subject": "Test Subject",
"body": "Test Body"
},
"startTime": "09:00",
"stopTime": "17:00",
"recurring": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
]
}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
system_tokenHeaderStringYesA valid system token.
nameBodyStringYesThe system event rule name.
partitionBodyStringNoThe partition ID.
triggerTypeBodyStringYesThe rule trigger type. Possible values include allPropCleared, onAnyDuress, onCardNotFound, onCardSwipe, onComLoss, onComLossCleared, onDoorClose, onDoorForced, onDoorOpen, onDoorPropped, onPropCleared, onRexClose, and onRexOpen.
sourceDevicesBodyString[]SometimesThe IDs of the source devices associated with this rule.
targetBodyStringSometimesWhether the target devices of this rule should be the same as the source devices or individually selected. Possible values include source and selected.
targetDevicesBodyString[]SometimesThe IDs of the target devices associated with this rule. This is required if target is set to selected.
actionBodyStringSometimesThe system event rule action. Possible values include sendEmail, doNotDisturb, forceToggle, forceOpen, forceClose, open, close, lockdownOn, lockdownOff, delayOpen, delayClose, and openClose.
emailTemplateBodyObjectSometimesThe email template. This is required if action is set to sendEmail.
emailTemplate.toBodyString[]YesAn array of recipient email addresses. Example: ["john@example.com"]
emailTemplate.subjectBodyStringYesThe email template subject.
emailTemplate.bodyBodyStringYesThe email template body. Email template variables may be used for customization.
startTimeBodyStringYesThe rule start time using 24-hour HH:MM format.
stopTimeBodyStringYesThe rule stop time using 24-hour HH:MM format. This must be greater than startTime.
recurringBodyString[]SometimesThe days of the week this rule should be active. Possible values include Mon, Tue, Wed, Thu, Fri, Sat, and Sun. This is required if singleDate is omitted.
singleDateBodyStringSometimesThe specific date this rule should be active. This should be formatted as YYYY-MM-DD. Dates in the past are not allowed. This is required if recurring is omitted.
delayBodyStringNoThe action delay in HH:MM:SS format. This only applies if action is set to delayOpen, delayClose, or openClose. The minimum value is 00:00:01.

Response

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

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

{
"id": "8d46ccc0-8e08-465f-aebd-33eb4e03a821"
}

Retrieve a system event rule

Request

GET https://systems.pdk.io/{{system_id}}/system-events/{{rule_id}} HTTP/1.1
Authorization: Bearer {{system_token}}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
rule_idPathStringYesThe rule ID.
system_tokenHeaderStringYesA valid system token.

Response

The response contains a rule object.

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

{
"id": "8d46ccc0-8e08-465f-aebd-33eb4e03a821",
"name": "Test System Event Rule",
"partition": "619cceb0-ac58-4b15-a8ec-32efcb0476ba",
"type": "systemEvent",
"startTime": "09:00",
"stopTime": "17:00",
"recurring": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
],
"triggerType": "onDoorPropped",
"action": "sendEmail",
"emailTemplate": {
"to": [
"john@example.com"
],
"subject": "Test Subject",
"body": "Test Body"
},
"sourceDevices": [
{
"id": "86d8771e-507c-426d-9076-737cf0c3fb0c",
"name": "Test Device",
"firmwareVersion": "2.0.4",
"hardwareVersion": "red1cn.d",
"cloudNode": {
"id": "7d829ff4-53e8-4d76-8762-1022ccdeae39",
"serialNumber": "1234ABC",
"name": "Test Cloud Node"
}
}
]
}

Update a system event rule

Request

PUT https://systems.pdk.io/{{system_id}}/system-events/{{rule_id}} HTTP/1.1
Authorization: Bearer {{system_token}}
Content-Type: application/json

{
"name": "Test System Event Rule",
"triggerType": "onDoorPropped",
"sourceDevices": [
"35347d04-a99c-4a58-ab32-1317b832507a"
],
"action": "sendEmail",
"emailTemplate": {
"to": [
"john@example.com"
],
"subject": "Test Subject",
"body": "Test Body"
},
"startTime": "09:00",
"stopTime": "17:00",
"recurring": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
]
}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
rule_idPathStringYesThe rule ID.
system_tokenHeaderStringYesA valid system token.
nameBodyStringYesThe system event rule name.
partitionBodyStringNoThe partition ID.
triggerTypeBodyStringYesThe rule trigger type. Possible values include allPropCleared, onAnyDuress, onCardNotFound, onCardSwipe, onComLoss, onComLossCleared, onDoorClose, onDoorForced, onDoorOpen, onDoorPropped, onPropCleared, onRexClose, and onRexOpen.
sourceDevicesBodyString[]SometimesThe IDs of the source devices associated with this rule.
targetBodyStringSometimesWhether the target devices of this rule should be the same as the source devices or individually selected. Possible values include source and selected.
targetDevicesBodyString[]SometimesThe IDs of the target devices associated with this rule. This is required if target is set to selected.
actionBodyStringSometimesThe system event rule action. Possible values include sendEmail, doNotDisturb, forceToggle, forceOpen, forceClose, open, close, lockdownOn, lockdownOff, delayOpen, delayClose, and openClose.
emailTemplateBodyObjectSometimesThe email template. This is required if action is set to sendEmail.
emailTemplate.toBodyString[]YesAn array of recipient email addresses. Example: ["john@example.com"]
emailTemplate.subjectBodyStringYesThe email template subject.
emailTemplate.bodyBodyStringYesThe email template body. Email template variables may be used for customization.
startTimeBodyStringYesThe rule start time using 24-hour HH:MM format.
stopTimeBodyStringYesThe rule stop time using 24-hour HH:MM format. This must be greater than startTime.
recurringBodyString[]SometimesThe days of the week this rule should be active. Possible values include Mon, Tue, Wed, Thu, Fri, Sat, and Sun. This is required if singleDate is omitted.
singleDateBodyStringSometimesThe specific date this rule should be active. This should be formatted as YYYY-MM-DD. Dates in the past are not allowed. This is required if recurring is omitted.
delayBodyStringNoThe action delay in HH:MM:SS format. This only applies if action is set to delayOpen, delayClose, or openClose. The minimum value is 00:00:01.

Response

HTTP/1.1 204 No Content

Delete a system event rule

Request

DELETE https://systems.pdk.io/{{system_id}}/system-events/{{rule_id}} HTTP/1.1
Authorization: Bearer {{system_token}}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
rule_idPathStringYesThe rule ID.
system_tokenHeaderStringYesA valid system token.

Response

HTTP/1.1 204 No Content

List all system event rules

Request

GET https://systems.pdk.io/{{system_id}}/system-events HTTP/1.1
Authorization: Bearer {{system_token}}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system 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.
system_tokenHeaderStringYesA valid system token.

Response

The response contains an array of rule objects.

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

[
{
"id": "8d46ccc0-8e08-465f-aebd-33eb4e03a821",
"name": "Test System Event Rule",
"partition": "619cceb0-ac58-4b15-a8ec-32efcb0476ba",
"type": "systemEvent",
"startTime": "09:00",
"stopTime": "17:00",
"recurring": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
],
"triggerType": "onDoorPropped",
"action": "sendEmail",
"emailTemplate": {
"to": [
"john@example.com"
],
"subject": "Test Subject",
"body": "Test Body"
},
"sourceDevices": [
{
"id": "86d8771e-507c-426d-9076-737cf0c3fb0c",
"name": "Test Device",
"firmwareVersion": "2.0.4",
"hardwareVersion": "red1cn.d",
"cloudNode": {
"id": "7d829ff4-53e8-4d76-8762-1022ccdeae39",
"serialNumber": "1234ABC",
"name": "Test Cloud Node"
}
}
]
}
]