Send an automated message to a visitor

Send an automated (pushed) message to a visitor on behalf of an agent. Example use cases: order status updates, announcing new features in your web app, etc.

Authentication

api-keystring

The API key should be passed in the request headers as api-key for authentication.

Request

This endpoint expects an object.
textstringRequired
Message text.
visitorIdstringRequired
Visitor's ID received <a href="https://developers.brevo.com/docs/conversations-webhooks">from a webhook</a> or generated by you to <a href="https://developers.brevo.com/docs/customize-the-widget#identifying-existing-users">bind an existing user account to Conversations</a>.
agentIdstringOptional
Agent ID. It can be found on the agent's page or received <a href="https://developers.brevo.com/docs/conversations-webhooks">from a webhook</a>.
groupIdstringOptional
Group ID. It can be found on the group's page.

Response

Newly created message is returned as a response.
agentIdstringOptional

ID of the agent on whose behalf the message was sent (only in messages sent by an agent).

agentNamestringOptional

Agent’s name as displayed to the visitor. Only in the messages sent by an agent.

agentUserpicstringOptional
Only set if the agent has uploaded a profile picture.
attachmentslist of objectsOptional
An array of file attachments.
bcclist of objectsOptional

An array containing details of the blind carbon copy (BCC) recipients (applicable only to messages in email threads).

cclist of objectsOptional

An array containing details of the carbon copy (CC) recipients (applicable only to messages in email threads).

createdAtlongOptional>=0
Timestamp in milliseconds.
fileobjectOptional
forwardedToSourceStatusobjectOptional
Status of the message forwarding to the source.
fromobjectOptional

An object containing details about the email sender (applicable only to messages in email threads).

htmlstringOptional
The HTML content of the message.
idstringOptional
Message ID. It can be used for further manipulations with the message.
integrationsobjectOptional
Integration details.
isBotbooleanOptional

true for automated messages generated by an AI bot.

isMissedbooleanOptional

true for missed and offline messages.

isMissedByVisitorbooleanOptional

true for unread agent’s messages in finished chats.

isPushedbooleanOptional

true for pushed messages

isTriggerbooleanOptional

true for automatic messages from “Targeted chats & triggers” and API (https://developers.brevo.com/docs/javascript-api-reference#sendautomessage)

rawUnsafeHtmlstringOptional

Unescaped HTML content of the message (may include unsafe HTML).

receivedFromstringOptional

In two-way integrations, messages sent via REST API can be marked with receivedFrom property and then filtered out when received in a webhook to avoid infinite loop.

replyToobjectOptional

An object containing details of the reply-to email address (applicable only to messages in email threads).

sourceMessageIdstringOptional
The ID of the message assigned by the integration source.
subjectstringOptional

The subject line of the email message (only for messages sent to email threads).

textstringOptional
Message text or name of the attached file
tolist of objectsOptional

An array containing details of the recipients (applicable only to messages in email threads).

typeenumOptional

"agent" for agents’ messages, "visitor" for visitors’ messages.

isSentViaJsApibooleanOptional

true if the message was sent via JavaScript API.’

messageTypestringOptional

The type of message content (e.g. for integration-specific message types).

isForwardbooleanOptional

true if the message is a forwarded message.’

sourceobjectOptional
Source information for the message.
visitorIdstringOptional

visitor’s ID

Errors

400
Bad Request Error