Skip to content

Send an SMS

POST/v1/messagesKey · send

Send an SMS (scope send).

Authentication

API key: Authorization: Bearer sl_live_… with the send scope. The dashboard session works too.

An API key always acts in its own workspace. With a dashboard session, pass ?workspaceId= to choose the workspace (default: your first).

Parameters

NameInDescription
Idempotency-Keyheader

string — Same as the body field. The same key within 24 h returns the original message (200).

Request body

application/json, required.

FieldDescription
to
required
string · pattern ^\+[1-9]\d{6,14}$
E.164
body
required
string · 1–1600 characters
fromFrom
idempotencyKeystring · 1–255 characters
channel"sms" | "imessage" | "sms_or_imessage" · default "sms"
imessage and sms_or_imessage need an iPhone connected through Simline for Mac (400 if from names a device that can't; auto picks one that can). sms_or_imessage sends by SMS first and uses iMessage only if the SMS fails; on an Android phone it is plain SMS.
Example body
{
"to": "+12125550142",
"body": "Hi Maya, your order #1042 is ready for pickup.",
"idempotencyKey": "order-1042-ready"
}

Response

200 — Idempotent replay: the original message

202 — Queued and handed to the phone's session

FieldDescription
id
required
string · pattern ^msg_[A-Za-z0-9]+$
direction
required
"outbound" | "inbound"
status
required
"queued" | "dispatched" | "accepted" | "sent" | "delivered" | "failed" | "received"
finalStatus
required
boolean
True once status will not change: delivered, failed, received, or sent from a device without delivery reports (an iPhone through Simline for Mac). Stop polling or waiting for webhooks when it is true.
channel
required
"sms" | "imessage" | "sms_or_imessage"
Outbound: the channel asked for (narrowed to what the device can do). Inbound: what the text arrived as.
contact
required
string
The other party: E.164, or an alphanumeric sender for inbound.
body
required
string
deviceIdstring | null
simSlotinteger | null
partsinteger | null
attempt
required
integer
errorCodestring | null
idempotencyKeystring | null
apiKeyIdstring | null
userIdstring | null
agentIdstring | null
createdAt
required
string · date-time
updatedAt
required
string · date-time
sentAtstring | null · date-time
deliveredAtstring | null · date-time
readAtstring | null · date-time
200 example (values are illustrative)
{
"id": "msg_4e03f88dc3ae3e703ee205e19b5ad9c7",
"direction": "outbound",
"status": "queued",
"finalStatus": false,
"channel": "sms",
"contact": "+12125550142",
"body": "Hi Maya, your order #1042 is ready for pickup.",
"deviceId": "dev_8fK2mQ4xR7sT1bV6hN3cYw",
"simSlot": 0,
"parts": 1,
"attempt": 1,
"errorCode": "errorCode",
"idempotencyKey": "order-1042-ready",
"apiKeyId": "apiKeyId",
"userId": "userId",
"agentId": "agentId",
"createdAt": "2026-11-28T09:13:57.390Z",
"updatedAt": "2026-11-28T09:13:57.390Z",
"sentAt": "2026-11-28T09:13:57.390Z",
"deliveredAt": "2026-11-28T09:13:57.390Z",
"readAt": "2026-11-28T09:13:57.390Z"
}

Errors

Errors are JSON: {"error": "<code>", "message": "<a sentence>"}. Branch on error, show message. Every code is explained in Errors.

StatuserrorWhen
400bad_requestInvalid body or sender
401unauthorizedMissing or invalid API key / session
402plan_limit_textsThis month's texts on the workspace's plan are used up (plan_limit_texts)
403forbidden
workspace_suspended
sending_paused_review
API key lacks the required scope (forbidden), the workspace is suspended (workspace_suspended), or new texts are paused pending review (sending_paused_review; replies to contacts who texted first still go out). Both carry supportEmail.
409no_device
device_update_required
contact_opted_out
No phone can send (no_device), from names a device whose app must be updated first (device_update_required), or the contact texted STOP and opted out (contact_opted_out; they opt back in by texting START)
429usage_limit
ramp_limit
Daily send limit reached (usage_limit), or a new workspace's daily ramp (ramp_limit, with limit, used, liftsAt, nextLimit, nextStepAt, graduatesAt and Retry-After; replies to contacts who texted first are never refused by it)
500internalInternal error
503dispatch_failedThe phone's session could not take the message (dispatch_failed)

Examples

Set SIMLINE_API_KEY to your key first. Node examples use the built-in fetch (Node 18+, run as an ES module); Python uses requests.

Terminal window
curl -X POST "https://api.simline.dev/v1/messages" \
-H "Authorization: Bearer $SIMLINE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"to":"+12125550142","body":"Hi Maya, your order #1042 is ready for pickup.","idempotencyKey":"order-1042-ready"}'