Guest API POST /api/v2/conversations/web/messages failing with 400 on custom channel

We’ve spun up a custom DFO channel and bypassed the standard Messenger widget to handle inbound web traffic via our own frontend. We’re using the Guest API to push messages directly, but the POST to /api/v2/conversations/web/{conversationId}/messages keeps returning a 400 Bad Request. The payload looks identical to what the widget sends, and the conversation ID is valid and active.

Here’s the request body we’re sending:

{
 "messageText": "Test message from custom client",
 "type": "text"
}

The error response is vague, just saying “Invalid request body”. We’re using a valid OAuth token with the conversation:web:write scope. Is there a specific header or content-type nuance we’re missing when hitting this endpoint directly versus through the JS SDK?

The 400 error usually comes from missing the content wrapper or wrong content type in the payload. The Guest API is stricter than the widget.

  • Check the contentType. It must match the schema exactly. For text, use text/plain. If you’re sending rich text, ensure it’s text/html and the body is valid HTML.
  • Wrap your message in the correct structure. The root object needs content and contentType.
  • Verify the conversation ID is actually a web chat conversation. DFO channels sometimes use different IDs. Use GET /api/v2/conversations/{conversationId} to confirm the type is webchat.

Here’s the working payload structure:

{
 "content": "Hello from custom frontend",
 "contentType": "text/plain"
}

If that fails, enable debug logging on the DFO channel. It’ll show the exact validation error. Sometimes it’s just a trailing comma or missing quotes.