What’s the best way to trigger a Slack notification whenever a queue hits its SLA threshold in Genesys Cloud? I’ve looked at the event subscription docs, but I’m not sure if I should use the /api/v2/analytics/events/queues endpoint or if there’s a more direct webhook trigger for SLA breaches. I want to avoid polling if possible, so I’m leaning toward a real-time event stream. Has anyone set this up recently? I’m trying to keep the integration lightweight and avoid unnecessary API calls. I’ve seen some references to EventBridge, but I’m not sure how to map the queue SLA event to a Slack webhook URL without building a whole Lambda function just for this.
Here’s what I’ve tried so far using the Python SDK:
from genesyscloud import configuration, api_client, event_subscriptions_api
config = configuration.Configuration()
api_instance = event_subscriptions_api.EventSubscriptionsApi(api_client.ApiClient(config))
subscription = {
"name": "SLA Breach Alert",
"event_type": "queue.sla.breach",
"destination": {
"url": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX",
"method": "POST"
}
}
try:
resp = api_instance.post_event_subscriptions(subscription)
print("Subscription created:", resp)
except Exception as e:
print("Error:", e)
The subscription gets created, but I’m not seeing any POST requests to the Slack URL when the queue SLA is breached. Am I missing a step in the event configuration or is the event type incorrect? I’ve checked the queue settings, and the SLA threshold is definitely being hit. I’m also wondering if I need to add any specific headers to the webhook destination for Slack to accept the payload.