Send messages to chat
POST/chats/:chat_id/messages
Sends up to 50 messages as user (the sender is upserted and added to the chat). If the chat id in the URL doesn't exist, pass chat.create: true to create the chat on the fly — the id is taken from the URL (chat.id in the body is ignored); without the flag a missing chat is a 404. For an existing chat chat.create is ignored, chat.title/chat.metadata update the chat, and participants are neither validated nor added (use POST /chats/{chat_id}/participants).
Request
Responses
- 200
- 403
- 404
- 422
Messages sent
The sending user is muted in this chat (rights.send_messages is false) and cannot post — same policy the socket enforces. Pass force: true to post anyway.
Chat not found and chat.create was not requested. NOTE: this body carries the text under error, not message.
Validation failed, chat processing failed, or storing the messages failed.