Skip to content

Commit c444388

Browse files
P-7155: Added SLA webhook doc (#48)
* Added SLA webhook doc * Link to page * Fix link * Link to webhook in docs * Typos
1 parent d04a5df commit c444388

File tree

4 files changed

+122
-0
lines changed

4 files changed

+122
-0
lines changed
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
```json
2+
{
3+
"timestamp": "2023-10-19T21:24:36.108Z",
4+
"workspaceId": "w_01GST0W989ZNAW53X6XYHAY87P",
5+
"payload": {
6+
"eventType": "thread.service_level_agreement_status_transitioned",
7+
"serviceLevelAgreement": {
8+
"id": "sla_01HD4X6WMCJSD8EHWDRHZ8WYDT",
9+
"type": "FIRST_RESPONSE_TIME",
10+
"tier": {
11+
"id": "tier_01HD4X6WMCJSD8EHWDRHZ8WYDT",
12+
"name": "Enterprise",
13+
"externalId": null,
14+
"color": "#FF0000",
15+
"defaultThreadPriority": 0,
16+
"isDefault": false
17+
},
18+
"firstResponseTimeMinutes": 60,
19+
"useBusinessHoursOnly": true,
20+
"threadPriorityFilter": [0, 1, 2, 3]
21+
},
22+
"serviceLevelAgreementStatusDetail": {
23+
"status": "BREACHED",
24+
"breachedAt": "2023-10-19T21:18:12.863Z"
25+
},
26+
"previousServiceLevelAgreementStatusDetail": {
27+
"status": "IMMINENT_BREACH",
28+
"breachTime": "2023-10-19T21:18:12.863Z"
29+
},
30+
"thread": {
31+
"id": "th_01HD44FHMCDSSWE38N14FSYV6K",
32+
"customer": {
33+
"id": "c_01HD44FHDPG82VQ4QNHDR4N2T0",
34+
"email": {
35+
"email": "[email protected]",
36+
"isVerified": false,
37+
"verifiedAt": null
38+
},
39+
"externalId": null,
40+
"fullName": "Peter Santos",
41+
"shortName": "Peter",
42+
"assignedAt": null,
43+
"assignedToUser": null,
44+
"status": "ACTIVE",
45+
"statusChangedAt": "2023-10-19T21:18:12.863Z",
46+
"markedAsSpamAt": null,
47+
"markedAsSpamBy": null,
48+
"customerGroupMemberships": [],
49+
"createdAt": "2023-10-19T14:12:25.142Z",
50+
"createdBy": {
51+
"actorType": "system",
52+
"system": "email_inbound_handler"
53+
},
54+
"updatedAt": "2023-10-19T21:18:12.863Z",
55+
"updatedBy": {
56+
"actorType": "user",
57+
"userId": "u_01H1V4NA10RMHWFBXB6A1ZBYRA"
58+
}
59+
},
60+
"title": "Unable to tail logs",
61+
"previewText": "Hey, I am currently unable to tail the logs of the service svc-8af1e3",
62+
"priority": 1,
63+
"externalId": null,
64+
"status": "DONE",
65+
"statusChangedAt": "2023-10-19T21:24:36.108Z",
66+
"statusChangedBy": {
67+
"actorType": "user",
68+
"userId": "u_01H1V4NA10RMHWFBXB6A1ZBYRA"
69+
},
70+
"statusDetail": null,
71+
"assignee": null,
72+
"assignedAt": null,
73+
"labels": [],
74+
"firstInboundMessageInfo": {
75+
"timestamp": "2023-10-19T14:12:25.733Z",
76+
"messageSource": "EMAIL"
77+
},
78+
"firstOutboundMessageInfo": null,
79+
"lastInboundMessageInfo": {
80+
"timestamp": "2023-10-19T14:12:25.733Z",
81+
"messageSource": "EMAIL"
82+
},
83+
"lastOutboundMessageInfo": null,
84+
"supportEmailAddresses": ["[email protected]"],
85+
"createdAt": "2023-10-19T14:12:25.266Z",
86+
"createdBy": {
87+
"actorType": "system",
88+
"system": "email_inbound_handler"
89+
},
90+
"updatedAt": "2023-10-19T21:24:36.108Z",
91+
"updatedBy": {
92+
"actorType": "user",
93+
"userId": "u_01H1V4NA10RMHWFBXB6A1ZBYRA"
94+
}
95+
}
96+
},
97+
"id": "pEv_01HD4X6WMCJSD8EHWDRHZ8WYDT",
98+
"webhookMetadata": {
99+
"webhookTargetId": "whTarget_01HD4400VTDJQ646V6RY37SR7K",
100+
"webhookDeliveryAttemptId": "whAttempt_01HD4XH9YE8CK6KT3G8VRX38R7",
101+
"webhookDeliveryAttemptNumber": 1,
102+
"webhookDeliveryAttemptTimestamp": "2023-10-19T21:30:17.422Z"
103+
},
104+
"type": "thread.thread_status_transitioned"
105+
}
106+
```
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: 'Thread SLA status transitioned'
3+
---
4+
5+
This event is fired when the status of an SLA linked to a thread changes.
6+
7+
## Schema
8+
9+
[**View JSON Schema →**](https://core-api.uk.plain.com/webhooks/schema.json)
10+
11+
Example:
12+
13+
<Snippet file="webhooks/thread-service-level-agreement-status-transitioned.mdx" />

mint.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@
230230
"api-reference/webhooks/thread-field-created",
231231
"api-reference/webhooks/thread-field-updated",
232232
"api-reference/webhooks/thread-field-deleted",
233+
"api-reference/webhooks/thread-service-level-agreement-status-transitioned",
233234
"api-reference/webhooks/customer-created",
234235
"api-reference/webhooks/customer-updated",
235236
"api-reference/webhooks/customer-deleted",

tiers.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ SLAs can also be driven by priority of threads. This allows you to have a differ
2222

2323
If you want to create a 'default' SLA then you can need to first create a tier and make that the default in your settings. Then you can configure SLAs like you would on any other tier.
2424

25+
When an SLA is about to breach or it is breaching, you will be notified via the mechanism you configure in your SLA settings. We also provide the [Thread SLA status transitioned](/api-reference/webhooks/thread-service-level-agreement-status-transitioned/) Plain event. This event will be fired when the status of an SLA linked to a thread changes (e.g. about to breach, breaching, achieved, etc.)
26+
2527
### Business hours
2628

2729
By default SLAs apply at all times. They can be configured to only count working hours by toggling on **Only during business hours**.

0 commit comments

Comments
 (0)