API Reference

Messages API

Send messages and retrieve message history from conversations.

Endpoints

GET/v1/conversations/:id/messages

List messages in a conversation

POST/v1/conversations/:id/messages

Send a message in a conversation

Send Message

POST/v1/conversations/:id/messages
{
  "content": "Your order has been shipped!",
  "type": "text",
  "sender": "agent"
}

Message Types

Text Message

{
  "type": "text",
  "content": "Hello! How can I help?"
}

Image Message

{
  "type": "image",
  "content": "https://cdn.example.com/image.jpg",
  "caption": "Product photo"
}

Button Message

{
  "type": "buttons",
  "content": "How would you like to proceed?",
  "buttons": [
    { "id": "track", "text": "Track Order" },
    { "id": "return", "text": "Start Return" },
    { "id": "agent", "text": "Talk to Human" }
  ]
}

Message Object

  • id string - Unique identifier
  • conversation_id string - Parent conversation
  • type string - text, image, buttons, etc.
  • content string - Message content
  • sender string - customer or agent
  • timestamp string - ISO 8601 timestamp
  • metadata object - Additional data

Related