Sending a structured message via POST /api/v2/conversations/messaging/messages. The docs say type should be “quick-reply” but the server keeps returning 400 Bad Request. Here is the payload I’m sending:
{
"type": "quick-reply",
"text": "Select an option",
"quickReplies": [
{ "text": "Yes", "value": "yes" },
{ "text": "No", "value": "no" }
]
}
What’s wrong with this JSON?
You’re missing the channelId in the root object. The API needs to know which channel provider is handling the quick replies because the schema varies wildly between SMS, WhatsApp, and Webchat. Without it, the validator throws a 400.
Also, double-check your quickReplies array. Some channels require the text field to be unique or enforce strict character limits. Here’s the corrected payload structure:
{
"channelId": "your-channel-id-here",
"type": "quick-reply",
"text": "Select an option",
"quickReplies": [
{ "text": "Yes", "value": "yes" },
{ "text": "No", "value": "no" }
]
}
If you’re still getting a 400, check the X-Request-Id header in the response. You can look up the exact validation error in the Genesys Cloud logs under Webhook Delivery or API Audit if you have the right roles. It usually spells out exactly which field failed schema validation.
Don’t forget to set Content-Type: application/json explicitly. Sometimes SDKs default to form-encoded which breaks the body parsing.