Get received text messages
Inbound SMS
Get received text messages
Retrieve a list of text messages received by your service
GET
Get received text messages
This endpoint retrieves all text messages received by your service. Messages are returned in descending order by creation date (newest first).Documentation Index
Fetch the complete documentation index at: https://mintlify.com/alphagov/notifications-api/llms.txt
Use this file to discover all available pages before exploring further.
Authentication
This endpoint requires authentication using an API key with the following header:Query Parameters
Use this parameter to get the next page of results. Set to the
id of the last message from the previous response. This returns messages created before the specified message.If omitted, returns the most recent messages.Response
Array of received text message objects. Empty array if no messages are found.
Navigation links for pagination.
Example Request
Example Response
Pagination
This endpoint uses cursor-based pagination. The default page size is controlled by theAPI_PAGE_SIZE configuration setting.
To retrieve the next page of results:
- Get the
idof the last message in the current response - Make a new request with the
older_thanparameter set to thatid - Continue until the
nextlink is not present in the response
Example: Paginating Through Results
Response Codes
The request was successful. Returns a list of received text messages (may be empty).
Invalid request parameters. For example, if you provide an invalid
older_than UUID or include unexpected query parameters.Missing or invalid API key.
The API key does not have permission to access this service’s received messages.
Notes
- Messages are stored for 7 days by default, unless your service has a custom data retention policy
- To receive text messages, your service must have an inbound SMS number configured
- The content of received messages is encrypted at rest and decrypted when retrieved through the API
- Messages are returned in descending order by
created_at(newest first) - An empty array is returned if there are no messages or if you’ve paginated past all available messages