Docs
Open dashboard

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 charsrequired
    Recipient number. E.164 recommended.
  • fromstring1–20 charsrequired
    One of the workspace's sending numbers.
  • bodystring1–1600 charsrequired
    Sent exactly as written. No opt-out footer is appended.
  • providerstringoptional
    The carrier the from number 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
  • segmentsintegernullableoptional
    Carrier segment count.
  • providerstringnullableoptional
    twiliotouchsmsatmic
  • provider_message_idstringnullableoptional
  • campaign_idstringnullableuuidoptional
    Set when an SMS campaign sent it.
  • recipient_idstringnullableuuidoptional
  • error_codestringnullableoptional
    Carrier error code on a failed message.
  • error_messagestringnullableoptional
  • queued_atstringnullabledate-timeoptional
  • sent_atstringnullabledate-timeoptional
  • delivered_atstringnullabledate-timeoptional
  • failed_atstringnullabledate-timeoptional
  • read_atstringnullabledate-timeoptional
    Inbound only. When a teammate opened the conversation.
  • created_atstringdate-timeoptional
  • updated_atstringdate-timeoptional

Errors

  • 400Bad Request
    Validation failed / malformed request.
  • 401Unauthorized
    Missing, malformed, or invalid API key.
  • 403Forbidden
    Workspace unavailable, suspended, or paywalled.
  • 429Too Many Requests
    Workspace request limit exceeded; shared across all its API keys.
  • 502Bad Gateway
    Upstream voice provider failure.