Sending texts
Tested on 28 November 2026 against a local build of the current Simline API, with a simulated test phone that reports sent and delivered like a real one.
One endpoint sends every text: POST /v1/messages. It needs a key with the send scope.
| Field | Required | |
|---|---|---|
to |
yes | E.164: +, country code, number, digits only (+12125550142). 2125550142 is a 400. |
body |
yes | 1 to 1,600 characters. Long texts are split into SMS parts by the phone and reported as one message. |
from |
no | Which phone and SIM sends. Default "auto". See below. |
channel |
no | sms (default), imessage or sms_or_imessage. See below. |
idempotencyKey |
no | Up to 255 characters. Or send it as the Idempotency-Key header. See below. |
The API stores the message first, then hands it to the phone, and answers 202 with the message. It never waits for the phone to actually send it.
Choosing the sender (from)
Section titled “Choosing the sender (from)”from |
Sends from |
|---|---|
left out, or "auto" |
An online phone, on its default sender SIM. Ties go to the phone with the fewest unfinished texts. |
"dev_…" |
That phone, on its default sender SIM. |
"sim_…" |
That exact SIM. |
"+33 6 00 00 00 02" |
The SIM you gave that number to in the dashboard (any formatting). |
{"deviceId": "dev_…", "simSlot": 1} |
That phone’s slot. Slots count from 0, so 1 is the second SIM. |
auto prefers phones with a live connection, then any paired phone, and skips phones whose SIMs all have sending turned off. A from that doesn’t match anything is a 400, never a silent fallback to another line:
{"error": "bad_request", "message": "from: unknown SIM +33600000009"}Android doesn’t let apps read a SIM’s own number, so you type each number once in the dashboard (Devices → your phone → SIMs). Multi-SIM covers labels, the default sender and turning a SIM off.
Channels
Section titled “Channels”channel matters only for iPhones connected through Simline for Mac:
channel |
Android phone | iPhone through a Mac |
|---|---|---|
sms (default) |
SMS | SMS, through the iPhone |
imessage |
400 (or 409 no_device with auto) |
iMessage |
sms_or_imessage |
Plain SMS | SMS first; iMessage only if the SMS fails |
With from: "auto", Simline only picks a device that can use the channel you asked for. Every message carries channel: for outbound texts, what was asked for (narrowed to what the device can do); for inbound ones, what it arrived as.
Idempotency keys
Section titled “Idempotency keys”Networks fail at the worst moment: after Simline stored your text, before you got the answer. Retry blindly and the customer gets two texts. Send an idempotency key and retry freely:
curl https://api.simline.dev/v1/messages \ -H "Authorization: Bearer $SIMLINE_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: order-1042-ready" \ -d '{"to": "+12125550142", "body": "Hi Maya, your order #1042 is ready for pickup."}'If the same key arrives again within 24 hours, nothing is sent. The API answers 200 (not 202) with the original message and the header Idempotent-Replayed: true.
- The key is the whole identity. A repeat with the same key and a different body still returns the first message (we checked). Build keys from what makes the text unique in your system, like
order-1042-readyorappointment-77-reminder-24h, not from a random value made at send time. - Keys are per workspace. Two of your own apps can collide, so prefix keys with the app’s name if several apps send.
- A
503 dispatch_failedis final for that message. Retry with a new key.
Statuses and finalStatus
Section titled “Statuses and finalStatus”An outbound text moves forward only:
queued → dispatched → accepted → sent → delivered ↘ failed (with errorCode)| Status | Meaning |
|---|---|
queued |
Stored, waiting for the phone (it’s asleep or offline; Simline wakes it). |
dispatched |
Handed to the phone’s live connection. |
accepted |
The phone saved it to its own queue. |
sent |
Every part left the phone’s radio. |
delivered |
The carrier’s delivery report came back for every part. |
failed |
It didn’t go out, or the carrier reported it undelivered. errorCode says why (codes). |
received |
Inbound texts only. |
finalStatus: true means the status will not change. That’s delivered, failed and received, and also sent from a device that never reports delivery (an iPhone through a Mac). Stop polling, or stop waiting for webhooks, on finalStatus, not on delivered: some networks don’t send delivery reports, so a perfectly good text can end at sent.
GET /v1/messages/{id} returns the timeline in events, one entry per state and attempt. A text the phone retried and then sent shows both attempts, and ends delivered.
A text that no phone picks up within 24 hours fails with errorCode: "EXPIRED". If the phone later reports that it did send it, the status still moves forward.
Limits
Section titled “Limits”| Limit | Default | Answer when reached |
|---|---|---|
| Body length | 1,600 characters | 400 bad_request |
| Texts per month | Your plan: Free 300, Pro 10,000, Team 50,000 | 402 plan_limit_texts with resetsAt |
| Texts per workspace per UTC day | 10,000 | 429 usage_limit with Retry-After (seconds to midnight UTC) |
| Sending speed per phone | 20 texts a minute | Nothing: texts queue on the phone and go out at that pace |
| Contacts who texted STOP | 409 contact_opted_out |
The 429 is a daily cap, not a per-second rate limit: don’t retry it in a loop. Received texts are never counted or limited. Billing & limits has the plan details.
Handling errors
Section titled “Handling errors”Every error is JSON with a machine-readable error and a readable message:
async function trySend(message) { const res = await fetch("https://api.simline.dev/v1/messages", { method: "POST", headers: { Authorization: `Bearer ${process.env.SIMLINE_API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify(message) }) const data = await res.json() if (res.ok) return { ok: true, message: data }
switch (data.error) { case "usage_limit": // 429: the workspace's daily cap, resets at 00:00 UTC case "dispatch_failed": // 503: the phone's session couldn't take it; stored as failed return { ok: false, retryAfterSeconds: Number(res.headers.get("Retry-After")), reason: data.message } case "contact_opted_out": // 409: they texted STOP; never retry case "plan_limit_texts": // 402: this month's texts are used up case "no_device": // 409: no paired phone can send right now default: return { ok: false, retryAfterSeconds: null, reason: `${res.status} ${data.error}: ${data.message}` } }}Every code is listed in Errors.
STOP and opt-outs
Section titled “STOP and opt-outs”If a contact texts exactly STOP, STOPALL, UNSUBSCRIBE, END, QUIT, CANCEL, ARRET, ARRÊT, SAIR, PARAR, CANCELAR or DESCADASTRAR (any case, punctuation around it ignored), they’re opted out of your whole workspace. Every way of sending is refused with 409 contact_opted_out: the API, the dashboard, AI agents, approvals, the AI copilot and Telegram. START or UNSTOP opts them back in. “Please stop by tomorrow” is not an opt-out: the whole text has to be the keyword.