# 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!
POST
/conversations/
Attributes | Type | Required | Description |
---|---|---|---|
user | intiger | no | A unique identifier for the agent which is given by User.com automatically. |
content | string | yes | A content of a message sent to the user. |
source | string | yes | A source of your message (1 - chat, 2 - email, 3 - API, 4 - SMS, 5 - Slack). |
source_context | string | no | An additional context for your source (only visible for you). |
client_client_user_id | string | yes | A unique identifier for the user which is given by User.com automatically. |
# Request
- CURL
- JavaScript
- PHP
- Python
curl -X POST -H "Authorization: Token <your_64_char_api_key>" -H "Content-Type: application/json" -d '{
"content": "Message sent using API",
assigned_to: 926,
"source": 2,
"source_context": {
"name": "This is source_context used in API",
"id": 123
}
}' "https:///<your_app_subdomain>.user.com/api/public/users/:client_user_id/conversations/"
# Response
201 created