Skip to main content
Version: 1.0

Rules

Introduction

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

The rule object

{
"id": 1,
"type": "door",
"allow": true,
"authenticationPolicy": "cardOrPin",
"doors": [
{
"id": 1,
"name": "Test Device"
}
],
"startTime": "09:00",
"stopTime": "17:00",
"recurring": ["Mon", "Tue", "Wed", "Thu", "Fri"]
}
PropertyTypeDescription
idIntegerThe rule ID.
nameStringThe rule name.
partitionIntegerThe partition ID.
typeStringThe rule type. Possible values include antiPassback, auto_open, door, elevator, and event.
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).
doorsObject[]An array of device objects representing the devices associated with this rule. Note that only the id and name properties are included.
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. Possible values include whenAllowed, whenDeniedExplicit, whenDeniedNoRules, onDuress, alwaysOnValidCard, onDoubleSwipeAllow, onTripleSwipeAllow, and onQuadrupleSwipeAllow.
actionStringThe event rule action. This only applies if type is set to event. 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.
sourceDoorsObject[]An array of device objects representing the devices associated with an anti-passback or event rule. For anti-passback rules, these represent the entry devices.
exitDoorsObject[]An array of device objects representing the 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 an event rule are the same as the source devices or individually selected. This only applies if type is set to event. Possible values include source and selected.
targetDoorsInteger[]An array of device objects representing the devices associated with an 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 person'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

Person Rules

Create a person rule

Request

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

{
"type": "door",
"allow": true,
"doors": [1],
"authenticationPolicy": "cardOrPin",
"startTime": "09:00",
"stopTime": "17:00",
"recurring": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
]
}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
person_idPathIntegerYesThe person ID.
panel_tokenHeaderStringYesA valid panel token.
typeBodyStringYesThe rule type. Possible values include antiPassback, auto_open, door, elevator, and event.
allowBodyBooleanSometimesWhether access should be granted or denied. This is required if type is set to antiPassback or door.
doorsBodyInteger[]SometimesThe IDs of the devices associated with this rule. This is required if type is set to door.
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.
floorGroupsBodyInteger[]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.
sourceDoorsBodyInteger[]SometimesThe IDs of the source devices associated with an anti-passback or event rule. This is required if type is set to antiPassback or event. For anti-passback rules, these represent the entry devices.
exitDoorsBodyInteger[]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 an event rule should be the same as the source devices or individually selected. This is required if type is set to event. Possible values include source and selected.
targetDoorsBodyInteger[]SometimesThe IDs of the target devices associated with an event rule. This is required if target is set to selected.
targetDoorsBodyInteger[]SometimesThe IDs of the target devices associated with an 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": 1
}

Retrieve a person rule

Request

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

Response

The response contains a rule object.

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

{
"id": 1,
"type": "door",
"allow": true,
"authenticationPolicy": "cardOrPin",
"doors": [
{
"id": 1,
"name": "Test Device"
}
],
"startTime": "09:00",
"stopTime": "17:00",
"recurring": ["Mon", "Tue", "Wed", "Thu", "Fri"]
}

Update a person rule

Request

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

{
"type": "door",
"allow": true,
"doors": [1],
"authenticationPolicy": "cardOrPin",
"startTime": "09:00",
"stopTime": "17:00",
"recurring": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
]
}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
person_idPathIntegerYesThe person ID.
rule_idPathIntegerYesThe rule ID.
panel_tokenHeaderStringYesA valid panel 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 antiPassback, auto_open, door, elevator, and event.
allowBodyBooleanSometimesWhether access should be granted or denied. This is required if type is set to antiPassback or door.
doorsBodyInteger[]SometimesThe IDs of the devices associated with this rule. This is required if type is set to door.
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.
floorGroupsBodyInteger[]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.
sourceDoorsBodyInteger[]SometimesThe IDs of the source devices associated with an anti-passback or event rule. This is required if type is set to antiPassback or event. For anti-passback rules, these represent the entry devices.
exitDoorsBodyInteger[]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 an event rule should be the same as the source devices or individually selected. This is required if type is set to event. Possible values include source and selected.
targetDoorsBodyInteger[]SometimesThe IDs of the target devices associated with an event rule. This is required if target is set to selected.

Response

HTTP/1.1 204 No Content

Delete a person rule

Request

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

Response

HTTP/1.1 204 No Content

List all person rules

Request

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

Response

The response contains an array of rule objects.

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

[
{
"id": 1,
"type": "door",
"allow": true,
"authenticationPolicy": "cardOrPin",
"doors": [
{
"id": 1,
"name": "Test Device"
}
],
"startTime": "09:00",
"stopTime": "17:00",
"recurring": ["Mon", "Tue", "Wed", "Thu", "Fri"]
}
]

List all anti-passback restrictions

This endpoint allows you to retrieve all anti-passback restrictions for a person.

Request

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

Response

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

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

[
{
"ruleId": 1,
"allow": false,
"sourceDoors": [
{
"id": 1,
"name": "Test Device 1"
}
],
"exitDoors": [
{
"id": 2,
"name": "Test Device 2"
}
],
"expiresAt": "2023-07-18T17:15:51.658Z"
}
]
PropertiesTypeDescription
ruleIdIntegerThe rule ID.
allowBooleanWhether access will be granted or denied.
sourceDoorsObject[]An array of device objects representing the entry devices associated with the anti-passback rule.
exitDoorsObject[]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 person.

Request

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

{
"ruleId": 1
}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
person_idPathIntegerYesThe person ID.
panel_tokenHeaderStringYesA valid panel token.
ruleIdBodyIntegerYesThe 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 person.

Request

POST https://panel-{{panel_id}}.pdk.io/api/persons/{{person_id}}/restrictions/clear_all 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

Group Rules

Create a group rule

Request

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

{
"type": "door",
"allow": true,
"doors": [1],
"authenticationPolicy": "cardOrPin",
"startTime": "09:00",
"stopTime": "17:00",
"recurring": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
]
}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
group_idPathIntegerYesThe group ID.
panel_tokenHeaderStringYesA valid panel token.
typeBodyStringYesThe rule type. Possible values include antiPassback, auto_open, door, elevator, and event.
allowBodyBooleanSometimesWhether access should be granted or denied. This is required if type is set to antiPassback or door.
doorsBodyInteger[]SometimesThe IDs of the devices associated with this rule. This is required if type is set to door.
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.
floorGroupsBodyInteger[]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.
sourceDoorsBodyInteger[]SometimesThe IDs of the source devices associated with an event rule. This is required if type is set to event.
targetBodyStringSometimesWhether the target devices of an event rule should be the same as the source devices or individually selected. This is required if type is set to event. Possible values include source and selected.
targetDoorsBodyInteger[]SometimesThe IDs of the target devices associated with an 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": 1
}

Retrieve a group rule

Request

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

Response

The response contains a rule object.

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

{
"id": 1,
"type": "door",
"allow": true,
"authenticationPolicy": "cardOrPin",
"doors": [
{
"id": 1,
"name": "Test Device"
}
],
"startTime": "09:00",
"stopTime": "17:00",
"recurring": ["Mon", "Tue", "Wed", "Thu", "Fri"]
}

Update a group rule

Request

PUT https://panel-{{panel_id}}.pdk.io/api/groups/{{group_id}}/rules/{{rule_id}} HTTP/1.1
Authorization: Bearer {{panel_token}}
Content-Type: application/json

{
"type": "door",
"allow": true,
"doors": [1],
"authenticationPolicy": "cardOrPin",
"startTime": "09:00",
"stopTime": "17:00",
"recurring": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
]
}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
group_idPathIntegerYesThe group ID.
rule_idPathIntegerYesThe rule ID.
panel_tokenHeaderStringYesA valid panel 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 antiPassback, auto_open, door, elevator, and event.
allowBodyBooleanSometimesWhether access should be granted or denied. This is required if type is set to antiPassback or door.
doorsBodyInteger[]SometimesThe IDs of the devices associated with this rule. This is required if type is set to door.
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.
floorGroupsBodyInteger[]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.
sourceDoorsBodyInteger[]SometimesThe IDs of the source devices associated with an anti-passback or event rule. This is required if type is set to antiPassback or event. For anti-passback rules, these represent the entry devices.
exitDoorsBodyInteger[]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 an event rule should be the same as the source devices or individually selected. This is required if type is set to event. Possible values include source and selected.
targetDoorsBodyInteger[]SometimesThe IDs of the target devices associated with an 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://panel-{{panel_id}}.pdk.io/api/groups/{{group_id}}/rules/{{rule_id}} HTTP/1.1
Authorization: Bearer {{panel_token}}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
group_idPathIntegerYesThe group ID.
rule_idPathIntegerYesThe rule ID.
panel_tokenHeaderStringYesA valid panel token.

Response

HTTP/1.1 204 No Content

List all group rules

Request

GET https://panel-{{panel_id}}.pdk.io/api/groups/{{group_id}}/rules 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 rule objects.

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

[
{
"id": 1,
"type": "door",
"allow": true,
"authenticationPolicy": "cardOrPin",
"doors": [
{
"id": 1,
"name": "Test Device"
}
],
"startTime": "09:00",
"stopTime": "17:00",
"recurring": ["Mon", "Tue", "Wed", "Thu", "Fri"]
}
]

Auto Open Rules

Create an auto open rule

Request

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

{
"allow": true,
"doors": [1],
"startTime": "09:00",
"stopTime": "17:00",
"recurring": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
]
}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
panel_tokenHeaderStringYesA valid panel token.
allowBodyBooleanYesWhether access should be granted or denied.
doorsBodyInteger[]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.
partitionBodyIntegerNoThe partition ID.

Response

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

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

{
"id": 1
}

Retrieve an auto open rule

Request

GET https://panel-{{panel_id}}.pdk.io/api/auto_open/{{rule_id}} HTTP/1.1
Authorization: Bearer {{panel_token}}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
rule_idPathIntegerYesThe rule ID.
panel_tokenHeaderStringYesA valid panel token.

Response

The response contains a rule object.

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

{
"id": 1,
"name": null,
"partition": 0,
"type": "auto_open",
"allow": true,
"doors": [
{
"id": 57,
"name": "Test Device 1"
}
],
"startTime": "09:00",
"stopTime": "17:00",
"recurring": ["Mon", "Tue", "Wed", "Thu", "Fri"]
}

Update an auto open rule

Request

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

{
"allow": true,
"doors": [1],
"startTime": "09:00",
"stopTime": "17:00",
"recurring": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
]
}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
rule_idPathIntegerYesThe rule ID.
panel_tokenHeaderStringYesA valid panel token.
allowBodyBooleanYesWhether access should be granted or denied.
doorsBodyInteger[]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.
partitionBodyIntegerNoThe partition ID.

Response

HTTP/1.1 204 No Content

Delete an auto open rule

Request

DELETE https://panel-{{panel_id}}.pdk.io/api/auto_open/{{rule_id}} HTTP/1.1
Authorization: Bearer {{panel_token}}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
rule_idPathIntegerYesThe rule ID.
panel_tokenHeaderStringYesA valid panel token.

Response

HTTP/1.1 204 No Content

List all auto open rules

Request

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

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

[
{
"id": 1,
"name": null,
"partition": 0,
"type": "auto_open",
"allow": true,
"doors": [
{
"id": 57,
"name": "Test Device 1"
}
],
"startTime": "09:00",
"stopTime": "17:00",
"recurring": ["Mon", "Tue", "Wed", "Thu", "Fri"]
}
]

System Event Rules

Create a system event rule

Request

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

{
"name": "Test System Event Rule",
"triggerType": "onDoorPropped",
"sourceDoors": [1],
"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
panel_idPathStringYesThe cloud node serial number.
panel_tokenHeaderStringYesA valid panel token.
nameBodyStringYesThe system event rule name.
partitionBodyIntegerNoThe partition ID.
triggerTypeBodyStringYesThe rule trigger type. Possible values include allPropCleared, onAnyDuress, onCardNotFound, onCardSwipe, onComLoss, onComLossCleared, onDoorClose, onDoorForced, onDoorOpen, onDoorPropped, onPropCleared, onRexClose, and onRexOpen.
sourceDoorsBodyInteger[]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.
targetDoorsBodyInteger[]SometimesThe IDs of the target devices associated with this rule. This is required if target is set to selected.
actionBodyStringSometimesThe 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": 1
}

Retrieve a system event rule

Request

GET https://panel-{{panel_id}}.pdk.io/api/system_events/{{rule_id}} HTTP/1.1
Authorization: Bearer {{panel_token}}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
rule_idPathIntegerYesThe rule ID.
panel_tokenHeaderStringYesA valid panel token.

Response

The response contains a rule object.

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

{
"id": 1,
"name": "Test System Event Rule",
"partition": 0,
"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"
},
"sourceDoors": [
{
"id": 1,
"name": "Test Device 1"
}
]
}

Update a system event rule

Request

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

{
"name": "Test System Event Rule",
"triggerType": "onDoorPropped",
"sourceDoors": [1],
"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
panel_idPathStringYesThe cloud node serial number.
rule_idPathIntegerYesThe rule ID.
panel_tokenHeaderStringYesA valid panel token.
nameBodyStringYesThe system event rule name.
partitionBodyIntegerNoThe partition ID.
triggerTypeBodyStringYesThe rule trigger type. Possible values include allPropCleared, onAnyDuress, onCardNotFound, onCardSwipe, onComLoss, onComLossCleared, onDoorClose, onDoorForced, onDoorOpen, onDoorPropped, onPropCleared, onRexClose, and onRexOpen.
sourceDoorsBodyInteger[]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.
targetDoorsBodyInteger[]SometimesThe IDs of the target devices associated with this rule. This is required if target is set to selected.
actionBodyStringSometimesThe 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://panel-{{panel_id}}.pdk.io/api/system_events/{{rule_id}} HTTP/1.1
Authorization: Bearer {{panel_token}}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
rule_idPathIntegerYesThe rule ID.
panel_tokenHeaderStringYesA valid panel token.

Response

HTTP/1.1 204 No Content

List all system event rules

Request

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

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

[
{
"id": 1,
"name": "Test System Event Rule",
"partition": 0,
"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"
},
"sourceDoors": [
{
"id": 1,
"name": "Test Device 1"
}
]
}
]