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 alwaysOnValidCard, onDoubleSwipeAllow, onDuress, onQuadrupleSwipeAllow, onTripleSwipeAllow, whenAllowed, whenDeniedExplicit, and whenDeniedNoRules. When type is set to systemEvent, possible values include allPropCleared, onAnyDuress, onBatteryConnect, onBatteryDisconnect, onCardNotFound, onCardSwipe, onCircuitBreakerOff, onCircuitBreakerOn, onComLoss, onComLossCleared, onDoorClose, onDoorForced, onDoorOpen, onDoorPropped, onInputPowerLoss, onInputPowerRecovery, onJammed, onJammedClear, onLowPowerModeOff, onLowPowerModeOn, onOverCurrentCleared, onOverCurrentDetected, onPartialConnectivityCleared, onPartialConnectivityDetected, onPropCleared, onRequest, onRexClose, onRexOpen, onUnderVoltageCleared, and onUnderVoltageDetected.
actionStringThe event rule action. This only applies if type is set to event or systemEvent. Possible values include close, delayClose, delayOpen, doNotDisturb, forceClose, forceOpen, forceToggle, lockdownOff, lockdownOn, open, openClose, piezoOff, piezoOn, pushNotification, and sendEmail.
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.
recipientsString[]An array of user IDs. These users will receive push notifications when the rule is triggered. This only applies if action is set to pushNotification.
onTimeIntegerThe duration (in tenths of a second) of each tone in the piezo tone sequence. This only applies if action is set to piezoOn.
offTimeIntegerThe duration (in tenths of a second) of silence between each tone in the piezo tone sequence. This only applies if action is set to piezoOn.
countIntegerThe number of times the piezo tone sequence is repeated. This only applies if action is set to piezoOn.
dwellStringThe dwell time in HH:MM:SS format. This only applies if action is set to openClose.
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.
authenticationPolicyBodyStringSometimesThe 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). This is required if (1) type is set to elevator or (2) allow is set to true and type is set to access or event. 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 alwaysOnValidCard, onDoubleSwipeAllow, onDuress, onQuadrupleSwipeAllow, onTripleSwipeAllow, whenAllowed, whenDeniedExplicit, and whenDeniedNoRules.
actionBodyStringSometimesThe event rule action. This is required if type is set to event. Possible values include close, delayClose, delayOpen, doNotDisturb, forceClose, forceOpen, forceToggle, lockdownOff, lockdownOn, open, openClose, piezoOff, piezoOn, pushNotification, and sendEmail.
emailTemplateBodyObjectSometimesThe email template. This is required if action is set to sendEmail.
emailTemplate.toBodyString[]YesAn array of 1–30 unique recipient email addresses. Example: ["john@example.com"]
emailTemplate.subjectBodyStringYesThe email template subject. The maximum length is 255 characters.
emailTemplate.bodyBodyStringYesThe email template body. The maximum length is 2048 characters. Email template variables may be used for customization.
recipientsBodyString[]SometimesAn array of 1–30 user IDs. These users will receive push notifications when the rule is triggered. This is required if action is set to pushNotification.
onTimeBodyIntegerNoThe duration (in tenths of a second) of each tone in the piezo tone sequence. This only applies if action is set to piezoOn. The minimum value is 1 and the maximum value is 255.
offTimeBodyIntegerNoThe duration (in tenths of a second) of silence between each tone in the piezo tone sequence. This only applies if action is set to piezoOn. The minimum value is 0 and the maximum value is 255.
countBodyIntegerNoThe number of times the piezo tone sequence is repeated. This only applies if action is set to piezoOn. The minimum value is 0 and the maximum value is 255.
dwellBodyStringNoThe dwell time in HH:MM:SS format. This only applies if action is set to openClose. The minimum value is 00:00:01.
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 event rule. This is required if type is set to antiPassback or event. 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.
expirationBodyInteger
or Null
SometimesThe duration (in seconds) of an anti-passback rule. This is required if type is set to antiPassback. The maximum value is 31536000 (1 year) or null (no expiration).
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.
targetDevicesBodyString[]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 201 Created
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 alwaysOnValidCard, onDoubleSwipeAllow, onDuress, onQuadrupleSwipeAllow, onTripleSwipeAllow, whenAllowed, whenDeniedExplicit, and whenDeniedNoRules.
actionBodyStringSometimesThe event rule action. This is required if type is set to event. Possible values include close, delayClose, delayOpen, doNotDisturb, forceClose, forceOpen, forceToggle, lockdownOff, lockdownOn, open, openClose, piezoOff, piezoOn, pushNotification, and sendEmail.
emailTemplateBodyObjectSometimesThe email template. This is required if action is set to sendEmail.
emailTemplate.toBodyString[]YesAn array of 1–30 unique recipient email addresses. Example: ["john@example.com"]
emailTemplate.subjectBodyStringYesThe email template subject. The maximum length is 255 characters.
emailTemplate.bodyBodyStringYesThe email template body. The maximum length is 2048 characters. Email template variables may be used for customization.
recipientsBodyString[]SometimesAn array of 1–30 user IDs. These users will receive push notifications when the rule is triggered. This is required if action is set to pushNotification.
onTimeBodyIntegerNoThe duration (in tenths of a second) of each tone in the piezo tone sequence. This only applies if action is set to piezoOn. The minimum value is 1 and the maximum value is 255.
offTimeBodyIntegerNoThe duration (in tenths of a second) of silence between each tone in the piezo tone sequence. This only applies if action is set to piezoOn. The minimum value is 0 and the maximum value is 255.
countBodyIntegerNoThe number of times the piezo tone sequence is repeated. This only applies if action is set to piezoOn. The minimum value is 0 and the maximum value is 255.
dwellBodyStringNoThe dwell time in HH:MM:SS format. This only applies if action is set to openClose. The minimum value is 00:00:01.
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 event rule. This is required if type is set to antiPassback or event. 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.
expirationBodyInteger
or Null
SometimesThe duration (in seconds) of an anti-passback rule. This is required if type is set to antiPassback. The maximum value is 31536000 (1 year) or null (no expiration).
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.
targetDevicesBodyString[]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 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.
sortQueryStringNoThe sort order for results. Possible values include asc and desc. The default value is asc.
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 1000.
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 alwaysOnValidCard, onDoubleSwipeAllow, onDuress, onQuadrupleSwipeAllow, onTripleSwipeAllow, whenAllowed, whenDeniedExplicit, and whenDeniedNoRules.
actionBodyStringSometimesThe event rule action. This is required if type is set to event. Possible values include close, delayClose, delayOpen, doNotDisturb, forceClose, forceOpen, forceToggle, lockdownOff, lockdownOn, open, openClose, piezoOff, piezoOn, pushNotification, and sendEmail.
emailTemplateBodyObjectSometimesThe email template. This is required if action is set to sendEmail.
emailTemplate.toBodyString[]YesAn array of 1–30 unique recipient email addresses. Example: ["john@example.com"]
emailTemplate.subjectBodyStringYesThe email template subject. The maximum length is 255 characters.
emailTemplate.bodyBodyStringYesThe email template body. The maximum length is 2048 characters. Email template variables may be used for customization.
recipientsBodyString[]SometimesAn array of 1–30 user IDs. These users will receive push notifications when the rule is triggered. This is required if action is set to pushNotification.
onTimeBodyIntegerNoThe duration (in tenths of a second) of each tone in the piezo tone sequence. This only applies if action is set to piezoOn. The minimum value is 1 and the maximum value is 255.
offTimeBodyIntegerNoThe duration (in tenths of a second) of silence between each tone in the piezo tone sequence. This only applies if action is set to piezoOn. The minimum value is 0 and the maximum value is 255.
countBodyIntegerNoThe number of times the piezo tone sequence is repeated. This only applies if action is set to piezoOn. The minimum value is 0 and the maximum value is 255.
dwellBodyStringNoThe dwell time in HH:MM:SS format. This only applies if action is set to openClose. The minimum value is 00:00:01.
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 event rule. This is required if type is set to antiPassback or event. 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.
expirationBodyInteger
or Null
SometimesThe duration (in seconds) of an anti-passback rule. This is required if type is set to antiPassback. The maximum value is 31536000 (1 year) or null (no expiration).
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.
targetDevicesBodyString[]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 201 Created
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 alwaysOnValidCard, onDoubleSwipeAllow, onDuress, onQuadrupleSwipeAllow, onTripleSwipeAllow, whenAllowed, whenDeniedExplicit, and whenDeniedNoRules.
actionBodyStringSometimesThe event rule action. This is required if type is set to event. Possible values include close, delayClose, delayOpen, doNotDisturb, forceClose, forceOpen, forceToggle, lockdownOff, lockdownOn, open, openClose, piezoOff, piezoOn, pushNotification, and sendEmail.
emailTemplateBodyObjectSometimesThe email template. This is required if action is set to sendEmail.
emailTemplate.toBodyString[]YesAn array of 1–30 unique recipient email addresses. Example: ["john@example.com"]
emailTemplate.subjectBodyStringYesThe email template subject. The maximum length is 255 characters.
emailTemplate.bodyBodyStringYesThe email template body. The maximum length is 2048 characters. Email template variables may be used for customization.
recipientsBodyString[]SometimesAn array of 1–30 user IDs. These users will receive push notifications when the rule is triggered. This is required if action is set to pushNotification.
onTimeBodyIntegerNoThe duration (in tenths of a second) of each tone in the piezo tone sequence. This only applies if action is set to piezoOn. The minimum value is 1 and the maximum value is 255.
offTimeBodyIntegerNoThe duration (in tenths of a second) of silence between each tone in the piezo tone sequence. This only applies if action is set to piezoOn. The minimum value is 0 and the maximum value is 255.
countBodyIntegerNoThe number of times the piezo tone sequence is repeated. This only applies if action is set to piezoOn. The minimum value is 0 and the maximum value is 255.
dwellBodyStringNoThe dwell time in HH:MM:SS format. This only applies if action is set to openClose. The minimum value is 00:00:01.
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 event rule. This is required if type is set to antiPassback or event. 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.
expirationBodyInteger
or Null
SometimesThe duration (in seconds) of an anti-passback rule. This is required if type is set to antiPassback. The maximum value is 31536000 (1 year) or null (no expiration).
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.
targetDevicesBodyString[]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://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.
sortQueryStringNoThe sort order for results. Possible values include asc and desc. The default value is asc.
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 1000.
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.
searchQueryStringNoA keyword used to filter the results by searching for partial matches against the name property.
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. The maximum length is 70 characters.
partitionBodyStringNoThe partition ID.
triggerTypeBodyStringYesThe rule trigger type. Possible values include allPropCleared, onAnyDuress, onBatteryConnect, onBatteryDisconnect, onCardNotFound, onCardSwipe, onCircuitBreakerOff, onCircuitBreakerOn, onComLoss, onComLossCleared, onDoorClose, onDoorForced, onDoorOpen, onDoorPropped, onInputPowerLoss, onInputPowerRecovery, onJammed, onJammedClear, onLowPowerModeOff, onLowPowerModeOn, onOverCurrentCleared, onOverCurrentDetected, onPartialConnectivityCleared, onPartialConnectivityDetected, onPropCleared, onRequest, onRexClose, onRexOpen, onUnderVoltageCleared, and onUnderVoltageDetected.
sourceDevicesBodyString[]SometimesThe IDs of the source devices associated with this rule. This property must be omitted when triggerType is set to onRequest (since the rule is triggered by an API request in that case). Otherwise, the array must contain at least 1 unique value.
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, in which case the array must contain at least 1 unique value.
actionBodyStringYesThe system event rule action. Possible values include close, delayClose, delayOpen, doNotDisturb, forceClose, forceOpen, forceToggle, lockdownOff, lockdownOn, open, openClose, piezoOff, piezoOn, pushNotification, and sendEmail. Values of sendEmail and pushNotification are not permitted when triggerType is set to onRequest.
emailTemplateBodyObjectSometimesThe email template. This is required if action is set to sendEmail.
emailTemplate.toBodyString[]YesAn array of 1–30 unique recipient email addresses. Example: ["john@example.com"]
emailTemplate.subjectBodyStringYesThe email template subject. The maximum length is 255 characters.
emailTemplate.bodyBodyStringYesThe email template body. The maximum length is 2048 characters. Email template variables may be used for customization.
recipientsBodyString[]SometimesAn array of 1–30 user IDs. These users will receive push notifications when the rule is triggered. This is required if action is set to pushNotification.
onTimeBodyIntegerNoThe duration (in tenths of a second) of each tone in the piezo tone sequence. This only applies if action is set to piezoOn. The minimum value is 1 and the maximum value is 255.
offTimeBodyIntegerNoThe duration (in tenths of a second) of silence between each tone in the piezo tone sequence. This only applies if action is set to piezoOn. The minimum value is 0 and the maximum value is 255.
countBodyIntegerNoThe number of times the piezo tone sequence is repeated. This only applies if action is set to piezoOn. The minimum value is 0 and the maximum value is 255.
dwellBodyStringNoThe dwell time in HH:MM:SS format. This only applies if action is set to openClose. The minimum value is 00:00:01.
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.
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.

Response

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

HTTP/1.1 201 Created
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. The maximum length is 70 characters.
partitionBodyStringNoThe partition ID.
triggerTypeBodyStringYesThe rule trigger type. Possible values include allPropCleared, onAnyDuress, onBatteryConnect, onBatteryDisconnect, onCardNotFound, onCardSwipe, onCircuitBreakerOff, onCircuitBreakerOn, onComLoss, onComLossCleared, onDoorClose, onDoorForced, onDoorOpen, onDoorPropped, onInputPowerLoss, onInputPowerRecovery, onJammed, onJammedClear, onLowPowerModeOff, onLowPowerModeOn, onOverCurrentCleared, onOverCurrentDetected, onPartialConnectivityCleared, onPartialConnectivityDetected, onPropCleared, onRequest, onRexClose, onRexOpen, onUnderVoltageCleared, and onUnderVoltageDetected.
sourceDevicesBodyString[]SometimesThe IDs of the source devices associated with this rule. This property must be omitted when triggerType is set to onRequest (since the rule is triggered by an API request in that case). Otherwise, the array must contain at least 1 unique value.
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, in which case the array must contain at least 1 unique value.
actionBodyStringYesThe system event rule action. Possible values include close, delayClose, delayOpen, doNotDisturb, forceClose, forceOpen, forceToggle, lockdownOff, lockdownOn, open, openClose, piezoOff, piezoOn, pushNotification, and sendEmail. Values of sendEmail and pushNotification are not permitted when triggerType is set to onRequest.
emailTemplateBodyObjectSometimesThe email template. This is required if action is set to sendEmail.
emailTemplate.toBodyString[]YesAn array of 1–30 unique recipient email addresses. Example: ["john@example.com"]
emailTemplate.subjectBodyStringYesThe email template subject. The maximum length is 255 characters.
emailTemplate.bodyBodyStringYesThe email template body. The maximum length is 2048 characters. Email template variables may be used for customization.
recipientsBodyString[]SometimesAn array of 1–30 user IDs. These users will receive push notifications when the rule is triggered. This is required if action is set to pushNotification.
onTimeBodyIntegerNoThe duration (in tenths of a second) of each tone in the piezo tone sequence. This only applies if action is set to piezoOn. The minimum value is 1 and the maximum value is 255.
offTimeBodyIntegerNoThe duration (in tenths of a second) of silence between each tone in the piezo tone sequence. This only applies if action is set to piezoOn. The minimum value is 0 and the maximum value is 255.
countBodyIntegerNoThe number of times the piezo tone sequence is repeated. This only applies if action is set to piezoOn. The minimum value is 0 and the maximum value is 255.
dwellBodyStringNoThe dwell time in HH:MM:SS format. This only applies if action is set to openClose. The minimum value is 00:00:01.
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.
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.

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.
searchQueryStringNoA keyword used to filter the results by searching for partial matches against the name property. The maximum length is 255 characters.
sortQueryStringNoThe sort order for results. Possible values include asc and desc. The default value is asc.
includeOnRequestRulesQueryBooleanNoWhether to include system event rules with a triggerType of onRequest in the results. Possible values include true and false. The default value is false.
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"
}
}
]
}
]

Trigger a system event rule​

System event rules with a triggerType of onRequest are not displayed in the user interface and can only be triggered by the following endpoint.

Request

POST https://systems.pdk.io/{{system_id}}/system-events/{{rule_id}}/trigger HTTP/1.1
Authorization: Bearer {{system_token}}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
rule_idPathStringYesThe system event rule ID. The rule must have triggerType of onRequest.
system_tokenHeaderStringYesA valid system token.

Response

HTTP/1.1 204 No Content