Skip to main content
POST
Typescript (SDK)

Authorizations

Authorization
string
header
required

API key in the format: Bearer {api_token}

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.

Maximum string length: 255

Body

application/json
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
enum<string>

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.

Available options:
transactional,
marketing
phone_number_id
string

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

Response

The queued text

id
string
required
object
string
required
direction
enum<string>
required
Available options:
inbound,
outbound
author
enum<string>
required
Available options:
customer,
assistant,
outreach,
agent
status
enum<string>
required
Available options:
received,
pending,
sent,
delivered,
failed,
refused,
superseded,
canceled
body
string
required
segments
integer
required
credits_charged
integer | null
required
error
string | null
required
sent_at
string<date-time> | null
required
created_at
string<date-time>
required
updated_at
string<date-time>
required
phone_number
string
required
counterpart
string
required
customer
string | null
required
sms_follow_up
string | null
required