The messages.dev REST API is a JSON over HTTPS API. Every endpoint is reachable from any language with an HTTP client.Documentation Index
Fetch the complete documentation index at: https://messages.dev/docs/llms.txt
Use this file to discover all available pages before exploring further.
Recommended: use the TypeScript SDK
For TypeScript and Node.js, the@messages-dev/sdk package is the
recommended integration path. It wraps every endpoint in this reference with
a typed client, handles cursor pagination, throws typed errors, and ships a
verifyWebhook() helper that gets the HMAC signature scheme right
(HMAC(${timestamp}.${body}) with replay protection).
Base URL
Authentication
Authenticate every request with a bearer token:Requests
All request bodies are JSON encoded as UTF-8 withContent-Type: application/json.
The API supports CORS for GET, POST, DELETE, and OPTIONS.
Responses
Single resources return the object directly:Conventions
- Field names use
snake_case. - IDs are prefixed by resource type:
msg_,cht_,ln_,rxn_,obx_,wh_,ind_,rcp_,file_. - Timestamps are Unix milliseconds (UTC).
- Every response includes a
request_id. Include it when reporting issues.
Pagination
List endpoints are cursor-paginated. Whenhas_more is true, pass
next_cursor as the cursor query parameter on the next request:
Asynchronous writes
Write endpoints (POST /messages, /audio-messages, /reactions, /typing,
/receipts) accept the request and return an outbox record with status
pending:
- Webhooks (recommended): subscribe to
message.sent. Outgoing messages share the same shape as inbound ones (is_from_me: true). - Polling:
GET /outbox?id=obx_...— status transitions throughpending→claimed→sent(orfailed, with the failure reason inerror).
Sending: contact-first
Outside the sandbox, you can only send to a contact (or group chat) after they have messaged your line first. Sending to a cold contact returns403 contact_has_not_messaged. See Send a message
for the full flow.
Errors
The API maps to standard HTTP status codes (2xx success, 4xx client error,
5xx server error). See Errors for the full taxonomy and
error codes.
Rate limits
API keys are rate limited per hour. When exceeded, the API returns429 with
a Retry-After header indicating the seconds to wait. See
rate limit errors for details.
DELETE with a request body
DELETE /webhooks takes the resource ID in the request body, not the URL: