Routing Rules API Reference

Possible Values for fields

Action Type

ValueDescription
NOTIFY_TEAMNotify a specific team
NOTIFY_WORKSPACE_MEMBERNotify a specific workspace member
NOTIFY_CURRENT_ON_CALL_USERNotify the current on-call user
NOTIFY_NEXT_ON_CALL_USERNotify the next on-call user
NOTIFY_ALL_ON_CALL_MEMBERSNotify all members currently on call

Assertion Type

ValueDescription
IMPACTAsserts the impact of an event
TITLEAsserts the title of an event
DESCRIPTIONAsserts the description of an event
AFFECTED_COMPONENTSAsserts the affected components of an event

Comparasion Types

ValueDescription
EQUALSChecks if the value is equal
NOT_EQUALSChecks if the value is not equal
IS_EMPTYChecks if the value is empty
NOT_EMPTYChecks if the value is not empty
GREATER_THANChecks if the value is greater than
GREATER_THAN_OR_EQUALSChecks if the value is greater than or equal
LESS_THANChecks if the value is less than
LESS_THAN_OR_EQUALSChecks if the value is less than or equal
CONTAINSChecks if the value contains a specified substring
NOT_CONTAINSChecks if the value does not contain a substring
HAS_KEYChecks if an object has a specific key
NOT_HAS_KEYChecks if an object does not have a specific key
HAS_VALUEChecks if an object has a specific value
NOT_HAS_VALUEChecks if an object does not have a specific value
IS_NULLChecks if the value is null
NOT_NULLChecks if the value is not null
STARTS_WITHChecks if the value starts with a specific substring
ENDS_WITHChecks if the value ends with a specific substring

Get Routing Rules

Endpoint:

GET /:page_id/routing-rules

Example request

GET /1/routing-rules

Example response

{
"routingRules": [
{
"id": "1",
"siteId": "pageId",
"assertions": [
{
"id": "1",
"routingRuleId": "1",
"type": "TITLE",
"comparison": "CONTAINS",
"value": "value1"
},
{
"id": "2",
"routingRuleId": "1",
"type": "TITLE",
"comparison": "CONTAINS",
"value": "value2"
}
],
"actions": [
{
"id": "1",
"routingRuleId": "1",
"type": "NOTIFY_WORKSPACE_MEMBER",
"targetId": "value1"
},
{
"id": "2",
"routingRuleId": "1",
"type": "NOTIFY_WORKSPACE_MEMBER",
"targetId": "member@platform.com"
}
],
"createdAt": "2021-09-29T00:00:00.000Z",
"updatedAt": "2021-09-29T00:00:00.000Z",
"order": 1
}
]
}

Create Routing Rule

Endpoint:

POST /routing-rules

Keep in mind in actions targetId can be a workspace member email or a team id depending on the type of the action.

Example request

{
"routingRule": {
"assertions": [
{
"id": "1",
"routingRuleId": "1",
"type": "TITLE",
"comparison": "CONTAINS",
"value": "value1"
},
{
"id": "2",
"routingRuleId": "1",
"type": "TITLE",
"comparison": "CONTAINS",
"value": "value2"',
}
],
"actions": [
{
"id": "1",
"routingRuleId": "1",
"type": "NOTIFY_WORKSPACE_MEMBER",
"targetId": "member2@platform.com"
},
{
"id": "2",
"routingRuleId": "1",
"type": "NOTIFY_WORKSPACE_MEMBER",
"targetId": "member@platform.com"
}
],
"order": 1,
"siteId": "site-id-1"
},
"message": "Routing rule updated successfully"
}

Example response

{
"routingRule": {
"id": "routing-rule-id-1",
"order": 1,
"siteId": "site123",
"updatedAt": "2021-09-01T12:00:00Z",
"createdAt": "2021-09-01T12:00:00Z"
},
"message": "Routing rule created successfully."
}

Update Routing Rule

Endpoint:

PUT /routing-rules/:id

Example request

PUT /routing-rules/routing-rule-id-1
{
"routingRule": {
"id": "routing-rule-id-1",
"assertions": [
{
"id": "assertion-id-1",
"routingRuleId": "routing-rule-id-1",
"comparison": "CONTAINS",
"value": "Issue With X",
"type": "TITLE"
}
],
"order": 1,
"siteId": "site-id-1",
"updatedAt": "2021-09-01T12:00:00Z",
"createdAt": "2021-05-01T12:00:00Z"
},
"message": "Routing rule updated successfully"
}

Example response

{
"routingRule": {
"id": "routing-rule-id-1",
"assertions": [
{
"id": "assertion-id-1",
"routingRuleId": "routing-rule-id-1",
"comparison": "CONTAINS",
"value": "Issue With X",
"type": "TITLE"
}
],
"order": 1,
"siteId": "site-id-1",
"updatedAt": "2024-08-09T12:00:00Z",
"createdAt": "2021-05-01T12:00:00Z"
},
"message": "Routing rule updated successfully"
}

Delete Routing Rule

Endpoint:

DELETE /routing-rules/:id

Example request

DELETE /routing-rules/routing-rule-id-1

Example response

{
"message": "Routing rule deleted successfully."
}