Hey everyone,
I’m trying to set up a webhook that triggers when a queue breaches its Service Level Agreement. The goal is to send a notification to our internal Slack channel so the WFM team can jump in and help stabilize the queue.
I’ve created the webhook using the /api/v2/webhooks/webhooks endpoint. Here is the JSON payload I sent:
{
"name": "SLA Breach Notification",
"enabled": true,
"eventFilters": [
{
"eventType": "routing:queue:sla:breach"
}
],
"targets": [
{
"type": "webhook",
"uri": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX",
"authentication": {
"type": "none"
}
}
]
}
The webhook shows as enabled and the event type looks correct based on the documentation. I triggered a test breach by setting the SLA threshold very low on a test queue.
The problem is the payload arriving at my Slack endpoint. It contains the queueId and timestamp, but it doesn’t include the actual percentage of conversations in queue or the current service level. I need those numbers to format the Slack message properly (e.g., “Queue X is at 85% wait time, SLA is 90%”).
The payload I receive looks like this:
{
"id": "abc-123",
"queueId": "xyz-789",
"timestamp": "2023-10-27T14:30:00.000Z",
"event": "routing:queue:sla:breach"
}
Is there a way to include more data in the webhook event? Or do I need to make a separate API call to /api/v2/analytics/queues/realtime inside my webhook consumer to get the current stats? If so, how do I handle the authentication for that second call securely from the webhook handler?
Thanks for any pointers.