Hey everyone,
I’m trying to send a proactive notification to a customer who was already in a web messaging session earlier today. We want to ping them if they haven’t replied in 5 minutes with a quick help prompt.
I have the conversationId and the participantId from our database. I’m hitting the /api/v2/conversations/messaging/participants/{participantId}/messages endpoint with a POST request.
Here’s the JSON payload I’m sending:
{
"type": "customer",
"text": "Is there anything else I can help you with?"
}
I’m getting a 400 Bad Request error. The response body says:
{
"code": "badRequest",
"message": "Invalid message type for participant role",
"status": 400
}
I thought customer was the right type since we’re mimicking the customer sending a message? Or do I need to use agent? I’m confused because the docs are a bit sparse on proactive messages for existing sessions.
Any ideas on what I’m missing here?
Cause:
The endpoint you are using is for the participant you identified, but you are likely hitting a state mismatch. If the session is still open on the agent side but the guest has disconnected or the session timed out on their browser, the backend might reject the push as invalid. Also, check the direction field. It must be explicitly set to INBOUND if you are simulating the guest, or OUTBOUND if the system is sending on behalf of the agent. Most 400s here come from missing the messageType or using the wrong participant ID (the agent’s instead of the guest’s).
Solution:
Verify the participant ID is definitely the guest’s. Then use this exact payload structure. I strip out any extra fields to avoid schema validation errors.
{
"messageType": "text",
"direction": "OUTBOUND",
"text": "Are you still there? I can help with that."
}
If that still fails, check the conversation status via GET /api/v2/conversations/messaging/{conversationId}. If the status is CLOSED, you cannot send a message. You have to create a new conversation.