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"]
}
Property | Type | Description |
---|---|---|
id | Integer | The rule ID. |
name | String | The rule name. |
partition | Integer | The partition ID. |
type | String | The rule type. Possible values include antiPassback , auto_open , door , elevator , and event . |
allow | Boolean | Whether access will be granted or denied. |
authenticationPolicy | String | The 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). |
doors | Object[] | An array of device objects representing the devices associated with this rule. Note that only the id and name properties are included. |
startTime | String | The rule start time using 24-hour HH:MM format. |
stopTime | String | The rule stop time using 24-hour HH:MM format. |
recurring | String[] | The days of the week this rule will be active. Possible values include Mon , Tue , Wed , Thu , Fri , Sat , and Sun . |
singleDate | String | The specific date this rule will be active. This is formatted as YYYY-MM-DD . |
floorGroups | Object[] | An array of floor group objects representing the floor groups associated with this rule. Note that only the id and name properties are included. |
triggerType | String | The 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 . |
action | String | The 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 . |
emailTemplate | Object | The email template. This only applies if action is set to sendEmail . |
emailTemplate.to | String[] | An array of recipient email addresses. |
emailTemplate.subject | String | The email template subject. |
emailTemplate.body | String | The email template body. This may include email template variables. |
delay | String | The action delay in HH:MM:SS format. This only applies if action is set to delayOpen , delayClose , or openClose . |
sourceDoors | Object[] | 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. |
exitDoors | Object[] | An array of device objects representing the devices associated with an anti-passback rule. This only applies if type is set to antiPassback . |
expiration | Integer | The duration (in seconds) of an anti-passback rule. This only applies if type is set to antiPassback . |
target | String | Whether 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 . |
targetDoors | Integer[] | 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.
Variable | Description |
---|---|
<%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"
]
}
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
panel_id | Path | String | Yes | The cloud node serial number. |
person_id | Path | Integer | Yes | The person ID. |
panel_token | Header | String | Yes | A valid panel token. |
type | Body | String | Yes | The rule type. Possible values include antiPassback , auto_open , door , elevator , and event . |
allow | Body | Boolean | Sometimes | Whether access should be granted or denied. This is required if type is set to antiPassback or door . |
doors | Body | Integer[] | Sometimes | The IDs of the devices associated with this rule. This is required if type is set to door . |
startTime | Body | String | Yes | The rule start time using 24-hour HH:MM format. |
stopTime | Body | String | Yes | The rule stop time using 24-hour HH:MM format. This must be greater than startTime . |
recurring | Body | String[] | Sometimes | The 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. |
singleDate | Body | String | Sometimes | The 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. |
authenticationPolicy | Body | String | No | The 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 . |
floorGroups | Body | Integer[] | Sometimes | The IDs of the floor groups associated with this rule. This is required if type is set to elevator . |
name | Body | String | Sometimes | The event rule name. This is required if type is set to event . The maximum length is 70 characters. |
triggerType | Body | String | Sometimes | The 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 . |
action | Body | String | Sometimes | The 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 . |
emailTemplate | Body | Object | Sometimes | The email template. This is required if action is set to sendEmail . |
emailTemplate.to | Body | String[] | Yes | An array of recipient email addresses. Example: ["john@example.com"] |
emailTemplate.subject | Body | String | Yes | The email template subject. |
emailTemplate.body | Body | String | Yes | The email template body. Email template variables may be used for customization. |
delay | Body | String | No | The 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 . |
sourceDoors | Body | Integer[] | Sometimes | The 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. |
exitDoors | Body | Integer[] | Sometimes | The IDs of the exit devices associated with an anti-passback rule. This is required if type is set to antiPassback . |
expiration | Body | Integer | Sometimes | The duration (in seconds) of an anti-passback rule. This is required if type is set to antiPassback . |
target | Body | String | Sometimes | Whether 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 . |
targetDoors | Body | Integer[] | Sometimes | The IDs of the target devices associated with an event rule. This is required if target is set to selected . |
targetDoors | Body | Integer[] | Sometimes | The 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}}
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
panel_id | Path | String | Yes | The cloud node serial number. |
person_id | Path | Integer | Yes | The person ID. |
rule_id | Path | Integer | Yes | The rule ID. |
panel_token | Header | String | Yes | A 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"
]
}
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
panel_id | Path | String | Yes | The cloud node serial number. |
person_id | Path | Integer | Yes | The person ID. |
rule_id | Path | Integer | Yes | The rule ID. |
panel_token | Header | String | Yes | A valid panel token. |
type | Body | String | Yes | The 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 . |
allow | Body | Boolean | Sometimes | Whether access should be granted or denied. This is required if type is set to antiPassback or door . |
doors | Body | Integer[] | Sometimes | The IDs of the devices associated with this rule. This is required if type is set to door . |
startTime | Body | String | Yes | The rule start time using 24-hour HH:MM format. |
stopTime | Body | String | Yes | The rule stop time using 24-hour HH:MM format. This must be greater than startTime . |
recurring | Body | String[] | Sometimes | The 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. |
singleDate | Body | String | Sometimes | The 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. |
authenticationPolicy | Body | String | No | The 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 . |
floorGroups | Body | Integer[] | Sometimes | The IDs of the floor groups associated with this rule. This is required if type is set to elevator . |
name | Body | String | Sometimes | The event rule name. This is required if type is set to event . The maximum length is 70 characters. |
triggerType | Body | String | Sometimes | The 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 . |
action | Body | String | Sometimes | The 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 . |
emailTemplate | Body | Object | Sometimes | The email template. This is required if action is set to sendEmail . |
emailTemplate.to | Body | String[] | Yes | An array of recipient email addresses. Example: ["john@example.com"] |
emailTemplate.subject | Body | String | Yes | The email template subject. |
emailTemplate.body | Body | String | Yes | The email template body. Email template variables may be used for customization. |
delay | Body | String | No | The 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 . |
sourceDoors | Body | Integer[] | Sometimes | The 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. |
exitDoors | Body | Integer[] | Sometimes | The IDs of the exit devices associated with an anti-passback rule. This is required if type is set to antiPassback . |
expiration | Body | Integer | Sometimes | The duration (in seconds) of an anti-passback rule. This is required if type is set to antiPassback . |
target | Body | String | Sometimes | Whether 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 . |
targetDoors | Body | Integer[] | Sometimes | The 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}}
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
panel_id | Path | String | Yes | The cloud node serial number. |
person_id | Path | Integer | Yes | The person ID. |
rule_id | Path | Integer | Yes | The rule ID. |
panel_token | Header | String | Yes | A 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}}
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
panel_id | Path | String | Yes | The cloud node serial number. |
person_id | Path | Integer | Yes | The person ID. |
panel_token | Header | String | Yes | A 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}}
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
panel_id | Path | String | Yes | The cloud node serial number. |
person_id | Path | Integer | Yes | The person ID. |
panel_token | Header | String | Yes | A 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"
}
]
Properties | Type | Description |
---|---|---|
ruleId | Integer | The rule ID. |
allow | Boolean | Whether access will be granted or denied. |
sourceDoors | Object[] | An array of device objects representing the entry devices associated with the anti-passback rule. |
exitDoors | Object[] | An array of device objects representing the exit devices associated with the anti-passback rule. |
expiresAt | String | An 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
}
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
panel_id | Path | String | Yes | The cloud node serial number. |
person_id | Path | Integer | Yes | The person ID. |
panel_token | Header | String | Yes | A valid panel token. |
ruleId | Body | Integer | Yes | The 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}}
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
panel_id | Path | String | Yes | The cloud node serial number. |
person_id | Path | Integer | Yes | The person ID. |
panel_token | Header | String | Yes | A 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"
]
}
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
panel_id | Path | String | Yes | The cloud node serial number. |
group_id | Path | Integer | Yes | The group ID. |
panel_token | Header | String | Yes | A valid panel token. |
type | Body | String | Yes | The rule type. Possible values include antiPassback , auto_open , door , elevator , and event . |
allow | Body | Boolean | Sometimes | Whether access should be granted or denied. This is required if type is set to antiPassback or door . |
doors | Body | Integer[] | Sometimes | The IDs of the devices associated with this rule. This is required if type is set to door . |
startTime | Body | String | Yes | The rule start time using 24-hour HH:MM format. |
stopTime | Body | String | Yes | The rule stop time using 24-hour HH:MM format. This must be greater than startTime . |
recurring | Body | String[] | No | The 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. |
singleDate | Body | String | No | The 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. |
authenticationPolicy | Body | String | No | The 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 . |
floorGroups | Body | Integer[] | Sometimes | The IDs of the floor groups associated with this rule. This is required if type is set to elevator . |
name | Body | String | Sometimes | The event rule name. This is required if type is set to event . The maximum length is 70 characters. |
triggerType | Body | String | Sometimes | The 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 . |
action | Body | String | Sometimes | The 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 . |
emailTemplate | Body | Object | Sometimes | The email template. This is required if action is set to sendEmail . |
emailTemplate.to | Body | String[] | Yes | An array of recipient email addresses. Example: ["john@example.com"] |
emailTemplate.subject | Body | String | Yes | The email template subject. |
emailTemplate.body | Body | String | Yes | The email template body. Email template variables may be used for customization. |
delay | Body | String | No | The 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 . |
sourceDoors | Body | Integer[] | Sometimes | The IDs of the source devices associated with an event rule. This is required if type is set to event . |
target | Body | String | Sometimes | Whether 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 . |
targetDoors | Body | Integer[] | Sometimes | The 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}}
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
panel_id | Path | String | Yes | The cloud node serial number. |
group_id | Path | Integer | Yes | The group ID. |
rule_id | Path | Integer | Yes | The rule ID. |
panel_token | Header | String | Yes | A 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"
]
}
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
panel_id | Path | String | Yes | The cloud node serial number. |
group_id | Path | Integer | Yes | The group ID. |
rule_id | Path | Integer | Yes | The rule ID. |
panel_token | Header | String | Yes | A valid panel token. |
type | Body | String | Yes | The 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 . |
allow | Body | Boolean | Sometimes | Whether access should be granted or denied. This is required if type is set to antiPassback or door . |
doors | Body | Integer[] | Sometimes | The IDs of the devices associated with this rule. This is required if type is set to door . |
startTime | Body | String | Yes | The rule start time using 24-hour HH:MM format. |
stopTime | Body | String | Yes | The rule stop time using 24-hour HH:MM format. This must be greater than startTime . |
recurring | Body | String[] | Sometimes | The 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. |
singleDate | Body | String | Sometimes | The 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. |
authenticationPolicy | Body | String | No | The 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 . |
floorGroups | Body | Integer[] | Sometimes | The IDs of the floor groups associated with this rule. This is required if type is set to elevator . |
name | Body | String | Sometimes | The event rule name. This is required if type is set to event . The maximum length is 70 characters. |
triggerType | Body | String | Sometimes | The 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 . |
action | Body | String | Sometimes | The 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 . |
emailTemplate | Body | Object | Sometimes | The email template. This is required if action is set to sendEmail . |
emailTemplate.to | Body | String[] | Yes | An array of recipient email addresses. Example: ["john@example.com"] |
emailTemplate.subject | Body | String | Yes | The email template subject. |
emailTemplate.body | Body | String | Yes | The email template body. Email template variables may be used for customization. |
delay | Body | String | No | The 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 . |
sourceDoors | Body | Integer[] | Sometimes | The 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. |
exitDoors | Body | Integer[] | Sometimes | The IDs of the exit devices associated with an anti-passback rule. This is required if type is set to antiPassback . |
expiration | Body | Integer | Sometimes | The duration (in seconds) of an anti-passback rule. This is required if type is set to antiPassback . |
target | Body | String | Sometimes | Whether 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 . |
targetDoors | Body | Integer[] | Sometimes | The 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}}
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
panel_id | Path | String | Yes | The cloud node serial number. |
group_id | Path | Integer | Yes | The group ID. |
rule_id | Path | Integer | Yes | The rule ID. |
panel_token | Header | String | Yes | A 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}}
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
panel_id | Path | String | Yes | The cloud node serial number. |
group_id | Path | Integer | Yes | The group ID. |
panel_token | Header | String | Yes | A 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"
]
}
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
panel_id | Path | String | Yes | The cloud node serial number. |
panel_token | Header | String | Yes | A valid panel token. |
allow | Body | Boolean | Yes | Whether access should be granted or denied. |
doors | Body | Integer[] | Yes | The IDs of the devices associated with this rule. |
startTime | Body | String | Yes | The rule start time using 24-hour HH:MM format. |
stopTime | Body | String | Yes | The rule stop time using 24-hour HH:MM format. This must be greater than startTime . |
recurring | Body | String[] | Sometimes | The 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. |
singleDate | Body | String | Sometimes | The 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. |
name | Body | String | No | The auto open rule name. |
partition | Body | Integer | No | The 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}}
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
panel_id | Path | String | Yes | The cloud node serial number. |
rule_id | Path | Integer | Yes | The rule ID. |
panel_token | Header | String | Yes | A 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"
]
}
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
panel_id | Path | String | Yes | The cloud node serial number. |
rule_id | Path | Integer | Yes | The rule ID. |
panel_token | Header | String | Yes | A valid panel token. |
allow | Body | Boolean | Yes | Whether access should be granted or denied. |
doors | Body | Integer[] | Yes | The IDs of the devices associated with this rule. |
startTime | Body | String | Yes | The rule start time using 24-hour HH:MM format. |
stopTime | Body | String | Yes | The rule stop time using 24-hour HH:MM format. This must be greater than startTime . |
recurring | Body | String[] | Sometimes | The 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. |
singleDate | Body | String | Sometimes | The 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. |
name | Body | String | No | The auto open rule name. |
partition | Body | Integer | No | The 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}}
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
panel_id | Path | String | Yes | The cloud node serial number. |
rule_id | Path | Integer | Yes | The rule ID. |
panel_token | Header | String | Yes | A 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}}
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
panel_id | Path | String | Yes | The cloud node serial number. |
page | Query | Integer | No | The zero-based page number used for pagination. The default value is 0. |
per_page | Query | Integer | No | The number of items per page used for pagination. The default value is 10 and the maximum value is 100. |
panel_token | Header | String | Yes | A valid panel token. |
Response
The response contains an array of 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"
]
}
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
panel_id | Path | String | Yes | The cloud node serial number. |
panel_token | Header | String | Yes | A valid panel token. |
name | Body | String | Yes | The system event rule name. |
partition | Body | Integer | No | The partition ID. |
triggerType | Body | String | Yes | The rule trigger type. Possible values include allPropCleared , onAnyDuress , onCardNotFound , onCardSwipe , onComLoss , onComLossCleared , onDoorClose , onDoorForced , onDoorOpen , onDoorPropped , onPropCleared , onRexClose , and onRexOpen . |
sourceDoors | Body | Integer[] | Sometimes | The IDs of the source devices associated with this rule. |
target | Body | String | Sometimes | Whether the target devices of this rule should be the same as the source devices or individually selected. Possible values include source and selected . |
targetDoors | Body | Integer[] | Sometimes | The IDs of the target devices associated with this rule. This is required if target is set to selected . |
action | Body | String | Sometimes | The event rule action. Possible values include sendEmail , doNotDisturb , forceToggle , forceOpen , forceClose , open , close , lockdownOn , lockdownOff , delayOpen , delayClose , and openClose . |
emailTemplate | Body | Object | Sometimes | The email template. This is required if action is set to sendEmail . |
emailTemplate.to | Body | String[] | Yes | An array of recipient email addresses. Example: ["john@example.com"] |
emailTemplate.subject | Body | String | Yes | The email template subject. |
emailTemplate.body | Body | String | Yes | The email template body. Email template variables may be used for customization. |
startTime | Body | String | Yes | The rule start time using 24-hour HH:MM format. |
stopTime | Body | String | Yes | The rule stop time using 24-hour HH:MM format. This must be greater than startTime . |
recurring | Body | String[] | Sometimes | The 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. |
singleDate | Body | String | Sometimes | The 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. |
delay | Body | String | No | The 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}}
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
panel_id | Path | String | Yes | The cloud node serial number. |
rule_id | Path | Integer | Yes | The rule ID. |
panel_token | Header | String | Yes | A 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"
]
}
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
panel_id | Path | String | Yes | The cloud node serial number. |
rule_id | Path | Integer | Yes | The rule ID. |
panel_token | Header | String | Yes | A valid panel token. |
name | Body | String | Yes | The system event rule name. |
partition | Body | Integer | No | The partition ID. |
triggerType | Body | String | Yes | The rule trigger type. Possible values include allPropCleared , onAnyDuress , onCardNotFound , onCardSwipe , onComLoss , onComLossCleared , onDoorClose , onDoorForced , onDoorOpen , onDoorPropped , onPropCleared , onRexClose , and onRexOpen . |
sourceDoors | Body | Integer[] | Sometimes | The IDs of the source devices associated with this rule. |
target | Body | String | Sometimes | Whether the target devices of this rule should be the same as the source devices or individually selected. Possible values include source and selected . |
targetDoors | Body | Integer[] | Sometimes | The IDs of the target devices associated with this rule. This is required if target is set to selected . |
action | Body | String | Sometimes | The event rule action. Possible values include sendEmail , doNotDisturb , forceToggle , forceOpen , forceClose , open , close , lockdownOn , lockdownOff , delayOpen , delayClose , and openClose . |
emailTemplate | Body | Object | Sometimes | The email template. This is required if action is set to sendEmail . |
emailTemplate.to | Body | String[] | Yes | An array of recipient email addresses. Example: ["john@example.com"] |
emailTemplate.subject | Body | String | Yes | The email template subject. |
emailTemplate.body | Body | String | Yes | The email template body. Email template variables may be used for customization. |
startTime | Body | String | Yes | The rule start time using 24-hour HH:MM format. |
stopTime | Body | String | Yes | The rule stop time using 24-hour HH:MM format. This must be greater than startTime . |
recurring | Body | String[] | Sometimes | The 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. |
singleDate | Body | String | Sometimes | The 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. |
delay | Body | String | No | The 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}}
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
panel_id | Path | String | Yes | The cloud node serial number. |
rule_id | Path | Integer | Yes | The rule ID. |
panel_token | Header | String | Yes | A 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}}
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
panel_id | Path | String | Yes | The cloud node serial number. |
page | Query | Integer | No | The zero-based page number used for pagination. The default value is 0. |
per_page | Query | Integer | No | The number of items per page used for pagination. The default value is 10 and the maximum value is 100. |
panel_token | Header | String | Yes | A valid panel token. |
Response
The response contains an array of 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"
}
]
}
]