We need a webhook to ping Slack whenever a queue breaches its SLA target. The Genesys Cloud UI lets me create the webhook URL, but the payload structure for queue.sla.breach isn’t clear. I’m trying to parse the JSON in a simple Python script that forwards the message to Slack’s incoming webhook.
Here’s the POST request I’m sending to Genesys to test the event:
import requests
import json
url = 'https://api.mypurecloud.com/api/v2/webhooks'
payload = {
"name": "SLA Breach Alert",
"uri": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXX",
"eventIds": ["queue.sla.breach"]
}
headers = {"Content-Type": "application/json", "Authorization": "Bearer <token>"}
response = requests.post(url, json=payload, headers=headers)
print(response.status_code)
print(response.text)
The status code is 201, so the webhook is created. But when an SLA breach happens, Slack receives a generic JSON object that doesn’t match the docs. I expected queueId and slaTarget, but I’m getting entityId and some nested details object. How do I map the correct fields from the Genesys payload to the Slack message block kit format? The current output is just raw JSON text in Slack, which is useless for the team.