- List SMS GET
- Send an SMS POST
- List suppressed numbers GET
- Add a number to the SMS suppression list POST
- Check whether a number is suppressed GET
- Retrieve an SMS suppression GET
- Remove a number from the SMS suppression list DELETE
- List received SMS GET
- Retrieve a received SMS GET
- List the organization's phone numbers GET
- Retrieve an SMS GET
- List an SMS's events GET
- Cancel a scheduled SMS POST
Send an SMS
Queues a text message from the API key's environment and returns it with status: "queued"; it is handed to the carrier moments later. Follow it with GET /v1/sms/{id} or the sms.sent, sms.delivered, sms.undelivered and sms.failed webhooks. Live (coss_live_…) keys send from one of the organization's numbers whose carrier registration is approved, to the countries the organization allows (US and Canada unless changed in the dashboard). Sandbox (coss_test_…) keys accept any from, deliver nothing and answer the SMS simulator's numbers (+15005550006 delivered, +15005550001 invalid, +15005550004 filtered by the carrier, +15005550009 opted out, +15005550008 replies). A number on the environment's SMS suppression list (it replied STOP, or it can't receive SMS) is skipped: the message is failed with suppressed. Segments count against the organization's send quota, and each is billed by the destination country.
bearerAuthAuthorizationBearer <token>A secret API key from the dashboard: coss_live_… for production environments, coss_test_… for sandbox environments.
Idempotency-Key?stringMakes retries safe: a repeated request with the same key and body returns the original message (with its current status) instead of sending again, for 24 hours. 1-256 characters.
1 <= length <= 256Coss-Version?"2026-10-10"The API version (a date) to use for this request. Defaults to your organization's version, pinned to the latest one when it first used the API and upgraded from the dashboard. The SDK always sends the version it was built for.
"2026-10-10"application/json- body
- body
- …
from*stringOne of your organization's phone numbers, in E.164 form. Sandbox environments accept any number.
^\+[1-9]\d{6,14}$to*stringThe recipient's mobile number, in E.164 form.
^\+[1-9]\d{6,14}$body*stringThe text. Messages are split into segments of 153 GSM-7 or 67 Unicode characters (152 or 66 from a toll-free number; 160 or 70 for a single one), each billed; at most 10 (1,520 GSM-7 or 660 Unicode characters).
1 <= length <= 1600tags?array<>Up to 10 tags.
items <= 10scheduled_at?stringSend at this time instead of now (ISO 8601 with an offset, at most 30 days ahead). A time that is not in the future sends immediately.
date-timeThe message, accepted (queued or scheduled; failed when its number is suppressed). A replay returns the original message with its current status.
application/json- response
- response
- …
object*"sms""sms"id*stringfrom*stringto*stringbody*stringstatus*stringqueued until handed to the carrier (sent), then delivered or undelivered once the carrier reports. failed: never sent. scheduled and canceled: scheduled sends.
"queued""scheduled""sent""delivered""undelivered""failed""canceled"segments*integerSegments the body takes (what is billed).
encoding*string"gsm7""ucs2"country*stringISO 3166 country of to.
tags*array<>failure*|Why the message failed or wasn't delivered.
sandbox*booleanSent from a sandbox environment: simulated.
scheduled_at*|date-timesent_at*|date-timedelivered_at*|date-timecreated_at*stringdate-timeimport { Coss } from "coss";const coss = new Coss({ apiKey: process.env.COSS_API_KEY, baseUrl: "https://api.coss.com",});const { data, error } = await coss.sms.send({ from: "+14155550123", to: "+14155550199", body: "Your Acme code is 482913", tags: [ { name: "flow", value: "sign_in", }, ],});{ "object": "sms", "id": "sms_01k7c8m4q2f3e9v6t5r1n0p8yz", "from": "+14155550123", "to": "+14155550199", "body": "Your Acme code is 482913", "status": "delivered", "segments": 1, "encoding": "gsm7", "country": "US", "tags": [ { "name": "flow", "value": "sign_in" } ], "failure": null, "sandbox": false, "scheduled_at": null, "sent_at": "2026-11-10T12:00:01.000Z", "delivered_at": "2026-11-10T12:00:04.000Z", "created_at": "2026-11-10T12:00:00.000Z"}