Endpoint

GET https://sms.phones.inc/v1/threads/{thread_id}/messages

Overview

Read the message history of a thread, inbound and outbound. Each page is returned in chronological order (oldest first); pages are fetched newest-first using the before cursor.
Only threads on your assigned sending numbers are readable; any other thread ID returns 404.

Path Parameters

thread_id
string
required
The thread to read.

Query Parameters

limit
number
default:"50"
Maximum messages per page, between 1 and 200.
before
number
Pagination cursor: only return messages with a rowid lower than this value. Use the next_before value from the previous page to fetch the next (older) page.

Response

ok
boolean
true on success.
thread_id
string
The thread that was read.
messages
Message[]
Messages in chronological order. See Message for the full field reference.
next_before
number | null
Cursor for the next (older) page, or null when there are no more messages.
curl "https://sms.phones.inc/v1/threads/0b6f5c1e-8f4a-4f4b-9a2d-3a1c2b3d4e5f/messages?limit=50" \
  -H "API-KEY: sk_your_api_key"
{
  "ok": true,
  "thread_id": "0b6f5c1e-8f4a-4f4b-9a2d-3a1c2b3d4e5f",
  "messages": [
    {
      "thread_id": "0b6f5c1e-8f4a-4f4b-9a2d-3a1c2b3d4e5f",
      "guid": "B2C3D4E5-F6A7-8901-BCDE-F23456789012",
      "rowid": 4520,
      "text": "Hello from the API!",
      "from_me": true,
      "service": "iMessage",
      "address": "+15551234567",
      "unix_ms": 1765432000000
    },
    {
      "thread_id": "0b6f5c1e-8f4a-4f4b-9a2d-3a1c2b3d4e5f",
      "guid": "A1B2C3D4-E5F6-7890-ABCD-EF1234567890",
      "rowid": 4521,
      "text": "Hey, got your message!",
      "from_me": false,
      "service": "iMessage",
      "address": "+15551234567",
      "unix_ms": 1765432100000
    }
  ],
  "next_before": null
}