Widgets
Send Live Agent Message
Send a message from a live agent to the user, or end the conversation.
POST
Use this endpoint to send messages from your live agent platform back to the user in the widget. This is the counterpart to the webhooks Bland sends to your system during a live agent escalation.Documentation Index
Fetch the complete documentation index at: https://docs.bland.ai/llms.txt
Use this file to discover all available pages before exploring further.
Headers
Your API key for authentication.
Path Parameters
The widget ID.
The thread ID from the
INITIAL_CONVERSATION webhook payload.Body
The request body accepts two payload types:- MESSAGE
- END_CONVERSATION
Send a message to the user.
Must be
"MESSAGE".The message content to display to the user.
Identifier for the live agent sending the message. This can be used to distinguish between different agents in the conversation.
Optional ISO 8601 timestamp for the message. Defaults to the current time if not provided.
Response
HTTP status code (200 for success).
For
MESSAGE requests, returns the created message object. For END_CONVERSATION requests, returns the updated thread object with ended_at timestamp.Array of error objects if the request failed, otherwise null.
Error Codes
| Status | Error | Description |
|---|---|---|
| 400 | INVALID_PARAMETER | Request body validation failed. |
| 400 | THREAD_ENDED | The thread has already been ended. |
| 404 | NOT_FOUND | Thread not found with the given ID. |
Docs for agents: llms.txt