API reference
Nine resources across five groups. JSON in, JSON out, bearer auth, and an error code that tells you which side has to change something.
- Base URL
- api.textreach.online/v2
- Auth
- Bearer <key>
- Content type
- application/json
Authentication
Keys are scoped to an environment and to a set of route classes. Send the key as a bearer token on every request. There is no session, no refresh and no cookie.
request headers
Authorization: Bearer tr_live_9f2c...
Content-Type: application/json
Idempotency-Key: dep-4471-a
TextReach-Version: 2026-06-01Conventions
The same four rules apply to every resource, so once you have written one call you have written all of them.
- IdempotencyAny write accepts an Idempotency-Key, honoured for 24 hours.
- PaginationCursor based. Follow next_cursor until it comes back null.
- VersioningPinned per key, overridable per request with TextReach-Version.
- TimesRFC 3339, always UTC, always with an explicit offset.
Messages
/v2/messagesSend a message
Template or raw body, one or many destinations, idempotency key honoured for 24 hours.
/v2/messages/{id}Retrieve a message
Current state plus the full transition history and the carrier reason code if it failed.
/v2/messagesList messages
Cursor paginated, filterable by state, sender, market and creation window.
/v2/messages/{id}Cancel a scheduled send
Valid up until submission. Returns 409 once the message has left the gateway.
Senders and routing
/v2/sendersRegister a sender
Submit an alphanumeric or long code for a market, with the documents the network requires.
/v2/senders/{id}Registration status
Where the submission sits with the network, and what is outstanding if it stalled.
/v2/routesList available routes
Direct binds available to your key per market, with class, latency band and price.
Consent
/v2/consent/{msisdn}Read consent state
Opt-in state, its source, and when it was last written. Checked automatically on every send.
/v2/consentRecord consent
Write an opt-in or opt-out with a source reference so the audit trail stays intact.
Events
/v2/webhooksCreate a subscription
Choose event classes and receive the signing secret once, at creation time.
/v2/eventsReplay events
Pull anything from the last thirty days, filtered by class and sequence number.
/v2/webhooks/{id}Update a subscription
Change the endpoint or the event set, or rotate the signing secret without downtime.
Usage
/v2/usageUsage and spend
Volume, segments and cost by market and message class for any window you ask for.
/v2/limitsCurrent limits
Throughput ceiling, burst allowance and how much of each you are using right now.
Error codes
Errors carry a stable machine name alongside the status, so you can branch on the name rather than parsing a message that might change.
- 401
invalid_keyThe key is unknown, revoked, or scoped to a different environment. - 409
market_not_licensedThe destination is outside the markets attached to this key. Add the licence in the console. - 409
sender_unregisteredThe sender identity has no approved registration on the destination network. - 422
no_consentNo opt-in record exists for the destination, or the most recent record is an opt-out. - 429
throughput_exceededThe key is over its ceiling. The Retry-After header carries the wait in seconds. - 503
route_unavailableEvery bind for the market is degraded. Retries are safe and the idempotency key still holds.
error body
{
"error": {
"name": "market_not_licensed",
"status": 409,
"message": "Destination market DE is not on this key.",
"docs": "https://textreach.online/api-docs#errors"
}
}The full OpenAPI 3.1 description, the Postman collection and the five maintained SDKs all live in the developer hub, versioned against this reference.
Try it against the sandbox
A sandbox key gives you every route on this page, with simulated carrier responses and the failure codes you want to test.