← API reference

SMS API

Outbound SMS and message history. Dual auth: Bearer or dashboard session.

GET /sms

List SMS messages

Auth: API key (Authorization: Bearer). Scope: sms:read.

Requires one of the following scopes: sms:read.

Returns outbound and inbound messages together. Each item carries a direction field (outbound | inbound); inbound messages are stored delivered on receipt. Outbound messages suppressed by the opt-out register are stored with status blocked and never reach a carrier.

Session authentication also works for browser (dashboard) contexts; this operation documents the Bearer path.

Parameters

NameInTypeDescription
limitqueryinteger

Max items to return (1-100).

Default 25 · min 1 · max 100

offsetqueryinteger

Number of items to skip.

Default 0 · min 0

statusquerystring

Filter by message status. An unrecognised value is ignored rather than rejected.

One of: queued, sent, delivered, failed, blocked

sourcequerystring

Filter by message source. An unrecognised value is ignored rather than rejected.

One of: ui, api, flow, inbound

date_fromquerystring (date)

Start date, YYYY-MM-DD. A value in any other format is ignored rather than rejected.

date_toquerystring (date)

End date, YYYY-MM-DD, inclusive through 23:59:59. A value in any other format is ignored rather than rejected.

phonequerystring
directionquerystring

Filter by message direction. Omit to return both — the log is a two-way conversation history, not a send log. An unrecognised value is ignored rather than rejected.

One of: outbound, inbound

Responses

200 Success

Headers: X-Request-ID, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-API-Key-Expires-At, X-API-Key-Expires-In-Days

Response fields
FieldTypeDescription
successboolean required

Always true

dataobject required
data.messagesarray of object
data.totalinteger
data.limitinteger
data.offsetinteger

401 Missing or invalid API key.

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

403 Not permitted. The auth envelope is returned when the API key lacks the required scope (INSUFFICIENT_SCOPE), or the organization is unavailable or suspended (ORG_UNAVAILABLE, ORG_SUSPENDED). The standard envelope with code forbidden is returned when SMS is not included in the organization’s plan or is not available for the organization.

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

429 Rate limit exceeded.

Headers: Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Request-ID

503 SMS is switched off platform-wide (SMS_DISABLED). The platform kill switch stays closed until A2P 10DLC brand registration completes; no SMS route responds while it is off, regardless of plan.

POST /sms/send

Send an SMS

Auth: API key (Authorization: Bearer). Scope: sms:write.

Requires one of the following scopes: sms:write.

Sends are checked against the organization’s opt-out register first. A recipient who has replied STOP is refused with 409 Conflict and the message is recorded with status blocked; it is never handed to a carrier. Clearing that suppression is not possible over the API — see POST /sms/opt-outs.

Session authentication also works for browser (dashboard) contexts; this operation documents the Bearer path. A session caller must send a CSRF token (X-CSRF-Token header or csrf_token body field) and be an organization owner or admin.

Request body application/json required

FieldTypeDescription
tostring required

Recipient number in E.164 format, for example +14155550123.

pattern ^\+[1-9]\d{1,14}$

messagestring required

Message text. At most 1600 characters.

min length 1 · max length 1600

sender_idstring

1 to 11 letters or digits.

pattern ^[a-zA-Z0-9]{1,11}$

metadataobject

Free-form object. At most 4096 bytes when encoded as JSON.

Accepts any keys

Responses

201 Message sent

Headers: X-Request-ID, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-API-Key-Expires-At, X-API-Key-Expires-In-Days

Response fields
FieldTypeDescription
successboolean required

Always true

dataobject required
data.idinteger
data.tostring
data.statusstring

Always sent on a 201: the message was handed to the carrier before the response.

Always sent

data.providerstring | null

Carrier route the message took. A 201 always carries telnyx.

One of: telnyx, sns, none, null

data.provider_message_idstring | null

Provider-side message id, whichever provider handled the send. Prefer this over sns_message_id.

data.sns_message_idstring | null

Deprecated — retained for callers written against the SNS-only era. It is null on every Telnyx send, which is now the only route. Read provider_message_id instead.

deprecated

data.segmentsinteger

Number of message segments. The carrier’s count is used when it reports one.

data.created_atstring (date-time)

Time the response was built.

400 Invalid request (validation errors under error.details.validation_errors).

401 Missing or invalid API key.

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

403 Not permitted. The auth envelope is returned when the API key lacks the required scope (INSUFFICIENT_SCOPE), or the organization is unavailable or suspended (ORG_UNAVAILABLE, ORG_SUSPENDED). The standard envelope with code forbidden is returned when SMS is not included in the organization’s plan or is not available for the organization. A session caller with an invalid CSRF token also gets forbidden.

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

409 Recipient has opted out of messages from this organization. The message is recorded with status blocked and not transmitted.

429 Rate limit exceeded.

Headers: Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Request-ID

503 SMS is switched off platform-wide (SMS_DISABLED). The platform kill switch stays closed until A2P 10DLC brand registration completes; no SMS route responds while it is off, regardless of plan.

GET /sms/stats

SMS stats

Auth: API key (Authorization: Bearer). Scope: sms:read.

Requires one of the following scopes: sms:read.

All counters are direction-scoped: sent/delivered/failed/blocked cover outbound traffic only, and inbound traffic is reported separately as total_received.

Session authentication also works for browser (dashboard) contexts; this operation documents the Bearer path.

Parameters

NameInTypeDescription
date_fromquerystring (date)

Start date, YYYY-MM-DD. A value in any other format is ignored rather than rejected.

date_toquerystring (date)

End date, YYYY-MM-DD, inclusive through 23:59:59. A value in any other format is ignored rather than rejected.

Responses

200 Success

Headers: X-Request-ID, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-API-Key-Expires-At, X-API-Key-Expires-In-Days

Response fields
FieldTypeDescription
successboolean required

Always true

dataobject required
data.total_sentinteger

Outbound messages handed to a carrier, regardless of delivery outcome. Excludes blocked messages and all inbound traffic.

data.total_deliveredinteger

Outbound messages confirmed delivered by the carrier.

data.total_failedinteger

Outbound messages the carrier rejected or failed to deliver.

data.total_blockedinteger

Outbound messages the platform refused to transmit because the recipient had opted out. Not a delivery failure.

data.total_receivedinteger

Inbound messages received from contacts, including STOP, START and HELP replies.

data.total_segmentsinteger

Billable segments. Outbound only — inbound messages are not billed.

401 Missing or invalid API key.

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

403 Not permitted. The auth envelope is returned when the API key lacks the required scope (INSUFFICIENT_SCOPE), or the organization is unavailable or suspended (ORG_UNAVAILABLE, ORG_SUSPENDED). The standard envelope with code forbidden is returned when SMS is not included in the organization’s plan or is not available for the organization.

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

429 Rate limit exceeded.

Headers: Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Request-ID

503 SMS is switched off platform-wide (SMS_DISABLED). The platform kill switch stays closed until A2P 10DLC brand registration completes; no SMS route responds while it is off, regardless of plan.

GET /sms/opt-outs

List SMS opt-outs

Auth: API key (Authorization: Bearer). Scope: sms:read.

Requires one of the following scopes: sms:read.

The organization’s suppression register. Full phone numbers are stored encrypted and are never returned — entries expose the last four digits only.

Session authentication also works for browser (dashboard) contexts; this operation documents the Bearer path.

Parameters

NameInTypeDescription
statusquerystring

Defaults to opted_out — the suppressions, i.e. the records that change what the platform will do. Pass the parameter empty (?status=) to return opt-ins alongside them for a full audit trail.

One of: opted_out, opted_in · Default opted_out

limitqueryinteger

Max items to return (1-100).

Default 25 · min 1 · max 100

offsetqueryinteger

Number of items to skip.

Default 0 · min 0

Responses

200 Success

Headers: X-Request-ID, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-API-Key-Expires-At, X-API-Key-Expires-In-Days

Response fields
FieldTypeDescription
successboolean required

Always true

dataobject required
data.opt_outsarray of object
data.opt_outs[].idinteger
data.opt_outs[].phone_last_fourstring | null

Last four digits only. The full number is stored encrypted and is never returned.

data.opt_outs[].statusstring

One of: opted_out, opted_in

data.opt_outs[].keywordstring | null

Keyword that triggered the record, e.g. STOP, START.

data.opt_outs[].sourcestring

How the record was created. inbound_keyword means the contact texted the keyword from their own handset.

One of: inbound_keyword, api, ui, import, carrier

data.opt_outs[].opted_out_atstring (date-time) | null
data.opt_outs[].opted_in_atstring (date-time) | null
data.opt_outs[].created_atstring (date-time)
data.opt_outs[].updated_atstring (date-time) | null
data.totalinteger
data.limitinteger
data.offsetinteger

401 Missing or invalid API key.

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

403 Not permitted. The auth envelope is returned when the API key lacks the required scope (INSUFFICIENT_SCOPE), or the organization is unavailable or suspended (ORG_UNAVAILABLE, ORG_SUSPENDED). The standard envelope with code forbidden is returned when SMS is not included in the organization’s plan or is not available for the organization.

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

429 Rate limit exceeded.

Headers: Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Request-ID

503 SMS is switched off platform-wide (SMS_DISABLED). The platform kill switch stays closed until A2P 10DLC brand registration completes; no SMS route responds while it is off, regardless of plan.

POST /sms/opt-outs

Suppress a number

Auth: API key (Authorization: Bearer). Scope: sms:write.

Requires one of the following scopes: sms:write.

Honours an opt-out that arrived somewhere other than an inbound STOP — a phone call, an email, a web form, an imported list. Idempotent.

There is deliberately no delete or opt-in operation. Clearing a suppression is the one direction that can put the platform back in touch with someone who said STOP, and an API caller cannot evidence the fresh consent that would make that lawful. Re-subscription happens only when the contact texts START from their own handset.

Session authentication also works for browser (dashboard) contexts; this operation documents the Bearer path. A session caller must send a CSRF token (X-CSRF-Token header or csrf_token body field) and be an organization owner or admin.

Request body application/json required

FieldTypeDescription
phonestring required

Recipient number in E.164 form, e.g. +14155551234. Anything that does not normalise to a plausible E.164 number is rejected with 400, because a malformed entry would suppress nothing.

Example +14155551234

keywordstring

Recorded for audit. Upper-cased and truncated to 32 characters.

Default STOP · max length 32

Responses

201 Number suppressed. Idempotent — re-suppressing an already-suppressed number succeeds.

Headers: X-Request-ID, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-API-Key-Expires-At, X-API-Key-Expires-In-Days

Response fields
FieldTypeDescription
successboolean required

Always true

dataobject required
data.phone_last_fourstring
data.statusstring

Always opted_out

data.keywordstring
data.sourcestring

One of: api, ui

400 Invalid request (validation errors under error.details.validation_errors).

401 Missing or invalid API key.

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

403 Not permitted. The auth envelope is returned when the API key lacks the required scope (INSUFFICIENT_SCOPE), or the organization is unavailable or suspended (ORG_UNAVAILABLE, ORG_SUSPENDED). The standard envelope with code forbidden is returned when SMS is not included in the organization’s plan or is not available for the organization. A session caller with an invalid CSRF token also gets forbidden.

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

429 Rate limit exceeded.

Headers: Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Request-ID

500 The suppression was not recorded (OPT_OUT_NOT_RECORDED). Treat as a failure and retry — the register does not hold the opt-out.

503 SMS is switched off platform-wide (SMS_DISABLED). The platform kill switch stays closed until A2P 10DLC brand registration completes; no SMS route responds while it is off, regardless of plan.

GET /sms/{id}

Get a message

Auth: API key (Authorization: Bearer). Scope: sms:read.

Requires one of the following scopes: sms:read.

Session authentication also works for browser (dashboard) contexts; this operation documents the Bearer path.

Parameters

NameInTypeDescription
idpathinteger required

Message id

Responses

200 Success

Headers: X-Request-ID, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-API-Key-Expires-At, X-API-Key-Expires-In-Days

Response fields
FieldTypeDescription
successboolean required

Always true

dataobject required

Accepts any keys

401 Missing or invalid API key.

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

403 Not permitted. The auth envelope is returned when the API key lacks the required scope (INSUFFICIENT_SCOPE), or the organization is unavailable or suspended (ORG_UNAVAILABLE, ORG_SUSPENDED). The standard envelope with code forbidden is returned when SMS is not included in the organization’s plan or is not available for the organization.

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

404 Resource not found (also returned for cross-tenant ids to avoid existence leaks).

429 Rate limit exceeded.

Headers: Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Request-ID

503 SMS is switched off platform-wide (SMS_DISABLED). The platform kill switch stays closed until A2P 10DLC brand registration completes; no SMS route responds while it is off, regardless of plan.

Ready to build on Vosy?

API access is included with the Business and Enterprise plans. Sign up, choose a plan with API access, and create your own keys from the Vosy API page in your account. Compare plans

Get Started