Genesys Cloud Webhook: Formatting Slack Payload for Queue SLA Breach

Is it possible to configure a Genesys Cloud webhook to trigger on a specific queue SLA breach and format the payload for Slack?

I am using the Python SDK to manage webhooks via PUT /api/v2/webhooks/webhooks/{webhookId}. I want the event to be routing:queue:abandonedcall but filter by SLA.

The current JSON payload sends raw data. I need to map queue.name and sla.percent to Slack’s blocks structure. How do I achieve this transformation in the webhook config?

The official documentation states that the Genesys Cloud webhook engine does not support server-side JSON transformation. You cannot map fields directly in the POST /api/v2/webhooks/webhooks configuration. The raw payload from routing:queue:abandonedcall includes queue.name and sla.percent, but you must format these into Slack’s blocks structure in your receiving endpoint.

I handle this with an async FastAPI proxy using httpx. Here is the transformation logic:

@router.post("/webhook/sla-breach")
async def handle_sla_breach(payload: dict):
 queue_name = payload.get("queue", {}).get("name", "Unknown")
 sla_percent = payload.get("sla", {}).get("percent", 0)
 
 slack_payload = {
 "blocks": [
 {
 "type": "section",
 "text": {
 "type": "mrkdwn",
 "text": f"*SLA Breach Alert*\nQueue: {queue_name}\nSLA: {sla_percent}%"
 }
 }
 ]
 }
 
 async with httpx.AsyncClient() as client:
 await client.post(SLACK_WEBHOOK_URL, json=slack_payload)
 return {"status": "ok"}

This approach keeps the Genesys config simple and handles formatting errors safely in your code.