Send SMS
POST/sms
Sends one SMS and returns the recorded message with status sent. The message is recorded before it is handed to the carrier, so a rejected send still leaves a failed message you can read back.
Rejected with 400 when to is on the workspace's unsubscribe list, or when no SMS provider (or not the one named in provider) is connected. A carrier rejection returns 502 with the carrier's reason. 403 is returned when the workspace cannot fund the send.
The response carries segments, the unit SMS usage is measured in.
Requires
Authorization: Bearer <api_key>. Create a key in the Inspra dashboard under Workspace Settings → API Keys.Body application/json
- tostring3–20 charsrequiredRecipient number. E.164 recommended.
- fromstring1–20 charsrequiredOne of the workspace's sending numbers.
- bodystring1–1600 charsrequiredSent exactly as written. No opt-out footer is appended.
- providerstringoptionalThe carrier the
fromnumber belongs to. Recommended whenever more than one carrier is connected; without it the workspace's default SMS integration is used.twiliotouchsmsatmic
Response 201 Created
Message sent.
- idstringuuidoptional
- directionstringoptional
outboundinbound - statusstringoptional
queuedsentdeliveredfailedundeliveredopted_out - tostringoptional
- fromstringnullableoptional
- bodystringnullableoptional
- segmentsintegernullableoptionalCarrier segment count.
- providerstringnullableoptional
twiliotouchsmsatmic - provider_message_idstringnullableoptional
- campaign_idstringnullableuuidoptionalSet when an SMS campaign sent it.
- recipient_idstringnullableuuidoptional
- error_codestringnullableoptionalCarrier error code on a failed message.
- error_messagestringnullableoptional
- queued_atstringnullabledate-timeoptional
- sent_atstringnullabledate-timeoptional
- delivered_atstringnullabledate-timeoptional
- failed_atstringnullabledate-timeoptional
- read_atstringnullabledate-timeoptionalInbound only. When a teammate opened the conversation.
- created_atstringdate-timeoptional
- updated_atstringdate-timeoptional
Errors
- 400Bad RequestValidation failed / malformed request.
- 401UnauthorizedMissing, malformed, or invalid API key.
- 403ForbiddenWorkspace unavailable, suspended, or paywalled.
- 429Too Many RequestsWorkspace request limit exceeded; shared across all its API keys.
- 502Bad GatewayUpstream voice provider failure.