GET /v1/messages — get recent messages
Returns up to 50 recent messages for a specific conversation, identified by phone number and inbox.Query parameters
The recipient’s phone number in E.164 format without the leading plus sign (e.g.,
14155551234).The ID of the inbox containing the conversation.
A Unix timestamp. When provided, only messages sent before this time are returned. Use this to retrieve older messages in the conversation.
Example
Response
Returns an array of up to 50 Message objects.POST /v1/messages/all — paginate all messages
Returns a paginated list of messages across your entire team. Use thedate field from the last returned message as the created_at cursor in the next request to fetch the following page.
Request body
An RFC 3339 timestamp used as the pagination cursor. Only messages created before this time are returned. On the first request, pass the current time or a historical start date.
The field to sort results by. Accepts
created_at or updated_at. Defaults to created_at.When
true, results are returned in ascending chronological order. Defaults to false (descending).The maximum number of messages to return per page. Defaults to
30.Example
To paginate through all messages, take the
date value of the last message in each response and pass it as created_at in your next request. Repeat until the response returns an empty array.POST /v1/messages/all/count — get message count
Returns the total number of messages for your team, optionally filtered by a date range.Request body
An RFC 3339 timestamp. When provided, only messages created before this date are counted.
Example
Response
Returns the total count as a string, for example:"1042".
The Message object
All message endpoints return Message objects with the following fields.The unique ID of the message.
The text content of the message.
The URL of any attached media (MMS).
The phone number associated with the message.
The direction of the message:
inbound or outbound.The delivery status of the message (e.g.,
delivered, failed, pending).The ISO 8601 timestamp of when the message was sent or received.
The team member who sent the message, if applicable.
The conversation this message belongs to.
The ID of the broadcast campaign this message was part of, if applicable.
Whether the message has been flagged for review.
The client-side unique ID provided at send time, if any.
The label displayed above the message bubble.