Skip to main content
POST​/message​/send_message_as_user​/

Send message as user

Send messages on chat on behalf of your users. Depending on your needs, you can create new conversations for your users or add messages to the existing conversations. In case of mismatching user_id with conversation id, the message won't be sent and a proper response will appear.

AttributesTypeRequiredDescription
conversationintegernoA unique identifier for the conversation which is given by User.com (when conversation id is not provided - the request will create new converstaion for the user specified by user_id or user_custom_id).
* conversation is required if in the same payload "state" key is used.
user_idintegeryesA unique identifier for the user which is given by User.com automatically.
user_custom_idstringyesThe unique identifier for the user which is provided by the client.
contentstringyesContent of a message.
statestringnoConversation status. You can choose between: 'snoozed', 'close' and 'active'.
More information about converstaions might be found in the Knowledge Base.
snoozed_todatenoRequired if the 'snoozed' state is chosen.
sourceintegernoA source of your message (1 - chat, 2 - email, 3 - API, 4 - SMS, 5 - Slack).

Request​

curl --location --request POST 'https://<your_app_subdomain>.user.com/api/public/message/send_message_as_user/' \
--header 'accept: application/json' \
--header 'Accept: */*; version=2' \
--header 'authorization: Token <your_64_char_api_key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"conversation": 1,
"content": "Message sent using API",
"user_id": 926,
"state": "active"
}'

Response​

201 created