Chat message send via /conversations/v1/chats/{id} returns 400

Trying to send a canned response programmatically. The POST to /api/v2/conversations/messages/{conversationId}/communications/{communicationId}/messages with this payload fails with 400 Bad Request. No useful details in the error body. Tried changing the type to text too. Same result.

{
 "type": "agent",
 "text": "Testing"
}

What is missing?

The endpoint path is wrong. You’re mixing v2 and v1. You should use the endpoint to send a message to a conversation. Also, the payload needs a to object with the participant ID. Try this:

{
 "to": { "id": "participant_id" },
 "text": "Testing"
}

Check the docs for the exact structure.

1 Like