SMS messages

Send an SMS message

Changed on

Sends a text from a business line (the first one with texting on, or phone_number_id). Within 24 hours of the person's last text it is a reply. Otherwise texting someone first needs their consent on file: transactional (the default) accepts any consent, marketing needs written consent; it goes out between 8am and 9pm their time. The first text to a number names the business and says how to opt out.

post/sms-messages

Request

  • Base URL
    https://api.crevio.co/v1
  • Auth
    API key in header Authorization

Headers

Idempotency-Key, string

Makes this write safe to retry: a repeat with the same key replays the first response instead of creating a second resource. Scoped to the account, remembered for 24 hours; reusing a key with a different payload is an error.

Request body

SmsMessageRequest required
to, string required

The person's phone number, in the line's country (E.164 preferred, e.g. +14155550123).

body, string required

The text to send. Over 160 plain characters (70 with emoji or accents) it goes as several billed segments.

purpose, 'transactional' | 'marketing'

Why you are texting someone who hasn't texted in the last 24 hours. transactional (default) needs any consent on file; marketing needs written consent.

phone_number_id, string

Which business line sends it. Defaults to the first number with texting on.

Response

The queued text

SmsMessage required
id, string required
object, string required
direction, 'inbound' | 'outbound' required
author, 'contact' | 'assistant' | 'outreach' | 'agent' required
status, 'received' | 'pending' | 'sent' | 'delivered' | 'failed' | 'refused' | 'superseded' | 'canceled' required
body, string required
segments, integer required
credits_charged, integer nullable required
error, string nullable required
sent_at, string date-time nullable required
created_at, string date-time required
updated_at, string date-time required
phone_number, string required
counterpart, string required
contact, string nullable required
failure, 'undelivered' | 'send_failed' | 'null' nullable required

Why a failed text failed: undelivered when the carrier accepted it and could not deliver it, send_failed when it was never sent. null unless status is failed.

suppression, string nullable required

The phone suppression (psup_...) a refused text was held back by. null unless status is refused for a suppressed number.

sms_follow_up, string nullable required

Changes

    • warning

      added the new idempotency_error enum value to the error/type response property for the response status

    • warning

      added the new idempotency_error enum value to the error/type response property for the response status

    • warning

      added the new idempotency_error enum value to the error/type response property for the response status

    4 more changes in this revision