💬 SalesByte

Conversations

List conversations and fetch message history via the API.

List conversations

GET /api/v1/conversations

Query parameters

ParamDescription
statusFilter by status (open, done)
unreadSet to true to show only unread conversations
limitMax results (default 20)

Example

curl "https://app.salesbyte.in/api/v1/conversations?unread=true&limit=10" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "success": true,
  "conversations": [
    {
      "id": "abc-123",
      "contact": {
        "id": "def-456",
        "name": "Rahul Sharma",
        "phone": "+919876543210"
      },
      "last_message": "I am interested in the offer",
      "last_message_at": "2026-06-20T10:30:00Z",
      "unread_count": 2,
      "status": "open"
    }
  ]
}

Get messages in a conversation

GET /api/v1/conversations/:id/messages

Returns the message history for a conversation: the latest limit messages (default 50, max 200), in the order they were sent. Use offset to page back through older messages.

Query parameters

ParameterDescription
limitHow many messages, default 50, max 200.
offsetSkip this many of the newest messages, to page back.
sourceOnly campaign, drip or api messages.

Example

curl "https://app.salesbyte.in/api/v1/conversations/abc-123/messages" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "success": true,
  "total": 2,
  "messages": [
    {
      "id": "msg-789",
      "body": "I am interested in the offer",
      "message_type": "text",
      "from_contact": true,
      "delivery": "read",
      "media_url": null,
      "attachment_type": null,
      "sent_at": "2026-06-20T10:30:00Z",
      "created_at": "2026-06-20T10:30:00Z"
    },
    {
      "id": "msg-790",
      "body": "",
      "message_type": "document",
      "from_contact": true,
      "media_url": "https://app.salesbyte.in/api/media/…/inbound/file.pdf?exp=1791800000&sig=…",
      "attachment_type": "document",
      "sent_at": "2026-06-20T10:31:00Z",
      "created_at": "2026-06-20T10:31:00Z"
    }
  ]
}

Files customers send

Customer files (identity documents included) are stored privately. media_url for a file the customer sent is a private link that works for 7 days from the time of your request; call the API again for a fresh link, or download the file if you need to keep it. Older messages may still show a permanent link until they are moved to private storage.

On this page