Skip to main content

Messages

Send iMessages, list message history, and retrieve individual messages.

Send a message

POST /v1/messages/send

Send an iMessage from your connected iPhone number.

Headers

HeaderRequiredDescription
x-api-keyYesYour API key
Content-TypeYesapplication/json

Request body

FieldTypeRequiredDescription
tostringYesRecipient phone number (E.164 format, e.g., +14155551234)
fromstringYesYour connected phone number (E.164 format)
contentstringYesMessage text (max 5,000 characters)
media_urlstringNoURL of media to attach (must be HTTPS, max 5MB). This functionality is working only with Standard plan and higher.

Example

curl -X POST https://api.texting.blue/v1/messages/send \
-H "Content-Type: application/json" \
-H "x-api-key: tb_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-d '{
"to": "+14155551234",
"from": "+14155559876",
"content": "Hello from Texting Blue!"
}'

Response

Status: 202 Accepted

{
"id": "msg_xxxxxxxxxxxx",
"status": "queued",
"to": "+14155551234",
"from": "+14155559876",
"content": "Hello from Texting Blue!",
"media_url": null,
"created_at": "2026-02-07T12:00:00Z"
}

Message status lifecycle

Messages go through these statuses:

  1. queued -- Message created, waiting for your iPhone to pick it up
  2. polling -- Your iPhone shortcut has received the message
  3. sent -- iMessage sent successfully from your iPhone
  4. delivered -- Delivery confirmed (when available)
  5. failed -- Message could not be sent

Errors

StatusCodeDescription
400invalid_requestInvalid phone number format or missing fields
401unauthorizedInvalid API key
402plan_limit_exceededMonthly message limit reached
403forbiddenAPI key lacks messages:send permission
429rate_limitedToo many requests

List messages

GET /v1/messages

Retrieve a paginated list of messages for your team.

Query parameters

ParameterTypeDefaultDescription
fromstring--Filter by sender phone number
tostring--Filter by recipient phone number
statusstring--Filter by status (queued, sent, delivered, failed, received)
directionstring--Filter by direction (inbound, outbound)
limitinteger50Number of messages to return (1-100)
cursorstring--Cursor for pagination (message ID from previous response)

Example

curl "https://api.texting.blue/v1/messages?from=%2B14155559876&limit=10" \
-H "x-api-key: tb_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Response

Status: 200 OK

{
"messages": [
{
"id": "msg_xxxxxxxxxxxx",
"to": "+14155551234",
"from": "+14155559876",
"content": "Hello!",
"media_url": null,
"status": "delivered",
"direction": "outbound",
"created_at": "2026-02-07T12:00:00Z",
"delivered_at": "2026-02-07T12:00:03Z"
}
],
"cursor": "msg_yyyyyyyyyyyy",
"has_more": true
}

Pagination

Results are returned in reverse chronological order. To fetch the next page, pass the cursor value from the response as the cursor query parameter:

curl "https://api.texting.blue/v1/messages?cursor=msg_yyyyyyyyyyyy&limit=10" \
-H "x-api-key: tb_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

When has_more is false, you've reached the end of the results.


Get a message

GET /v1/messages/:id

Retrieve a single message by its ID.

Example

curl "https://api.texting.blue/v1/messages/msg_xxxxxxxxxxxx" \
-H "x-api-key: tb_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Response

Status: 200 OK

{
"id": "msg_xxxxxxxxxxxx",
"to": "+14155551234",
"from": "+14155559876",
"content": "Hello!",
"media_url": null,
"status": "delivered",
"direction": "outbound",
"error_code": null,
"error_message": null,
"created_at": "2026-02-07T12:00:00Z",
"delivered_at": "2026-02-07T12:00:03Z"
}

Next steps