Skip to main content
POST/users/:user_id/conversations/

Create conversation

You can create a conversation with your user starting with a message. Message content can be just plain text or HTML.

Hi <b>user</b>, enjoy our product!

The message will be shown as follow:

Hi user, enjoy our product!

AttributesTypeRequiredDescription
user_idintegeryesA unique identifier for the user which is given by User.com automatically.
userintegernoA unique identifier for the agent (an author of the message) which is given by User.com automatically.
contentstringyesA content of a message sent to the user.
sourceintegernoA source of your message (1 - chat, 2 - email, 3 - API, 4 - SMS, 5 - Slack).
source_contextstringnoAn additional context for your source (only visible for you).

Request​

curl -X POST -H "Authorization: Token <your_64_char_api_key>"
-H "Accept: */*; version=2" -H "Content-Type: application/json" -d '{
"content": "Message sent using API",
"user": 926,
"source": 2,
"source_context": {
"name": "This is source_context used in API",
"id": 123
}
}' "https://<your_app_subdomain>.user.com/api/public/users/:user_id/conversations/"

Response​

{
"id":89,
"user": {
"id":322842,
"key":"2if9jlgsfsw3",
"name":"John Doe",
"email":"johndoe@response.example"},
"active":true,
"agent":null,
"messages":1
}