Get Thread Messages
Thread Assignment
Get Thread Messages
Fetch paginated messages for a single conversation thread
GET
Get Thread Messages
Description
Returns messages for a single thread scoped to a campaign. This endpoint is the fast, per-thread counterpart to Get Campaign Messages — it queries one thread directly instead of fanning out across every contact in the campaign. Use it for two patterns:- Polling for new messages — pass
sincewith the timestamp of the latest message you already have. - Loading older messages (back-pagination) — pass
beforewith the timestamp of the oldest message currently displayed.
Authentication
Your Teli API key
Path Parameters
The campaign ID
Thread identifier (format:
{phone_number}_{campaign_id})Query Parameters
ISO-8601 timestamp. Returns only messages with a
timestamp strictly
greater than this value. Use this for polling.ISO-8601 timestamp. Returns only messages with a
timestamp strictly
less than this value. Use this to load older messages when paginating
backward through a long conversation.Maximum number of messages to return in this response.
since and before are mutually exclusive. If both are provided, since
takes precedence and before is ignored.Response Fields
true when the request succeededArray of message objects, ordered newest-first
Echoes the requested thread id
Echoes the requested campaign id
Number of messages in this response
true when count equals limit — there may be additional older messages.
Paginate by calling again with before set to the timestamp of the
oldest message returned. false when fewer than limit rows were
returned (end of thread).Always returns “Teli”
Example Requests
Initial load (newest messages)
cURL
Poll for new messages since last seen
cURL
Load older messages (back-pagination)
cURL
JavaScript
Python
Example Responses
Success
200
No new messages (polling with since)
200
Server error
500
Behavior
- Single-thread scope — only messages whose
thread_idexactly matches the path parameter are returned. Much faster than the campaign-wide messages endpoint for UI rendering of a single conversation. - Reverse-chronological — messages are returned newest first. When
back-paginating with
before, each page is also newest-first within that page. has_moresemantics —has_moreistruewhenevercount == limit. It is a hint, not a guarantee: the next page may return zero rows if the thread ended exactly at the page boundary.- Sender field — distinguishes between automated sends (
agent,drip,broadcast), human operator sends (human), and inbound messages from the contact (contact). Use this to style outbound vs inbound bubbles in a UI. sent_by_user_id— only present onhumansends. Use it to attribute outbound messages to the specific operator who sent them.
Related Endpoints
- Get Campaign Messages — all messages across every thread in a campaign
- Get Campaign Contacts — list threads in a campaign
- Assign Thread — assign a thread to a user
- Send SMS — send an outbound message into a thread

