Webhook payload mapping for Slack blocks in queue SLA breach notification

Struggling to figure out why the Slack API rejects the payload generated by my custom Data Action when triggered by a queue SLA breach webhook. The Genesys Cloud webhook fires correctly, but the subsequent HTTP POST to Slack returns a 400 Bad Request with invalid_blocks.

I am using a Data Action to transform the Genesys webhook payload into the Slack Block Kit format. The issue seems to be in the JSON path mapping for the text field within the mrkdwn object. Here is the relevant portion of my Data Action configuration:

{
 "type": "http",
 "method": "POST",
 "url": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX",
 "body": {
 "blocks": [
 {
 "type": "section",
 "text": {
 "type": "mrkdwn",
 "text": "Queue: {{data.queueName}} | Breach: {{data.breachDuration}}s"
 }
 }
 ]
 }
}

The error from Slack is:

invalid_blocks: blocks in payload are invalid

I have verified the JSON structure against the Slack docs. Is there a specific encoding issue with the {{data.*}} expressions in Genesys Data Actions when sending to external webhooks? Or is the webhook payload from Genesys not providing the expected queueName field in the SLA breach event?

  • Check your JSON structure. Slack needs blocks array, not just text.
  • Try this snippet in your Node webhook handler to validate the payload before sending:
const isValid = payload.blocks && Array.isArray(payload.blocks);
console.log(isValid ? "OK" : "Bad structure");

Genesys Data Actions often miss the nesting.

2 Likes

skip the data action entirely. just map the slack blocks directly in the outbound webhook config, it’s way cleaner and avoids those silent json mapping failures.

  • skip the data action for this. the outbound webhook config handles json mapping way better.
  • add a blocks array directly in the webhook body template.
  • map the queue name to a mrkdwn text object.
  • avoids the 400 error and keeps the payload clean.

Gotcha. The 400 usually hits because the text object inside a mrkdwn block is missing the required type: "mrkdwn" field. Slack’s parser is strict on that. Check your JSON payload. If the type is missing, the block is invalid. Fix that and it’ll post.

3 Likes