Messages

Create Message

Create a message in an existing conversation with POST /messages. Use a conversation ID from List Conversations or data.conversation.id in an incoming message webhook. For a visitor-authored message without a conversation ID, use Create Visitor Message instead.

For a basic text message, supply conversation_id and content. Replace the example conversation ID with the conversation you intend to reply to. Add agent_id to send the message as a team member; without it, the message is saved as written by the conversation's contact. Use optional fields only when your workflow needs them; you do not need an attachment for a text-only message.

Returns 201 Created with the created message.

post/messages

Request

  • Base URL: https://developers.chatway.app/api/v1
  • URL: https://developers.chatway.app/api/v1/messages
  • Auth: API key in header X-API-KEY

Request body

conversation_idstring required

Conversation ID

contentstring nullable
widget_idstring nullable

Widget identifier (optional)

typestring nullable

Optional. message (default) or note. A note is an internal note for your team: it is not shown in the visitor's chat widget and is not sent to connected social channels. agent_id works the same way for both types. With agent_id, the note is written by that team member, is delivered in real time to agents only, and does not trigger the message.sent webhook. Without agent_id, the note is saved as written by the conversation's contact and triggers the message.received webhook like a visitor message, so send agent_id with every note.

agent_idstring nullable

Optional. ID of the team member (from List Agents) to send the message as. If omitted, the message is saved as written by the conversation's contact, not by an agent.

Example request

{
  "conversation_id": "0f46c0a1-8938-40e3-b2b5-bb56f569fcab",
  "widget_id": "eouqtiupanm6uvglwshy",
  "type": "message",
  "agent_id": "26fa75f2-7ac1-47b4-84e1-b943491ba4da"
}

Response

Message created

Changes

No recorded changes to this operation across all 1 revision of this API.