# 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.

POST ​/message​/send_message_as_user​/

Attributes Type Required Description
conversation integer yes A unique identifier for the conversation which is given by User.com
user integer yes A unique identifier for the user which is given by User.com automatically.
content string yes Content of a message
state string yes Conversation status. You can choose between: 'snoozed', 'close' and 'active'.

# Request

  • CURL
  • JavaScript
  • PHP
  • Python
curl --location --request POST 'https://<your_app_subdomain>.user.com/api/public/message/send_message_as_user/' \
--header 'accept: application/json' \
--header 'authorization: Token <your_64_char_api_key>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "conversation": 1,
    "content": "Message sent using API",
    "user": 926,
    "state": "active"
}'

# Response

201 created