For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

Channel Manager

Inspect Channel Manager's messaging, voice, and setup HTTP contracts using operation blocks rendered from its separate public OpenAPI schema.

Channel Manager has its own API host and its own credential model: scoped OAuth2 tokens issued for a setup. Use the host assigned to your deployment and request only the scopes the operation requires. The public schema linked here is the US contract. Its availability does not establish enrollment or deployment in another region.

Use this page to look up a request or response. For a task, start with one of these guides:

The operation blocks below render the canonical request and response contracts. The health probe is excluded from this customer reference.

List emails

get

List emails matching the request filters. At least one of use_case_id or setup_id is required so the query stays on a leading index. Other filters (to_address, created_after, created_before, state) narrow within that scope. Sort via repeated sort_by query params; each entry is +field or -field (allowed field: created_at). Default: -created_at. Cursor opaque — round-trip continuation_token unchanged with the same sort_by.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
directionstring · enum · nullableOptional

Filter by inbound or outbound direction.

Possible values:
use_case_idstring · uuid · nullableOptional

Filter to this email use case. At least one of use_case_id or setup_id is required.

setup_idstring · uuidRequired

Filter to emails sent from this SES setup. At least one of use_case_id or setup_id is required.

peer_addressstring · email[]Optional

Filter to emails delivered to one or more recipient addresses (set semantics: any match).

Default: []
in_reply_to_email_idstring · uuid · nullableOptional

Filter to emails that are replies to this specific outbound/inbound.

created_afterstring · date-time · nullableOptional

Inclusive lower bound on created_at.

created_beforestring · date-time · nullableOptional

Exclusive upper bound on created_at.

sort_bystring[]Optional

Sort axes, applied left-to-right. +field ascending, -field descending. Defaults to [("created_at", -1)] (newest first).

Default: []
limitinteger · max: 200Optional

The maximum number of emails to return.

Default: 50
continuation_tokenanyOptional

Opaque continuation token from a prior response. Treat as a black box — the server decodes it.

Responses
200

Successful Response

application/json
has_morebooleanRequired

Whether there are more emails to retrieve.

continuation_tokenanyRequired

Opaque token to pass back on the next page request. Null when there are no more results.

get/v1/email
GET /v1/email?setup_id=123e4567-e89b-12d3-a456-426614174000 HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "items": [
    {
      "direction": "text",
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "ses_use_case_id": "123e4567-e89b-12d3-a456-426614174000",
      "setup_id": "123e4567-e89b-12d3-a456-426614174000",
      "from_address": "text",
      "to_address": "text",
      "subject": "text",
      "state": "sent",
      "created_at": "2026-01-01T00:00:00.000Z",
      "has_attachment": true,
      "replied_to_inbound_email_id": "123e4567-e89b-12d3-a456-426614174000",
      "open_count": 1,
      "click_count": 1
    }
  ],
  "has_more": true,
  "continuation_token": null
}

Send Email

post

Send one email through SES, from an inline HTML body or a stored template.

raw_html mode needs subject and body_html; template mode needs template_id and template_parameters covering every declared variable. Unsubscribe links are injected by the send path, never the caller. The use case's setup must be DNS-verified.

Requires the email:send OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
use_case_idstring · uuidRequired
to_addressstring · emailRequired
modestring · enumRequiredPossible values:
template_parametersstring · nullableOptional
template_idstring · uuid · nullableOptional
subjectstring · min: 1 · max: 998 · nullableOptional
body_htmlstring · min: 1 · max: 1000000 · nullableOptional
attachmentsstring[]OptionalDefault: []
reply_to_inbound_email_idstring · uuid · nullableOptional
Responses
201

Successful Response

application/json
idstring · uuidRequired

Identifier of the sent email.

created_atstring · date-timeRequired

When the email was sent.

attachment_filenamesstring[]Required

Attachment filenames in send order.

replied_to_inbound_email_idstring · uuid · nullableRequired

Received email this message replies to, if any.

post/v1/email/
POST /v1/email/ HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: multipart/form-data
Accept: */*
Content-Length: 310

{
  "use_case_id": "123e4567-e89b-12d3-a456-426614174000",
  "to_address": "name@gmail.com",
  "mode": "template",
  "template_parameters": "text",
  "template_id": "123e4567-e89b-12d3-a456-426614174000",
  "subject": "text",
  "body_html": "text",
  "attachments": [
    "text"
  ],
  "reply_to_inbound_email_id": "123e4567-e89b-12d3-a456-426614174000"
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "created_at": "2026-01-01T00:00:00.000Z",
  "attachment_filenames": [
    "text"
  ],
  "replied_to_inbound_email_id": "123e4567-e89b-12d3-a456-426614174000"
}

List email events

get

List SES events matching the request filters. At least one of use_case_id or setup_id is required so the underlying emails join lands on a leading index. Other filters (email_id, event_type, event_at_after, event_at_before) narrow within that scope. Sort via repeated sort_by query params; each entry is +field or -field (allowed field: event_at). Default: -event_at. Cursor opaque — round-trip continuation_token unchanged with the same sort_by.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
use_case_idstring · uuid · nullableOptional

Filter to events for emails sent through this use case.

setup_idstring · uuidRequired

Filter to events for emails sent from this SES setup.

email_idstring · uuid[]Optional

Narrow to one or more emails' event timelines (set semantics: any match).

Default: []
event_at_afterstring · date-time · nullableOptional

Inclusive lower bound on event_at.

event_at_beforestring · date-time · nullableOptional

Exclusive upper bound on event_at.

sort_bystring[]Optional

Sort axes applied left-to-right; +field/-field. Default -event_at (newest first).

Default: []
limitinteger · max: 200Optional

The maximum number of events to return.

Default: 50
continuation_tokenanyOptional

Opaque continuation token from a prior response; treat as a black box.

Responses
200

Successful Response

application/json
has_morebooleanRequired

Whether there are more events to retrieve.

continuation_tokenanyOptional

Opaque token to pass back on the next page request; null when no more results.

get/v1/email/event
GET /v1/email/event?setup_id=123e4567-e89b-12d3-a456-426614174000 HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "items": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "email_id": "123e4567-e89b-12d3-a456-426614174000",
      "event_type": "Reject",
      "event_at": "2026-01-01T00:00:00.000Z",
      "created_at": "2026-01-01T00:00:00.000Z"
    }
  ],
  "has_more": true,
  "continuation_token": null
}

List Email Templates

get

List a SES use case's email templates, summary fields only.

Requires the email:template:read OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
ses_use_case_idstring · uuidRequired
Responses
200

Successful Response

application/json
get/v1/email/template
GET /v1/email/template?ses_use_case_id=123e4567-e89b-12d3-a456-426614174000 HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "email_templates": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "text",
      "description": "text",
      "ses_use_case_id": "123e4567-e89b-12d3-a456-426614174000",
      "created_at": "2026-01-01T00:00:00.000Z",
      "updated_at": "2026-01-01T00:00:00.000Z"
    }
  ]
}

Create Email Template

post

Create a reusable subject/body Jinja template owned by a SES use case.

Requires the email:template:write OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
ses_use_case_idstring · uuidRequired

Email use case that owns this template.

namestring · min: 1 · max: 64Required

Name unique within the email use case.

Pattern: ^[A-Za-z0-9 _-]+$
descriptionstring · min: 1 · max: 4096 · nullableRequired

Optional description of the template's purpose.

subject_templatestring · min: 1 · max: 256Required

Jinja template for the email subject.

body_templatestring · min: 1 · max: 1000000Required

Jinja template for the email body.

Responses
201

Successful Response

application/json
idstring · uuidRequired

Identifier of the template.

namestringRequired

Name of the template.

descriptionstring · nullableRequired

Optional description of the template's purpose.

ses_use_case_idstring · uuidRequired

Email use case that owns this template.

subject_templatestringRequired

Jinja template for the email subject.

body_templatestringRequired

Jinja template for the email body.

required_subject_variablesstring[]Required

Variables the caller must provide for the subject.

required_body_variablesstring[]Required

Variables the caller must provide for the body.

created_atstring · date-timeRequired

When the template was created.

updated_atstring · date-timeRequired

When the template was last changed.

post/v1/email/template
POST /v1/email/template HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 142

{
  "ses_use_case_id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "text",
  "description": "text",
  "subject_template": "text",
  "body_template": "text"
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "text",
  "description": "text",
  "ses_use_case_id": "123e4567-e89b-12d3-a456-426614174000",
  "subject_template": "text",
  "body_template": "text",
  "required_subject_variables": [
    "text"
  ],
  "required_body_variables": [
    "text"
  ],
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}

Delete Email Template

delete

Delete an email template.

Requires the email:template:write scope on its setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
email_template_idstring · uuidRequired
Responses
204

Successful Response

No content

delete/v1/email/template/{email_template_id}
DELETE /v1/email/template/{email_template_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Get Email Template

get

Fetch one email template, including its declared subject and body variables.

Requires the email:template:read OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
email_template_idstring · uuidRequired
Responses
200

Successful Response

application/json
idstring · uuidRequired

Identifier of the template.

namestringRequired

Name of the template.

descriptionstring · nullableRequired

Optional description of the template's purpose.

ses_use_case_idstring · uuidRequired

Email use case that owns this template.

subject_templatestringRequired

Jinja template for the email subject.

body_templatestringRequired

Jinja template for the email body.

required_subject_variablesstring[]Required

Variables the caller must provide for the subject.

required_body_variablesstring[]Required

Variables the caller must provide for the body.

created_atstring · date-timeRequired

When the template was created.

updated_atstring · date-timeRequired

When the template was last changed.

get/v1/email/template/{email_template_id}
GET /v1/email/template/{email_template_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "text",
  "description": "text",
  "ses_use_case_id": "123e4567-e89b-12d3-a456-426614174000",
  "subject_template": "text",
  "body_template": "text",
  "required_subject_variables": [
    "text"
  ],
  "required_body_variables": [
    "text"
  ],
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}

Update Email Template

put

Patch an email template's name, description, or subject/body.

Requires the email:template:write OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
email_template_idstring · uuidRequired
Body
namestring · min: 1 · max: 64Optional

Replacement name when provided.

Pattern: ^[A-Za-z0-9 _-]+$
descriptionstring · min: 1 · max: 4096 · nullableOptional

Replacement description; null clears it.

subject_templatestring · min: 1 · max: 256Optional

Replacement Jinja subject template.

body_templatestring · min: 1 · max: 1000000Optional

Replacement Jinja body template.

Responses
200

Successful Response

application/json
idstring · uuidRequired

Identifier of the template.

namestringRequired

Name of the template.

descriptionstring · nullableRequired

Optional description of the template's purpose.

ses_use_case_idstring · uuidRequired

Email use case that owns this template.

subject_templatestringRequired

Jinja template for the email subject.

body_templatestringRequired

Jinja template for the email body.

required_subject_variablesstring[]Required

Variables the caller must provide for the subject.

required_body_variablesstring[]Required

Variables the caller must provide for the body.

created_atstring · date-timeRequired

When the template was created.

updated_atstring · date-timeRequired

When the template was last changed.

put/v1/email/template/{email_template_id}
PUT /v1/email/template/{email_template_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 85

{
  "name": "text",
  "description": "text",
  "subject_template": "text",
  "body_template": "text"
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "text",
  "description": "text",
  "ses_use_case_id": "123e4567-e89b-12d3-a456-426614174000",
  "subject_template": "text",
  "body_template": "text",
  "required_subject_variables": [
    "text"
  ],
  "required_body_variables": [
    "text"
  ],
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}

Get Email Unsubscribe Form

get

Render the unsubscribe confirmation page.

Verifies the token but writes nothing — the form POSTs back to record the unsubscribe, so a scanner pre-fetching the link can't opt anyone out. 403 on a forged token.

Path parameters
tokenstringRequired
Responses
200

Confirmation form (HTML). GET never mutates.

application/json
anyOptional
get/v1/email/unsubscribe/{token}
GET /v1/email/unsubscribe/{token} HTTP/1.1
Accept: */*

No content

Confirm Email Unsubscribe

post

Record an unsubscribe from the RFC 8058 one-click handshake or the confirmation form.

Idempotent: repeat clicks collapse to one row. A tombstoned target is a silent success page, not an error. Returns 403 on a forged token before any lookup.

Path parameters
tokenstringRequired
Responses
200

Unsubscribe recorded (or silently skipped for tombstoned target).

application/json
anyOptional
post/v1/email/unsubscribe/{token}
POST /v1/email/unsubscribe/{token} HTTP/1.1
Accept: */*

No content

Get Email

get

Fetch one email by id, inbound or outbound.

Requires the email:read OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
email_idstring · uuidRequired
Responses
200

Successful Response

application/json
or
get/v1/email/{email_id}
GET /v1/email/{email_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "direction": "text",
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "ses_use_case_id": "123e4567-e89b-12d3-a456-426614174000",
  "setup_id": "123e4567-e89b-12d3-a456-426614174000",
  "from_address": "text",
  "to_address": "text",
  "subject": "text",
  "received_at": "2026-01-01T00:00:00.000Z",
  "created_at": "2026-01-01T00:00:00.000Z",
  "in_reply_to_email_id": "123e4567-e89b-12d3-a456-426614174000",
  "attachment_filenames": [
    "text"
  ],
  "body_kind": "html"
}

Get Email Attachment

get

Redirect to a presigned URL for one email attachment.

The filename must be listed on the row, so a caller can't sign a URL for an arbitrary key under the email's S3 prefix. 404 if the email or filename is unknown.

Requires the email:read OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
email_idstring · uuidRequired
filenamestringRequired
Responses
200

Successful Response

application/json
anyOptional
get/v1/email/{email_id}/attachment/{filename}
GET /v1/email/{email_id}/attachment/{filename} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Get Email Body

get

Return an inbound or outbound email's body.

The response is HTML or plain text, according to the email's body format.

Requires the email:read OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
email_idstring · uuidRequired
Responses
200

Successful Response

application/json
anyOptional
get/v1/email/{email_id}/body
GET /v1/email/{email_id}/body HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Get Email Raw

get

Redirect to a download URL for an inbound email's original MIME message.

Outbound emails return 404. Requires the email:read scope on the setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
email_idstring · uuidRequired
Responses
200

Successful Response

application/json
anyOptional
get/v1/email/{email_id}/raw
GET /v1/email/{email_id}/raw HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

List iMessages

get

List inbound + outbound iMessages, interleaved chronologically. At least one of use_case_id, peer_number, or our_number is required so the query stays on a leading index per leg. Optional direction=inbound|outbound prunes one leg. Sort via repeated sort_by query params; each entry is +field or -field (allowed field: occurred_at, the UNION-projected column that maps to sent_at on outbound and received_at on inbound). Default: -occurred_at. Cursor opaque — round-trip continuation_token unchanged with the same sort_by.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
setup_idstring · uuidRequired

SendBlue setup whose messages are listed.

use_case_idstring · uuid · nullableOptional

Filter to one top-level use case.

peer_numberstring · phone · nullableOptional

E.164 peer; matches inbound from_number and outbound to_number.

our_numberstring · phone · nullableOptional

E.164 line of ours; matches inbound to_number and outbound from_number.

directionstring · enum · nullableOptional

Restrict to one direction. None returns both, interleaved.

Possible values:
sort_bystring[]Optional

Sort axes applied left-to-right; +occurred_at / -occurred_at. Default -occurred_at.

Default: []
limitinteger · max: 100Optional

Maximum number of messages to return per page.

Default: 50
continuation_tokenanyOptional

Opaque continuation token from a prior response; the server decodes it.

Responses
200

Successful Response

application/json
has_morebooleanRequired

Whether another page of messages is available.

continuation_tokenanyOptional

Opaque token to pass back on the next page request. Null when there are no more results.

get/v1/imessage
GET /v1/imessage?setup_id=123e4567-e89b-12d3-a456-426614174000 HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "items": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "use_case_id": "123e4567-e89b-12d3-a456-426614174000",
      "from_number": "text",
      "to_number": "text",
      "content": "text",
      "has_media": true,
      "service": "iMessage",
      "occurred_at": "2026-01-01T00:00:00.000Z",
      "direction": "inbound"
    }
  ],
  "has_more": true,
  "continuation_token": null
}

Send Imessage

post

Send text or one media attachment through an iMessage use case.

Before the recipient replies, send at most six text-only messages per line, each up to 300 characters and without links or contact details. Opted-out recipients cannot be messaged. Requires the imessage:send scope on the setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
use_case_idstring · uuidRequired
to_numberstring · phoneRequired
contentstring · max: 18996OptionalDefault: ""
mediastring · nullableOptional
Responses
201

Successful Response

application/json

A sent iMessage with its delivery outcome.

idstring · uuidRequired

Message identifier.

use_case_idstring · uuidRequired

Use case associated with the message.

from_numberstringRequired

Sender's E.164 phone number.

to_numberstringRequired

Recipient's E.164 phone number.

contentstringRequired

Text content. Empty string for media-only messages.

has_mediabooleanRequired

Whether the message has media available at GET /v1/imessage/{id}/media.

servicestring · enum · nullableRequired

Messaging service used, if known.

Possible values:
occurred_atstring · date-timeRequired

When sending was requested or the inbound message was received.

directionconst: outboundOptional

Message direction; always outbound.

Default: outbound
delivered_atstring · date-time · nullableRequired

When the provider reported the message sent or delivered, if available.

errored_atstring · date-time · nullableRequired

When delivery failure was reported, if any.

error_messagestring · nullableRequired

Provider's failure description, if any.

was_downgradedboolean · nullableRequired

Whether the message was sent as SMS instead, if known.

sent_atstring · date-time · nullableRequired

When the provider sent the message, if available.

post/v1/imessage/
POST /v1/imessage/ HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: multipart/form-data
Accept: */*
Content-Length: 101

{
  "use_case_id": "123e4567-e89b-12d3-a456-426614174000",
  "to_number": "text",
  "content": "",
  "media": "text"
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "use_case_id": "123e4567-e89b-12d3-a456-426614174000",
  "from_number": "text",
  "to_number": "text",
  "content": "text",
  "has_media": true,
  "service": "iMessage",
  "occurred_at": "2026-01-01T00:00:00.000Z",
  "direction": "outbound",
  "delivered_at": "2026-01-01T00:00:00.000Z",
  "errored_at": "2026-01-01T00:00:00.000Z",
  "error_message": "text",
  "was_downgraded": true,
  "sent_at": "2026-01-01T00:00:00.000Z"
}

Get Message

get

Fetch one iMessage by id, inbound or outbound.

Requires the imessage:read OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
message_idstring · uuidRequired
Responses
200

Successful Response

application/json
or
get/v1/imessage/{message_id}
GET /v1/imessage/{message_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "use_case_id": "123e4567-e89b-12d3-a456-426614174000",
  "from_number": "text",
  "to_number": "text",
  "content": "text",
  "has_media": true,
  "service": "iMessage",
  "occurred_at": "2026-01-01T00:00:00.000Z",
  "direction": "inbound"
}

Get Message Media

get

Redirect to a download URL for an iMessage attachment.

Return 404 when the message has no attachment. Requires the imessage:read scope on the setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
message_idstring · uuidRequired
Responses
200

Successful Response

application/json
anyOptional
get/v1/imessage/{message_id}/media
GET /v1/imessage/{message_id}/media HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Create Oauth2 Client

post

Create an OAuth2 client and return its ID and secret.

The secret is shown only in this response. Requires the clients:admin scope.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
namestring · min: 1 · max: 64Required

Display name for the client.

Pattern: ^[A-Za-z0-9 _-]+$
descriptionstring · min: 1 · max: 256Required

Human-readable purpose of the client.

granted_scopesstring[] · min: 1Required

Scopes the client may request; wildcard patterns are allowed.

allowed_setup_idsany of · min: 1Required

Setup IDs the client may access, or * for all setups.

string · uuid[]Optional
or
array · min: 1 · max: 1Optional
Responses
201

Successful Response

application/json
client_idstring · uuidRequired

Identifier to use when requesting tokens.

client_secretstringRequired

The raw secret — returned ONCE here and never again. Store it now.

namestringRequired

Display name of the client.

descriptionstringRequired

Human-readable purpose of the client.

granted_scopesstring[]Required

Scopes the client may request.

allowed_setup_idsstring[]Required

Setup IDs the client may access, or * for all setups.

post/v1/oauth/client
POST /v1/oauth/client HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 123

{
  "name": "text",
  "description": "text",
  "granted_scopes": [
    "text"
  ],
  "allowed_setup_ids": [
    "123e4567-e89b-12d3-a456-426614174000"
  ]
}
{
  "client_id": "123e4567-e89b-12d3-a456-426614174000",
  "client_secret": "text",
  "name": "text",
  "description": "text",
  "granted_scopes": [
    "text"
  ],
  "allowed_setup_ids": [
    "text"
  ]
}

Delete Oauth2 Client

delete

Revoke an OAuth2 client (tombstone for audit); it can no longer obtain tokens.

Requires the clients:admin OAuth2 scope (resource-less; exact-name grant only — not matched by a wildcard scope).

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
client_idstring · uuidRequired
Responses
204

Successful Response

No content

delete/v1/oauth/client/{client_id}
DELETE /v1/oauth/client/{client_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Update Oauth2 Client

put

Patch an OAuth2 client's grants. The secret is never changed here — rotate it instead.

Requires the clients:admin OAuth2 scope (resource-less; exact-name grant only — not matched by a wildcard scope).

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
client_idstring · uuidRequired
Body
namestring · min: 1 · max: 64Optional

New display name when provided.

Pattern: ^[A-Za-z0-9 _-]+$
descriptionstring · min: 1 · max: 256Optional

New human-readable purpose when provided.

granted_scopesstring[] · min: 1Optional

Replacement scopes; wildcard patterns are allowed.

allowed_setup_idsany of · min: 1Optional

Replacement setup IDs, or * for all setups.

string · uuid[]Optional
or
array · min: 1 · max: 1Optional
Responses
200

Successful Response

application/json
client_idstring · uuidRequired

Identifier of the updated client.

namestringRequired

Display name of the client.

descriptionstringRequired

Human-readable purpose of the client.

granted_scopesstring[]Required

Scopes the client may request.

allowed_setup_idsstring[]Required

Setup IDs the client may access, or * for all setups.

put/v1/oauth/client/{client_id}
PUT /v1/oauth/client/{client_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 123

{
  "name": "text",
  "description": "text",
  "granted_scopes": [
    "text"
  ],
  "allowed_setup_ids": [
    "123e4567-e89b-12d3-a456-426614174000"
  ]
}
{
  "client_id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "text",
  "description": "text",
  "granted_scopes": [
    "text"
  ],
  "allowed_setup_ids": [
    "text"
  ]
}

Rotate Oauth2 Client Secret

post

Replace an OAuth2 client's secret and return the replacement once.

The previous secret stops working immediately. Requires the clients:admin scope.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
client_idstring · uuidRequired
Responses
200

Successful Response

application/json
client_secretstringRequired

The new raw secret — returned ONCE here and never again. Store it now.

post/v1/oauth/client/{client_id}/rotate-secret
POST /v1/oauth/client/{client_id}/rotate-secret HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "client_secret": "text"
}

Get Token

post

Exchange client credentials for a 1-hour access token (client_credentials grant).

Authenticate via HTTP Basic or client credentials in the form body. The token includes only scopes granted to the client; no refresh token is issued.

Authorizations
AuthorizationstringRequired
Body
grant_typeconst: client_credentialsRequired

OAuth2 grant type; must be client_credentials.

scopestringRequired

Space-delimited requested scopes (RFC 6749 §3.3); down-scoped to the grant.

client_idstring · nullableOptional

Client identifier when authenticating through form fields.

client_secretstring · nullableOptional

Client secret when authenticating through form fields.

Responses
200

Successful Response

application/json
access_tokenstringRequired

Bearer token for authenticated API requests.

token_typeconst: bearerRequired

Token scheme; always bearer.

expires_inintegerRequired

Number of seconds until the token expires.

scopestringRequired

Space-delimited scopes granted to this token.

post/v1/oauth/token
POST /v1/oauth/token HTTP/1.1
Authorization: Basic username:password
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 78

"grant_type='text'&scope='text'&client_id='text'&client_secret='text'"
{
  "access_token": "text",
  "token_type": "text",
  "expires_in": 1,
  "scope": "text"
}

Select Phone Number

post

Pick a random From number from an outbound-voice use case's pool.

Requires the outbound-voice:send OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
use_case_idstring · uuidRequired

Top-level use case to pick a sender for; must be outbound_voice.

Responses
200

Successful Response

application/json
idstringRequired

Identifier of this phone number.

setup_idstringRequired

Twilio setup that owns this phone number.

use_case_idsstring[]Required

Voice and SMS use cases assigned to this number; empty when unassigned.

phone_numberstringRequired

E.164 phone number.

countrystringRequired

ISO 3166-1 alpha-2 country code.

number_typestring · enumRequired

Phone number type — local, mobile, toll-free, or national.

Possible values:
created_atstring · date-timeRequired

When this phone number was created.

post/v1/outbound-voice/phone-number/select
POST /v1/outbound-voice/phone-number/select HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 54

{
  "use_case_id": "123e4567-e89b-12d3-a456-426614174000"
}
{
  "id": "text",
  "setup_id": "text",
  "use_case_ids": [
    "text"
  ],
  "phone_number": "text",
  "country": "text",
  "number_type": "local",
  "capabilities": [
    "voice"
  ],
  "created_at": "2026-01-01T00:00:00.000Z"
}

Create Sendblue Setup

post

Create a SendBlue subaccount with one synchronously-assigned line and register webhooks.

503 when SendBlue has no area-code inventory: it would leak an unusable subaccount that has no teardown API.

Requires the sendblue-setup:create OAuth2 scope (resource-less — satisfied only by a first-party "*" setup grant).

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body

Request body for POST /v1/sendblue-setup.

friendly_namestring · min: 1 · max: 256Required

Operator-facing label for this subaccount.

company_namestring · min: 1 · max: 256Required

Name passed to SendBlue when creating the child account. SendBlue auto-prefixes the parent-account email at creation time, so the value we read back on subaccount_company_name is <parent-email>-<name>.

Responses
201

Successful Response

application/json

A SendBlue subaccount setup.

idstringRequired

Identifier of this SendBlue setup.

friendly_namestringRequired

Operator-facing label.

created_atstring · date-timeRequired

When this SendBlue setup was created.

updated_atstring · date-timeRequired

When this SendBlue setup was last changed.

post/v1/sendblue-setup
POST /v1/sendblue-setup HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 46

{
  "friendly_name": "text",
  "company_name": "text"
}
{
  "id": "text",
  "friendly_name": "text",
  "phone_numbers": [
    {
      "id": "text",
      "phone_number": "text",
      "blocked_at": "2026-01-01T00:00:00.000Z",
      "created_at": "2026-01-01T00:00:00.000Z",
      "updated_at": "2026-01-01T00:00:00.000Z"
    }
  ],
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}

Get Sendblue Setup

get

Fetch one SendBlue setup with its sendable (unblocked) lines.

Requires the sendblue-setup:read OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
setup_idstring · uuidRequired
Responses
200

Successful Response

application/json

A SendBlue subaccount setup.

idstringRequired

Identifier of this SendBlue setup.

friendly_namestringRequired

Operator-facing label.

created_atstring · date-timeRequired

When this SendBlue setup was created.

updated_atstring · date-timeRequired

When this SendBlue setup was last changed.

get/v1/sendblue-setup/{setup_id}
GET /v1/sendblue-setup/{setup_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": "text",
  "friendly_name": "text",
  "phone_numbers": [
    {
      "id": "text",
      "phone_number": "text",
      "blocked_at": "2026-01-01T00:00:00.000Z",
      "created_at": "2026-01-01T00:00:00.000Z",
      "updated_at": "2026-01-01T00:00:00.000Z"
    }
  ],
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}

List Sendblue Phone Numbers

get

List a SendBlue setup's phone lines, including blocked lines.

Optionally filter by status. Requires the sendblue-phone-number:read scope on the setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
setup_idstring · uuidRequired
Query parameters
Responses
200

Successful Response

application/json

Every line under the setup matching the requested status filter.

get/v1/sendblue-setup/{setup_id}/phone-number
GET /v1/sendblue-setup/{setup_id}/phone-number HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "items": [
    {
      "id": "text",
      "phone_number": "text",
      "blocked_at": "2026-01-01T00:00:00.000Z",
      "created_at": "2026-01-01T00:00:00.000Z",
      "updated_at": "2026-01-01T00:00:00.000Z"
    }
  ]
}

Unassign Phone Number

delete

Unassign a SendBlue line from an iMessage use case.

Requires the sendblue-phone-number:write OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
setup_idstring · uuidRequired
phone_number_idstring · uuidRequired
use_case_idstring · uuidRequired
Responses
204

Successful Response

No content

delete/v1/sendblue-setup/{setup_id}/phone-number/{phone_number_id}/use-case/{use_case_id}
DELETE /v1/sendblue-setup/{setup_id}/phone-number/{phone_number_id}/use-case/{use_case_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Assign Phone Number

put

Assign a SendBlue line to an iMessage use case.

A line serves at most one use case. 404 if the use case has no SendBlue binding or belongs to a different setup.

Requires the sendblue-phone-number:write OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
setup_idstring · uuidRequired
phone_number_idstring · uuidRequired
use_case_idstring · uuidRequired
Responses
204

Successful Response

No content

put/v1/sendblue-setup/{setup_id}/phone-number/{phone_number_id}/use-case/{use_case_id}
PUT /v1/sendblue-setup/{setup_id}/phone-number/{phone_number_id}/use-case/{use_case_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Create Ses Setup

post

Create a SES setup: tenant, domain identity, and custom MAIL FROM.

The customer publishes the returned DNS records, then refreshes verification via GET. 409 on a domain that already has a setup.

Requires the ses-setup:create OAuth2 scope (resource-less — satisfied only by a first-party "*" setup grant).

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
tenant_namestring · min: 1 · max: 64Required

SES tenant name, unique within the AWS account.

Pattern: ^[A-Za-z0-9_-]+$
domain_identitystringRequired

Domain for sending and receiving; normalized to lowercase IDNA.

Responses
201

Successful Response

application/json

Response for POST /v1/ses-setup and GET /v1/ses-setup/{id}. On a tombstoned setup deleted_at is set and dns_records[].verified reflects the last cached state, not live SES.

idstringRequired

Identifier of this SES setup.

domain_identitystringRequired

Email domain configured for this setup.

dns_checked_atstring · date-time · nullableRequired

Wall-clock time of the last refresh, or null if never checked.

created_atstring · date-timeRequired

When this SES setup was created.

updated_atstring · date-timeRequired

When this SES setup was last changed.

deleted_atstring · date-time · nullableOptional

When the setup was deleted, if applicable; DNS results are then last-known values.

post/v1/ses-setup
POST /v1/ses-setup HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 47

{
  "tenant_name": "text",
  "domain_identity": "text"
}
{
  "id": "text",
  "domain_identity": "text",
  "dns_checked_at": "2026-01-01T00:00:00.000Z",
  "dns_records": [
    {
      "address": "text",
      "record": "text",
      "type": "CNAME",
      "verified": true
    }
  ],
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z",
  "deleted_at": "2026-01-01T00:00:00.000Z"
}

Delete Ses Setup

delete

Delete an SES setup and its email domain configuration.

Active use cases must be deleted first. Requires the ses-setup:write scope on the setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
setup_idstring · uuidRequired
Responses
204

Successful Response

No content

delete/v1/ses-setup/{setup_id}
DELETE /v1/ses-setup/{setup_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Get Ses Setup

get

Fetch a SES setup with a live DNS refresh that self-heals a FAILED DKIM / MAIL FROM axis (see module docstring). Tombstoned setups return cached state.

Requires the ses-setup:read OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
setup_idstring · uuidRequired
Responses
200

Successful Response

application/json

Response for POST /v1/ses-setup and GET /v1/ses-setup/{id}. On a tombstoned setup deleted_at is set and dns_records[].verified reflects the last cached state, not live SES.

idstringRequired

Identifier of this SES setup.

domain_identitystringRequired

Email domain configured for this setup.

dns_checked_atstring · date-time · nullableRequired

Wall-clock time of the last refresh, or null if never checked.

created_atstring · date-timeRequired

When this SES setup was created.

updated_atstring · date-timeRequired

When this SES setup was last changed.

deleted_atstring · date-time · nullableOptional

When the setup was deleted, if applicable; DNS results are then last-known values.

get/v1/ses-setup/{setup_id}
GET /v1/ses-setup/{setup_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": "text",
  "domain_identity": "text",
  "dns_checked_at": "2026-01-01T00:00:00.000Z",
  "dns_records": [
    {
      "address": "text",
      "record": "text",
      "type": "CNAME",
      "verified": true
    }
  ],
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z",
  "deleted_at": "2026-01-01T00:00:00.000Z"
}

List SMS messages

get

List inbound + outbound SMS messages, interleaved chronologically. At least one of use_case_id or peer_phone_number is required so the query stays on a leading index per leg. Optional direction=inbound|outbound prunes one leg. Sort via repeated sort_by query params; each entry is +field or -field (allowed field: created_at). Default: -created_at. Cursor opaque — round-trip continuation_token unchanged with the same sort_by.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
setup_idstring · uuidRequired

Twilio setup whose messages are listed.

use_case_idstring · uuid · nullableOptional

Restrict results to one SMS use case.

directionstring · enum · nullableOptional

Filter by inbound or outbound direction.

Possible values:
peer_phone_numberstring · phone · nullableOptional

Filter by recipient on outbound or sender on inbound messages.

is_mmsboolean · nullableOptional

Filter to MMS when true or text-only SMS when false.

created_beforestring · date-time · nullableOptional

Exclusive upper bound on message creation time.

created_afterstring · date-time · nullableOptional

Inclusive lower bound on message creation time.

sort_bystring[]Optional

Sort axes, applied left-to-right. +field ascending, -field descending. Defaults to [("created_at", -1)] (newest first).

Default: []
limitinteger · max: 200Optional

The maximum number of SMS messages to return.

Default: 50
continuation_tokenanyOptional

Opaque continuation token from a prior response. Treat as a black box — the server decodes it.

Responses
200

Successful Response

application/json
has_morebooleanRequired

Whether another page of results is available.

continuation_tokenanyRequired

Opaque token for the next page, or null when complete.

get/v1/sms
GET /v1/sms?setup_id=123e4567-e89b-12d3-a456-426614174000 HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "items": [
    {
      "direction": "outbound",
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "use_case_id": "123e4567-e89b-12d3-a456-426614174000",
      "from_number": "text",
      "to_number": "text",
      "body": "text",
      "num_segments": 1,
      "status": "pending",
      "num_attachments": 1,
      "handed_off_at": "2026-01-01T00:00:00.000Z",
      "delivered_at": "2026-01-01T00:00:00.000Z",
      "errored_at": "2026-01-01T00:00:00.000Z",
      "created_at": "2026-01-01T00:00:00.000Z",
      "updated_at": "2026-01-01T00:00:00.000Z"
    }
  ],
  "has_more": true,
  "continuation_token": null
}

Send Sms Message

post

Send an SMS or MMS from one of the use case's numbers.

A2P and toll-free senders only reach recipients who've opted in, and never anyone who's opted out.

Requires the sms:send OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
use_case_idstring · uuidRequired
to_phone_numberstring · phoneRequired
messagestring · min: 1 · max: 1600 · nullableOptional
media_attachmentsstring[] · max: 10OptionalDefault: []
Responses
201

Successful Response

application/json
idstring · uuidRequired

Identifier of the sent message.

use_case_idstring · uuidRequired

SMS use case used to send this message.

from_numberstring · nullableRequired

Sender number, once the sending line is known.

to_numberstringRequired

Recipient phone number.

bodystring · nullableRequired

Text content, or null for a media-only MMS.

num_segmentsinteger · nullableRequired

Number of segments the message was split into; null until the message is sent.

statusstring · enumRequired

Current delivery status.

Possible values:
attachment_namesstring[]Required

Names of the message's MMS attachments.

handed_off_atstring · date-time · nullableRequired

When the message was handed off to the carrier, if it has been.

delivered_atstring · date-time · nullableRequired

When delivery was confirmed, if available.

errored_atstring · date-time · nullableRequired

When a send or delivery failure was reported, if any.

created_atstring · date-timeRequired

When this SMS or MMS message was created.

updated_atstring · date-timeRequired

When this SMS or MMS message was last changed.

post/v1/sms/
POST /v1/sms/ HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: multipart/form-data
Accept: */*
Content-Length: 125

{
  "use_case_id": "123e4567-e89b-12d3-a456-426614174000",
  "to_phone_number": "text",
  "message": "text",
  "media_attachments": [
    "text"
  ]
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "use_case_id": "123e4567-e89b-12d3-a456-426614174000",
  "from_number": "text",
  "to_number": "text",
  "body": "text",
  "num_segments": 1,
  "status": "pending",
  "attachment_names": [
    "text"
  ],
  "handed_off_at": "2026-01-01T00:00:00.000Z",
  "delivered_at": "2026-01-01T00:00:00.000Z",
  "errored_at": "2026-01-01T00:00:00.000Z",
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}

Send Sms Opt In Message

post

Send the registered consent message and record the recipient's opt-in.

Requires a verified A2P campaign or approved toll-free verification. Repeated sends to the same recipient have no additional effect; an active opt-out blocks the send. Requires the sms:consent:write scope on the setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
use_case_idstring · uuidRequired

SMS use case whose consent message is sent.

to_phone_numberstring · phoneRequired

Recipient's E.164 phone number.

Responses
201

Successful Response

application/json
anyOptional
post/v1/sms/opt-in
POST /v1/sms/opt-in HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 79

{
  "use_case_id": "123e4567-e89b-12d3-a456-426614174000",
  "to_phone_number": "text"
}

No content

List SMS setup opt-outs

get

List setup-wide SMS opt-outs (STOP records) for the setup given by the required setup_id query parameter. Live rows only by default; pass include_deleted=true for the cleared/audit history. Optional user_phone_number exact-match filter. Sort via repeated sort_by query params; each entry is +field or -field (allowed field: created_at). Default: -created_at. Cursor opaque — round-trip continuation_token unchanged with the same sort_by.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
setup_idstring · uuidRequired

Twilio setup whose opt-outs are listed.

user_phone_numberstring · phone · nullableOptional

Optional exact-match filter — the opted-out recipient's E.164 number.

include_deletedbooleanOptional

Include cleared (soft-deleted) opt-outs. Default False → live rows only.

Default: false
sort_bystring[]Optional

Sort axes, applied left-to-right. +field ascending, -field descending. Defaults to [("created_at", -1)] (newest first).

Default: []
limitinteger · max: 200Optional

The maximum number of opt-outs to return.

Default: 50
continuation_tokenanyOptional

Opaque continuation token from a prior response. Treat as a black box — the server decodes it.

Responses
200

Successful Response

application/json
has_morebooleanRequired

Whether another page of results is available.

continuation_tokenanyRequired

Opaque token for the next page, or null when complete.

get/v1/sms/opt-out
GET /v1/sms/opt-out?setup_id=123e4567-e89b-12d3-a456-426614174000 HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "items": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "setup_id": "123e4567-e89b-12d3-a456-426614174000",
      "phone_number": "text",
      "opted_out_use_case_id": "123e4567-e89b-12d3-a456-426614174000",
      "opted_out_message_id": "123e4567-e89b-12d3-a456-426614174000",
      "created_at": "2026-01-01T00:00:00.000Z",
      "deleted_at": "2026-01-01T00:00:00.000Z",
      "delete_reason": "text"
    }
  ],
  "has_more": true,
  "continuation_token": null
}

Get Sms Message Attachment Publicly

get

Redirect to a presigned URL for the public MMS media Twilio fetches.

Unauthenticated: attachment_id is an unguessable capability hash, so there's no DB lookup and a forged id resolves to a 404 at S3. The public copy is ephemeral.

Path parameters
attachment_idstringRequired
Responses
200

Successful Response

application/json
anyOptional
get/v1/sms/public/{attachment_id}
GET /v1/sms/public/{attachment_id} HTTP/1.1
Accept: */*

No content

Remove Sms Setup Opt Out

post

Operator-clear a setup-wide SMS opt-out, recording the reason for audit.

The only way to re-enable sending after a STOP. 409 while a live toll-free opt-out for the recipient remains: route them through START/UNSTOP first.

Requires the sms:consent:write OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
setup_idstring · uuidRequired

Twilio setup whose opt-out is cleared.

user_phone_numberstring · phoneRequired

Opted-out recipient's E.164 phone number.

reasonstring · min: 1 · max: 2000Required

Required, non-empty: this is the audit record of why the STOP was reversed.

Responses
204

Opt-out cleared; the recipient can be sent to again on this setup.

No content

post/v1/sms/remove-setup-opt-out
POST /v1/sms/remove-setup-opt-out HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 94

{
  "setup_id": "123e4567-e89b-12d3-a456-426614174000",
  "user_phone_number": "text",
  "reason": "text"
}

No content

Get Sms Message

get

Fetch one SMS or MMS by id, inbound or outbound.

Requires the sms:read OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
message_idstring · uuidRequired
Responses
200

Successful Response

application/json
or
get/v1/sms/{message_id}
GET /v1/sms/{message_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "direction": "outbound",
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "use_case_id": "123e4567-e89b-12d3-a456-426614174000",
  "from_number": "text",
  "to_number": "text",
  "body": "text",
  "num_segments": 1,
  "status": "pending",
  "attachment_names": [
    "text"
  ],
  "handed_off_at": "2026-01-01T00:00:00.000Z",
  "delivered_at": "2026-01-01T00:00:00.000Z",
  "errored_at": "2026-01-01T00:00:00.000Z",
  "error_message": "text",
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}

Get Sms Message Attachment

get

Redirect to a presigned URL for one MMS attachment, the retained private copy.

The name must be listed on the row, so a caller can't sign a URL for an arbitrary key. 404 if the message or name is unknown.

Requires the sms:read OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
sms_idstring · uuidRequired
attachment_namestringRequired
Responses
200

Successful Response

application/json
anyOptional
get/v1/sms/{sms_id}/attachment/{attachment_name}
GET /v1/sms/{sms_id}/attachment/{attachment_name} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Create Twilio Setup

post

Create a Twilio setup: subaccount, customer profile, and Trust Hub entities, then submit for review.

All-or-nothing; a failure unwinds every Twilio resource. STIR/CNAM/regulatory bundles come later, once the profile is approved.

Requires the twilio-setup:create OAuth2 scope (resource-less — satisfied only by a first-party "*" setup grant).

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body

Request body for POST /v1/twilio-setup.

friendly_namestring · min: 1 · max: 256Required

Human label for this setup.

business_namestring · min: 1 · max: 256Required

Legal business name as registered.

business_typestring · enumRequired

Legal structure of the business.

Possible values:
business_industrystring · enumRequired

Industry vertical for Twilio Trust Hub classification.

Possible values:
business_identitystring · enumOptional

Relationship to Twilio (direct customer or ISV/reseller).

Default: direct_customerPossible values:
business_registration_identifierstring · enumRequired

Type of registration ID (e.g. EIN, DUNS, VAT).

Possible values:
business_registration_numberstring · min: 1 · max: 32Required

Registration number matching the identifier type.

business_regions_of_operationstring · enumRequired

Geographic region where the business operates.

Possible values:
website_urlstring · min: 1 · max: 2048Required

Business website URL.

Responses
201

Successful Response

application/json

Response for a single Twilio setup. Returned by create, get, update, and list.

idstringRequired

Identifier of this Twilio setup.

friendly_namestringRequired

Human-readable label for this Twilio setup.

created_atstring · date-timeRequired

When this Twilio setup was created.

updated_atstring · date-timeRequired

When this Twilio setup was last changed.

post/v1/twilio-setup
POST /v1/twilio-setup HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 573

{
  "friendly_name": "text",
  "business_name": "text",
  "business_type": "Sole Proprietorship",
  "business_industry": "AGRICULTURE",
  "business_identity": "direct_customer",
  "business_registration_identifier": "EIN",
  "business_registration_number": "text",
  "business_regions_of_operation": "AFRICA",
  "website_url": "text",
  "business_address": {
    "street": "text",
    "city": "text",
    "region": "text",
    "postal_code": "text",
    "iso_country": "text"
  },
  "authorized_representative": {
    "first_name": "text",
    "last_name": "text",
    "email": "name@gmail.com",
    "phone_number": "text",
    "business_title": "text",
    "job_position": "Director"
  }
}
{
  "id": "text",
  "friendly_name": "text",
  "customer_profile": {
    "status": "pending-review",
    "last_failure": [
      "text"
    ]
  },
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}

Get Twilio Setup Status

get

Fetch a Twilio setup's current review status from the database (advanced by webhooks).

Requires the twilio-setup:read OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
setup_idstring · uuidRequired
Responses
200

Successful Response

application/json

Response for a single Twilio setup. Returned by create, get, update, and list.

idstringRequired

Identifier of this Twilio setup.

friendly_namestringRequired

Human-readable label for this Twilio setup.

created_atstring · date-timeRequired

When this Twilio setup was created.

updated_atstring · date-timeRequired

When this Twilio setup was last changed.

get/v1/twilio-setup/{setup_id}
GET /v1/twilio-setup/{setup_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": "text",
  "friendly_name": "text",
  "customer_profile": {
    "status": "pending-review",
    "last_failure": [
      "text"
    ]
  },
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}

Update Twilio Setup

put

Update a rejected Twilio business profile and submit it again for review.

Profiles in other states return 409. Invalid business information returns 422. Requires the twilio-setup:write scope on the setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
setup_idstring · uuidRequired
Body

Request body for PUT /v1/twilio-setup/{id}.

business_namestring · min: 1 · max: 256Required

Legal business name as registered.

business_typestring · enumRequired

Legal structure of the business.

Possible values:
business_industrystring · enumRequired

Industry vertical for Twilio Trust Hub classification.

Possible values:
business_identitystring · enumOptional

Relationship to Twilio (direct customer or ISV/reseller).

Default: direct_customerPossible values:
business_registration_identifierstring · enumRequired

Type of registration ID (e.g. EIN, DUNS, VAT).

Possible values:
business_registration_numberstring · min: 1 · max: 32Required

Registration number matching the identifier type.

business_regions_of_operationstring · enumRequired

Geographic region where the business operates.

Possible values:
website_urlstring · min: 1 · max: 2048Required

Business website URL.

Responses
200

Successful Response

application/json

Response for a single Twilio setup. Returned by create, get, update, and list.

idstringRequired

Identifier of this Twilio setup.

friendly_namestringRequired

Human-readable label for this Twilio setup.

created_atstring · date-timeRequired

When this Twilio setup was created.

updated_atstring · date-timeRequired

When this Twilio setup was last changed.

put/v1/twilio-setup/{setup_id}
PUT /v1/twilio-setup/{setup_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 550

{
  "business_name": "text",
  "business_type": "Sole Proprietorship",
  "business_industry": "AGRICULTURE",
  "business_identity": "direct_customer",
  "business_registration_identifier": "EIN",
  "business_registration_number": "text",
  "business_regions_of_operation": "AFRICA",
  "website_url": "text",
  "business_address": {
    "street": "text",
    "city": "text",
    "region": "text",
    "postal_code": "text",
    "iso_country": "text"
  },
  "authorized_representative": {
    "first_name": "text",
    "last_name": "text",
    "email": "name@gmail.com",
    "phone_number": "text",
    "business_title": "text",
    "job_position": "Director"
  }
}
{
  "id": "text",
  "friendly_name": "text",
  "customer_profile": {
    "status": "pending-review",
    "last_failure": [
      "text"
    ]
  },
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}

List Twilio Setup Bundles

get

List a setup's Trust Hub and regulatory bundles.

Filter by bundle kind or by country and number type; these filters cannot be combined. The response includes only bundle categories the caller may read. Requires at least one of the compliance:voice:read, compliance:sms:read, or compliance:regulatory:read scopes on the setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
setup_idstring · uuidRequired
Query parameters
bundle_kindstring · enum · nullableOptional

Client-facing classification of a Twilio setup bundle, surfaced in place of the raw Twilio policy SID (a vendor identifier). Mirrors the read-scope split in list_twilio_setup_bundles: shaken_stir + cnam are voice, a2p_messaging_profile is sms, everything else is a Regulatory Compliance regulation.

Possible values:
iso_countrystring · nullableOptionalPattern: ^\w{2}$
number_typestring · enum · nullableOptionalPossible values:
Responses
200

Successful Response

application/json

Bundles matching the filter, with status + last_failure; empty when none created yet.

get/v1/twilio-setup/{setup_id}/bundle
GET /v1/twilio-setup/{setup_id}/bundle HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "items": [
    {
      "id": "text",
      "setup_id": "text",
      "bundle_kind": "shaken_stir",
      "status": "pending-review",
      "entities": [
        {
          "entity_kind": "end_user",
          "entity_type": "text",
          "attributes": {
            "ANY_ADDITIONAL_PROPERTY": "anything"
          }
        }
      ],
      "last_failure": [
        "text"
      ],
      "created_at": "2026-01-01T00:00:00.000Z",
      "updated_at": "2026-01-01T00:00:00.000Z"
    }
  ]
}

Get A2P Brand Registration

get

Read a setup's A2P 10DLC brand registration state. 404 if none.

A verified brand with an SMS use case also returns its available campaign categories.

Requires the compliance:sms:read OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
setup_idstring · uuidRequired
Responses
200

Successful Response

application/json

The status and available campaign categories of an A2P brand registration.

setup_idstringRequired

Twilio setup whose business is registered.

brand_typestring · enumRequired

A2P brand category selected for registration.

Possible values:
primary_vetting_statusstring · enumRequired

Identity vetting outcome.

Possible values:
secondary_vetting_statusstring · enumRequired

SEC / sanctions vetting outcome; always skipped for low-volume-standard brands.

Possible values:
resubmit_countintegerRequired

Number of brand resubmissions; Twilio permits at most three.

created_atstring · date-timeRequired

When this A2P brand registration was created.

updated_atstring · date-timeRequired

When this A2P brand registration was last changed.

get/v1/twilio-setup/{setup_id}/bundle/a2p-brand-registration
GET /v1/twilio-setup/{setup_id}/bundle/a2p-brand-registration HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "setup_id": "text",
  "brand_type": "standard",
  "primary_vetting_status": "pending",
  "secondary_vetting_status": "pending",
  "primary_vetting_errors": [
    {
      "registrationerrorcode": 1,
      "registrationerrordescription": "text"
    }
  ],
  "secondary_vetting_errors": [
    {
      "registrationerrorcode": 1,
      "registrationerrordescription": "text"
    }
  ],
  "resubmit_count": 1,
  "allowed_campaign_usecases": [
    {
      "code": "text",
      "name": "text",
      "description": "text",
      "post_approval_required": true
    }
  ],
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}

Submit A2P Brand Registration

post

Create or resubmit a setup's A2P 10DLC brand registration.

First call creates; a call against an unverified brand resubmits (Twilio caps resubmits at 3). Needs an approved customer profile and an A2P Messaging Profile bundle. 409 in any other brand state.

Requires the compliance:sms:write OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
setup_idstring · uuidRequired
Body

Request body for POST /v1/twilio-setup/{id}/bundle/a2p-brand-registration.

brand_typestring · enumRequired

Standard or Low-Volume Standard. Non-profit / government brands MUST be Standard (LVS → 422 here despite Twilio's silent acceptance).

Possible values:
Responses
200

Successful Response

application/json

The status and available campaign categories of an A2P brand registration.

setup_idstringRequired

Twilio setup whose business is registered.

brand_typestring · enumRequired

A2P brand category selected for registration.

Possible values:
primary_vetting_statusstring · enumRequired

Identity vetting outcome.

Possible values:
secondary_vetting_statusstring · enumRequired

SEC / sanctions vetting outcome; always skipped for low-volume-standard brands.

Possible values:
resubmit_countintegerRequired

Number of brand resubmissions; Twilio permits at most three.

created_atstring · date-timeRequired

When this A2P brand registration was created.

updated_atstring · date-timeRequired

When this A2P brand registration was last changed.

post/v1/twilio-setup/{setup_id}/bundle/a2p-brand-registration
POST /v1/twilio-setup/{setup_id}/bundle/a2p-brand-registration HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 25

{
  "brand_type": "standard"
}
{
  "setup_id": "text",
  "brand_type": "standard",
  "primary_vetting_status": "pending",
  "secondary_vetting_status": "pending",
  "primary_vetting_errors": [
    {
      "registrationerrorcode": 1,
      "registrationerrordescription": "text"
    }
  ],
  "secondary_vetting_errors": [
    {
      "registrationerrorcode": 1,
      "registrationerrordescription": "text"
    }
  ],
  "resubmit_count": 1,
  "allowed_campaign_usecases": [
    {
      "code": "text",
      "name": "text",
      "description": "text",
      "post_approval_required": true
    }
  ],
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}

Submit A2P Messaging Profile

post

Create or resubmit the A2P Messaging Profile bundle, the Trust Hub prerequisite for brand registration.

First call creates; a rejected bundle resubmits after a content change. Approved or in-review bundles are locked (409). Standard tier only.

Requires the compliance:sms:write OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
setup_idstring · uuidRequired
Body

Request body for POST /v1/twilio-setup/{id}/bundle/a2p-messaging-profile.

company_typestring · enumRequired

Legal structure of the brand.

Possible values:
stock_exchangestring · min: 1 · max: 64 · nullableOptional

Required when company_type == 'public', omitted otherwise. Bad values surface as a noncompliant evaluation, not a validation error.

stock_tickerstring · min: 1 · max: 16 · nullableOptional

Required when company_type == 'public'; must be omitted otherwise.

brand_contact_emailstring · emailRequired

Email TCR uses for brand correspondence.

Responses
200

Successful Response

application/json

Single Trust Hub trust product / regulatory bundle attached to a setup.

idstringRequired

Identifier of this bundle.

setup_idstringRequired

Twilio setup that owns this bundle.

bundle_kindstring · enumRequired

Which kind of bundle this is (shaken_stir, cnam, a2p_messaging_profile, or regulatory), derived from the underlying Twilio policy.

Possible values:
statusstring · enumRequired

Current verification status.

Possible values:
last_failurestring[] · nullableOptional

Human-readable failure strings from the latest noncompliant eval or webhook rejection. NULL when healthy.

created_atstring · date-timeRequired

When this bundle was created.

updated_atstring · date-timeRequired

When this bundle was last changed.

post/v1/twilio-setup/{setup_id}/bundle/a2p-messaging-profile
POST /v1/twilio-setup/{setup_id}/bundle/a2p-messaging-profile HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 111

{
  "company_type": "private",
  "stock_exchange": "text",
  "stock_ticker": "text",
  "brand_contact_email": "name@gmail.com"
}
{
  "id": "text",
  "setup_id": "text",
  "bundle_kind": "shaken_stir",
  "status": "pending-review",
  "entities": [
    {
      "entity_kind": "end_user",
      "entity_type": "text",
      "attributes": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      }
    }
  ],
  "last_failure": [
    "text"
  ],
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}

Submit Cnam

post

Create or resubmit the CNAM caller-ID-name bundle for US/CA outbound calls.

First call creates; a rejected bundle resubmits with a new display name. Approved or in-review bundles are locked (409).

Requires the compliance:voice:write OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
setup_idstring · uuidRequired
Body

Request body for POST /v1/twilio-setup/{id}/bundle/cnam.

display_namestring · min: 1 · max: 15Required

Caller ID name shown on the recipient's device (max 15 chars).

Responses
200

Successful Response

application/json

Single Trust Hub trust product / regulatory bundle attached to a setup.

idstringRequired

Identifier of this bundle.

setup_idstringRequired

Twilio setup that owns this bundle.

bundle_kindstring · enumRequired

Which kind of bundle this is (shaken_stir, cnam, a2p_messaging_profile, or regulatory), derived from the underlying Twilio policy.

Possible values:
statusstring · enumRequired

Current verification status.

Possible values:
last_failurestring[] · nullableOptional

Human-readable failure strings from the latest noncompliant eval or webhook rejection. NULL when healthy.

created_atstring · date-timeRequired

When this bundle was created.

updated_atstring · date-timeRequired

When this bundle was last changed.

post/v1/twilio-setup/{setup_id}/bundle/cnam
POST /v1/twilio-setup/{setup_id}/bundle/cnam HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 23

{
  "display_name": "text"
}
{
  "id": "text",
  "setup_id": "text",
  "bundle_kind": "shaken_stir",
  "status": "pending-review",
  "entities": [
    {
      "entity_kind": "end_user",
      "entity_type": "text",
      "attributes": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      }
    }
  ],
  "last_failure": [
    "text"
  ],
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}

Submit Regulatory Bundle

post

Submit or resubmit a regulatory bundle for Twilio review.

Requires an approved business profile. Provide the required business details and one JPEG, PNG, or PDF file per document (up to 5 MiB each). Only rejected bundles can be resubmitted. Requires the compliance:regulatory:write scope on the setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
setup_idstring · uuidRequired
Body
iso_countrystringRequiredPattern: ^\w{2}$
number_typestring · enumRequiredPossible values:
end_usersstringRequired
supporting_documentsstringRequired
filesstring[]OptionalDefault: []
Responses
200

Successful Response

application/json

Single Trust Hub trust product / regulatory bundle attached to a setup.

idstringRequired

Identifier of this bundle.

setup_idstringRequired

Twilio setup that owns this bundle.

bundle_kindstring · enumRequired

Which kind of bundle this is (shaken_stir, cnam, a2p_messaging_profile, or regulatory), derived from the underlying Twilio policy.

Possible values:
statusstring · enumRequired

Current verification status.

Possible values:
last_failurestring[] · nullableOptional

Human-readable failure strings from the latest noncompliant eval or webhook rejection. NULL when healthy.

created_atstring · date-timeRequired

When this bundle was created.

updated_atstring · date-timeRequired

When this bundle was last changed.

post/v1/twilio-setup/{setup_id}/bundle/regulatory
POST /v1/twilio-setup/{setup_id}/bundle/regulatory HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: multipart/form-data
Accept: */*
Content-Length: 110

{
  "iso_country": "text",
  "number_type": "local",
  "end_users": "text",
  "supporting_documents": "text",
  "files": [
    "text"
  ]
}
{
  "id": "text",
  "setup_id": "text",
  "bundle_kind": "shaken_stir",
  "status": "pending-review",
  "entities": [
    {
      "entity_kind": "end_user",
      "entity_type": "text",
      "attributes": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      }
    }
  ],
  "last_failure": [
    "text"
  ],
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}

Submit Shaken Stir

post

Submit the SHAKEN/STIR bundle for a setup, once.

No resubmit path: once a bundle row exists this 409s. Fix a rejected bundle by updating the customer profile, which re-triggers Twilio review.

Requires the compliance:voice:write OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
setup_idstring · uuidRequired
Responses
200

Successful Response

application/json

Single Trust Hub trust product / regulatory bundle attached to a setup.

idstringRequired

Identifier of this bundle.

setup_idstringRequired

Twilio setup that owns this bundle.

bundle_kindstring · enumRequired

Which kind of bundle this is (shaken_stir, cnam, a2p_messaging_profile, or regulatory), derived from the underlying Twilio policy.

Possible values:
statusstring · enumRequired

Current verification status.

Possible values:
last_failurestring[] · nullableOptional

Human-readable failure strings from the latest noncompliant eval or webhook rejection. NULL when healthy.

created_atstring · date-timeRequired

When this bundle was created.

updated_atstring · date-timeRequired

When this bundle was last changed.

post/v1/twilio-setup/{setup_id}/bundle/shaken-stir
POST /v1/twilio-setup/{setup_id}/bundle/shaken-stir HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": "text",
  "setup_id": "text",
  "bundle_kind": "shaken_stir",
  "status": "pending-review",
  "entities": [
    {
      "entity_kind": "end_user",
      "entity_type": "text",
      "attributes": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      }
    }
  ],
  "last_failure": [
    "text"
  ],
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}

List Phone Numbers

get

List a setup's provisioned phone numbers, optionally filtered by country or use case.

Pass use_case_id="unassigned" for numbers with no assignment.

Requires the twilio-phone-number:read OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
setup_idstring · uuidRequired
Query parameters
countrystring · nullableOptional

Filter by ISO 3166-1 alpha-2 country code

Pattern: ^\w{2}$
use_case_idany of · nullableOptional

Filter by top-level use case UUID, or the literal "unassigned" for numbers with no assignments.

string · uuidOptional
or
const: unassignedOptional
Responses
200

Successful Response

application/json
get/v1/twilio-setup/{setup_id}/phone-number
GET /v1/twilio-setup/{setup_id}/phone-number HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "items": [
    {
      "id": "text",
      "setup_id": "text",
      "use_case_ids": [
        "text"
      ],
      "phone_number": "text",
      "country": "text",
      "number_type": "local",
      "capabilities": [
        "voice"
      ],
      "created_at": "2026-01-01T00:00:00.000Z"
    }
  ]
}

Provision Phone Number

post

Purchase a phone number for a Twilio setup.

Required compliance bundles must be approved. An address-requirement mismatch returns 422. Requires the twilio-phone-number:write scope on the setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
setup_idstring · uuidRequired
Body
phone_numberstring · phoneRequired

E.164 phone number to purchase.

countrystringRequired

ISO 3166-1 alpha-2. Drives Trust Hub gating and the Regulatory Compliance lookup.

Pattern: ^\w{2}$
number_typestring · enumRequired

Phone number type. national reuses the .local subresource with a prefix filter (see NATIONAL_PREFIXES).

Possible values:
Responses
201

Successful Response

application/json
idstringRequired

Identifier of this phone number.

setup_idstringRequired

Twilio setup that owns this phone number.

use_case_idsstring[]Required

Voice and SMS use cases assigned to this number; empty when unassigned.

phone_numberstringRequired

E.164 phone number.

countrystringRequired

ISO 3166-1 alpha-2 country code.

number_typestring · enumRequired

Phone number type — local, mobile, toll-free, or national.

Possible values:
created_atstring · date-timeRequired

When this phone number was created.

post/v1/twilio-setup/{setup_id}/phone-number
POST /v1/twilio-setup/{setup_id}/phone-number HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 62

{
  "phone_number": "text",
  "country": "text",
  "number_type": "local"
}
{
  "id": "text",
  "setup_id": "text",
  "use_case_ids": [
    "text"
  ],
  "phone_number": "text",
  "country": "text",
  "number_type": "local",
  "capabilities": [
    "voice"
  ],
  "created_at": "2026-01-01T00:00:00.000Z"
}

List Available Phone Numbers

get

Search Twilio for purchasable phone numbers of a country and type.

Results are narrowed to numbers the setup can actually provision given its address. area_code applies only to local numbers (422 otherwise).

Requires the twilio-phone-number:read OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
setup_idstring · uuidRequired
Query parameters
countrystringRequired

ISO 3166-1 alpha-2 country code.

Pattern: ^\w{2}$
number_typestring · enumRequired

Phone number type: local, mobile, toll-free, or national.

Possible values:
area_codeinteger · nullableOptional

Area code filter. Only valid when number_type='local' (NANP concept).

limitinteger · min: 1 · max: 20Optional

Maximum results to return

Default: 10
Responses
200

Successful Response

application/json
get/v1/twilio-setup/{setup_id}/phone-number/available
GET /v1/twilio-setup/{setup_id}/phone-number/available?country=text&number_type=local HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "items": [
    {
      "phone_number": "text",
      "friendly_name": "text",
      "locality": "text",
      "region": "text",
      "postal_code": "text",
      "iso_country": "text"
    }
  ]
}

Delete Phone Number

delete

Release a phone number from a Twilio setup.

Unassign it from all use cases first. A toll-free verification under review also blocks release.

Requires the twilio-phone-number:write OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
setup_idstring · uuidRequired
phone_number_idstring · uuidRequired
Responses
204

Successful Response

No content

delete/v1/twilio-setup/{setup_id}/phone-number/{phone_number_id}
DELETE /v1/twilio-setup/{setup_id}/phone-number/{phone_number_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Get Tollfree Verification

get

Read a phone number's toll-free verification state. 404 if none.

Requires the compliance:sms:read OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
setup_idstring · uuidRequired
phone_number_idstring · uuidRequired
Responses
200

Successful Response

application/json

Toll-Free Verification attached to a phone number.

phone_number_idstringRequired

Toll-free number being verified.

statusstring · enumRequired

Current verification status; approved is terminal.

Possible values:
business_namestringRequired

Business name submitted for verification.

business_websitestringRequired

Business website submitted for verification.

business_typestring · enumRequired

Legal structure of the business.

Possible values:
business_registration_numberstring · nullableRequired

Business registration number; NULL only for SOLE_PROPRIETOR.

business_registration_authoritystring · enum · nullableRequired

Issuing authority; NULL for SOLE_PROPRIETOR.

Possible values:
business_registration_countrystring · nullableRequired

ISO 3166-1 alpha-2 country of registration; NULL for SOLE_PROPRIETOR.

use_case_summarystringRequired

Summary of how the toll-free number will be used.

production_message_samplestringRequired

Example message submitted for review.

opt_in_proof_filenamesstring[]Required

Uploaded opt-in proof image filenames; public URLs are derived server-side and not exposed here.

opt_in_typestring · enumRequired

Method recipients use to consent to messages.

Possible values:
opt_in_confirmation_messagestringRequired

SMS sent to confirm a recipient's opt-in.

message_volumestring · enumRequired

Expected monthly messaging volume.

Possible values:
additional_informationstring · nullableRequired

Additional information supplied to the reviewer, if any.

privacy_policy_urlstringRequired

Business's privacy policy URL.

terms_and_conditions_urlstringRequired

Business's terms and conditions URL.

age_gated_contentbooleanRequired

Whether the campaign carries age-gated content.

edit_allowedboolean · nullableRequired

Whether a rejected verification can be edited before resubmission; null otherwise.

created_atstring · date-timeRequired

When this toll-free verification was created.

updated_atstring · date-timeRequired

When this toll-free verification was last changed.

get/v1/twilio-setup/{setup_id}/phone-number/{phone_number_id}/tollfree-verification
GET /v1/twilio-setup/{setup_id}/phone-number/{phone_number_id}/tollfree-verification HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "phone_number_id": "text",
  "status": "pending-review",
  "business_name": "text",
  "business_website": "text",
  "business_type": "PRIVATE_PROFIT",
  "business_registration_number": "text",
  "business_registration_authority": "EIN",
  "business_registration_country": "text",
  "use_case_categories": [
    "TWO_FACTOR_AUTHENTICATION"
  ],
  "use_case_summary": "text",
  "production_message_sample": "text",
  "opt_in_proof_filenames": [
    "text"
  ],
  "opt_in_type": "VERBAL",
  "opt_in_confirmation_message": "text",
  "message_volume": "10",
  "additional_information": "text",
  "privacy_policy_url": "text",
  "terms_and_conditions_url": "text",
  "age_gated_content": true,
  "rejection_reasons": [
    {
      "code": 1,
      "description": "text"
    }
  ],
  "edit_allowed": true,
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}

Submit Tollfree Verification

post

Submit or resubmit verification for a US or Canadian toll-free number.

Provide opt-in proof images. Only a rejected verification can be resubmitted; one already under review returns 409. Requires the compliance:sms:write scope on the setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
setup_idstring · uuidRequired
phone_number_idstring · uuidRequired
Body
business_namestring · min: 1 · max: 256Required
business_websitestring · uri · min: 1 · max: 2083Required
use_case_summarystring · min: 1 · max: 4096Required
production_message_samplestring · min: 1 · max: 2048Required
opt_in_typestring · enumRequiredPossible values:
opt_in_confirmation_messagestring · min: 1 · max: 160Required
message_volumestring · enumRequiredPossible values:
business_typestring · enumRequiredPossible values:
terms_and_conditions_urlstring · uri · min: 1 · max: 2083Required
privacy_policy_urlstring · uri · min: 1 · max: 2083Required
age_gated_contentbooleanRequired
opt_in_proof_filesstring[]OptionalDefault: []
additional_informationstring · min: 1 · max: 4096 · nullableOptional
business_registration_numberstring · min: 1 · max: 64 · nullableOptional
business_registration_authoritystring · enum · nullableOptionalPossible values:
business_registration_countrystring · nullableOptionalPattern: ^\w{2}$
Responses
200

Successful Response

application/json

Toll-Free Verification attached to a phone number.

phone_number_idstringRequired

Toll-free number being verified.

statusstring · enumRequired

Current verification status; approved is terminal.

Possible values:
business_namestringRequired

Business name submitted for verification.

business_websitestringRequired

Business website submitted for verification.

business_typestring · enumRequired

Legal structure of the business.

Possible values:
business_registration_numberstring · nullableRequired

Business registration number; NULL only for SOLE_PROPRIETOR.

business_registration_authoritystring · enum · nullableRequired

Issuing authority; NULL for SOLE_PROPRIETOR.

Possible values:
business_registration_countrystring · nullableRequired

ISO 3166-1 alpha-2 country of registration; NULL for SOLE_PROPRIETOR.

use_case_summarystringRequired

Summary of how the toll-free number will be used.

production_message_samplestringRequired

Example message submitted for review.

opt_in_proof_filenamesstring[]Required

Uploaded opt-in proof image filenames; public URLs are derived server-side and not exposed here.

opt_in_typestring · enumRequired

Method recipients use to consent to messages.

Possible values:
opt_in_confirmation_messagestringRequired

SMS sent to confirm a recipient's opt-in.

message_volumestring · enumRequired

Expected monthly messaging volume.

Possible values:
additional_informationstring · nullableRequired

Additional information supplied to the reviewer, if any.

privacy_policy_urlstringRequired

Business's privacy policy URL.

terms_and_conditions_urlstringRequired

Business's terms and conditions URL.

age_gated_contentbooleanRequired

Whether the campaign carries age-gated content.

edit_allowedboolean · nullableRequired

Whether a rejected verification can be edited before resubmission; null otherwise.

created_atstring · date-timeRequired

When this toll-free verification was created.

updated_atstring · date-timeRequired

When this toll-free verification was last changed.

post/v1/twilio-setup/{setup_id}/phone-number/{phone_number_id}/tollfree-verification
POST /v1/twilio-setup/{setup_id}/phone-number/{phone_number_id}/tollfree-verification HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: multipart/form-data
Accept: */*
Content-Length: 589

{
  "business_name": "text",
  "business_website": "https://example.com",
  "use_case_categories": [
    "TWO_FACTOR_AUTHENTICATION"
  ],
  "use_case_summary": "text",
  "production_message_sample": "text",
  "opt_in_type": "VERBAL",
  "opt_in_confirmation_message": "text",
  "message_volume": "10",
  "business_type": "PRIVATE_PROFIT",
  "terms_and_conditions_url": "https://example.com",
  "privacy_policy_url": "https://example.com",
  "age_gated_content": true,
  "opt_in_proof_files": [
    "text"
  ],
  "additional_information": "text",
  "business_registration_number": "text",
  "business_registration_authority": "EIN",
  "business_registration_country": "text"
}
{
  "phone_number_id": "text",
  "status": "pending-review",
  "business_name": "text",
  "business_website": "text",
  "business_type": "PRIVATE_PROFIT",
  "business_registration_number": "text",
  "business_registration_authority": "EIN",
  "business_registration_country": "text",
  "use_case_categories": [
    "TWO_FACTOR_AUTHENTICATION"
  ],
  "use_case_summary": "text",
  "production_message_sample": "text",
  "opt_in_proof_filenames": [
    "text"
  ],
  "opt_in_type": "VERBAL",
  "opt_in_confirmation_message": "text",
  "message_volume": "10",
  "additional_information": "text",
  "privacy_policy_url": "text",
  "terms_and_conditions_url": "text",
  "age_gated_content": true,
  "rejection_reasons": [
    {
      "code": 1,
      "description": "text"
    }
  ],
  "edit_allowed": true,
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}

Get Tollfree Opt In Proof

get

Stream an uploaded opt-in proof image. Unauthenticated — Twilio's TFV reviewer fetches it.

Streams the bytes directly rather than redirecting, so the URL stays valid across a multi-day review window. 404 for any key the verification didn't write.

Path parameters
setup_idstring · uuidRequired
phone_number_idstring · uuidRequired
filenamestringRequired
Responses
200

The opt-in proof image bytes, streamed from S3 with stored Content-Type.

anyOptional
get/v1/twilio-setup/{setup_id}/phone-number/{phone_number_id}/tollfree-verification/opt-in-proof/{filename}
GET /v1/twilio-setup/{setup_id}/phone-number/{phone_number_id}/tollfree-verification/opt-in-proof/{filename} HTTP/1.1
Accept: */*

No content

Unassign Phone Number

delete

Unassign a phone number from a use case.

Inbound-voice unassignment clears the number's voice_url and fallback. SMS unassignment detaches it from the Messaging Service pool.

Requires the twilio-phone-number:write OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
setup_idstring · uuidRequired
phone_number_idstring · uuidRequired
use_case_idstring · uuidRequired
Responses
204

Successful Response

No content

delete/v1/twilio-setup/{setup_id}/phone-number/{phone_number_id}/use-case/{use_case_id}
DELETE /v1/twilio-setup/{setup_id}/phone-number/{phone_number_id}/use-case/{use_case_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Assign Phone Number

put

Assign a phone number to a use case (idempotent).

Inbound-voice assignment rewrites the number's voice_url and fallback. SMS assignment adds the number to the Messaging Service pool, gated by TFV approval (US/CA toll-free) or a verified A2P campaign (US long-code).

Requires the twilio-phone-number:write OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
setup_idstring · uuidRequired
phone_number_idstring · uuidRequired
use_case_idstring · uuidRequired
Responses
204

Successful Response

No content

put/v1/twilio-setup/{setup_id}/phone-number/{phone_number_id}/use-case/{use_case_id}
PUT /v1/twilio-setup/{setup_id}/phone-number/{phone_number_id}/use-case/{use_case_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Get Regulation

get

Return the business and document requirements for buying a phone number.

Select a country and number type. A combination with no requirements returns 404. Requires the compliance:regulatory:read scope on the setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
setup_idstring · uuidRequired
Query parameters
iso_countrystringRequiredPattern: ^\w{2}$
number_typestring · enumRequiredPossible values:
Responses
200

Successful Response

application/json

Twilio regulation + full requirements; walk requirements to assemble the POST /bundle/regulatory payload.

friendly_namestringRequired

Display name of the regulation.

iso_countrystringRequired

Country where the number can be purchased.

number_typestring · enumRequired

Type of phone number covered by the regulation.

Possible values:
end_user_typestringRequired

Always "business".

get/v1/twilio-setup/{setup_id}/regulation
GET /v1/twilio-setup/{setup_id}/regulation?iso_country=text&number_type=local HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "friendly_name": "text",
  "iso_country": "text",
  "number_type": "local",
  "end_user_type": "text",
  "requirements": {
    "end_user": [
      {
        "name": "text",
        "type": "text",
        "requirement_name": "text",
        "detailed_fields": [
          {
            "machine_name": "text",
            "friendly_name": "text",
            "description": "text",
            "value_type": "String"
          }
        ]
      }
    ],
    "supporting_document": [
      {
        "name": "text",
        "type": "text",
        "requirement_name": "text",
        "description": "text",
        "accepted_documents": [
          {
            "name": "text",
            "type": "text",
            "detailed_fields": [
              {
                "machine_name": "text",
                "friendly_name": "text",
                "description": "text",
                "value_type": "String"
              }
            ]
          }
        ]
      }
    ]
  }
}

Validate Twilio Webhook

post

Check a Twilio webhook signature for this setup.

Return valid: true or valid: false for the supplied URL, parameters, and signature. Requires the twilio-setup:verify-webhook scope on the setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
setup_idstring · uuidRequired
Body
callback_urlstringRequired

The exact URL Twilio signed, byte-for-byte — a mismatch fails validation.

signaturestringRequired

The inbound request's X-Twilio-Signature header value.

Responses
200

Successful Response

application/json
validbooleanRequired

Whether signature is valid for this setup's subaccount auth token.

post/v1/twilio-setup/{setup_id}/verify-webhook
POST /v1/twilio-setup/{setup_id}/verify-webhook HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 86

{
  "callback_url": "text",
  "params": {
    "ANY_ADDITIONAL_PROPERTY": "text"
  },
  "signature": "text"
}
{
  "valid": true
}

List Use Cases

get

List use cases for a setup.

Filter by entity, channel, or deletion state. Requires the use-case:read scope on the setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
setup_idstring · uuidRequired

Filter to use cases bound to this setup.

entity_namestring · max: 256 · nullableOptional

Filter to use cases belonging to this entity.

channelstring · enum · nullableOptional

Filter by channel.

Possible values:
include_deletedbooleanOptional

Include soft-deleted use cases (audit trail). Defaults to live only.

Default: false
Responses
200

Successful Response

application/json
get/v1/use-case
GET /v1/use-case?setup_id=123e4567-e89b-12d3-a456-426614174000 HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "items": [
    {
      "id": "text",
      "entity_name": "text",
      "name": "text",
      "description": "text",
      "environment": "staging",
      "region": "us-east-1",
      "created_at": "2026-01-01T00:00:00.000Z",
      "updated_at": "2026-01-01T00:00:00.000Z",
      "deleted_at": "2026-01-01T00:00:00.000Z",
      "channel": "text",
      "twilio_setup_id": "text",
      "inbound_voice_url": "text",
      "fallback_forwarding_number": "text",
      "webhook_url": "text",
      "allowed_forwarding_numbers": [
        "text"
      ],
      "hold_music_enabled": true,
      "phone_numbers": [
        "text"
      ]
    }
  ]
}

Create Use Case

post

Create a use case on a setup; the channel selects the body variant.

Mints the channel's backing resource: a Messaging Service for SMS, a SES configuration set for email. Voice needs none — channel-manager renders the media leg from the setup's shared TwiML App. Email requires a DNS-verified SES setup. Requires the use-case:write OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
or
or
or
or
or
Responses
201

Successful Response

application/json
or
or
or
or
or
post/v1/use-case
POST /v1/use-case HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 328

{
  "entity_name": "text",
  "name": "text",
  "description": "text",
  "environment": "staging",
  "region": "us-east-1",
  "channel": "text",
  "twilio_setup_id": "123e4567-e89b-12d3-a456-426614174000",
  "inbound_voice_url": "https://example.com",
  "fallback_forwarding_number": "text",
  "webhook_url": "https://example.com",
  "allowed_forwarding_numbers": [
    "text"
  ]
}
{
  "id": "text",
  "entity_name": "text",
  "name": "text",
  "description": "text",
  "environment": "staging",
  "region": "us-east-1",
  "created_at": "2026-01-01T00:00:00.000Z",
  "channel": "text",
  "twilio_setup_id": "text",
  "inbound_voice_url": "text",
  "fallback_forwarding_number": "text",
  "webhook_url": "text",
  "webhook_secret": "text",
  "allowed_forwarding_numbers": [
    "text"
  ]
}

Delete Use Case

delete

Soft-delete a use case and its channel binding, tearing down the backing vendor resource.

409 while phone numbers or lines are still assigned (unassign first), or while email templates still exist.

Requires the use-case:write OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
use_case_idstring · uuidRequired
Responses
204

Successful Response

No content

delete/v1/use-case/{use_case_id}
DELETE /v1/use-case/{use_case_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Get Use Case

get

Return an active use case with its channel-specific settings.

Deleted or unknown use cases return 404. Requires the use-case:read scope on the setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
use_case_idstring · uuidRequired
Responses
200

Successful Response

application/json
or
or
or
or
or
get/v1/use-case/{use_case_id}
GET /v1/use-case/{use_case_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": "text",
  "entity_name": "text",
  "name": "text",
  "description": "text",
  "environment": "staging",
  "region": "us-east-1",
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z",
  "deleted_at": "2026-01-01T00:00:00.000Z",
  "channel": "text",
  "twilio_setup_id": "text",
  "inbound_voice_url": "text",
  "fallback_forwarding_number": "text",
  "webhook_url": "text",
  "allowed_forwarding_numbers": [
    "text"
  ],
  "hold_music_enabled": true,
  "phone_numbers": [
    "text"
  ]
}

Update Use Case

put

Update a use case's editable settings.

The request channel must match the existing use case. Changes to an inbound voice URL apply to its assigned numbers; a changed webhook URL returns a new signing secret once. Requires the use-case:write scope on the setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
use_case_idstring · uuidRequired
Body
or
or
or
or
or
Responses
200

Successful Response

application/json
or
or
or
or
or
put/v1/use-case/{use_case_id}
PUT /v1/use-case/{use_case_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 191

{
  "description": "text",
  "channel": "text",
  "inbound_voice_url": "https://example.com",
  "fallback_forwarding_number": "text",
  "webhook_url": "https://example.com",
  "allowed_forwarding_numbers": [
    "text"
  ]
}
{
  "id": "text",
  "entity_name": "text",
  "name": "text",
  "description": "text",
  "environment": "staging",
  "region": "us-east-1",
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z",
  "channel": "text",
  "twilio_setup_id": "text",
  "inbound_voice_url": "text",
  "fallback_forwarding_number": "text",
  "webhook_url": "text",
  "webhook_secret": "text",
  "allowed_forwarding_numbers": [
    "text"
  ],
  "hold_music_enabled": true
}

Delete A2P Campaign

delete

Delete an SMS use case's A2P 10DLC campaign.

A campaign under review cannot be deleted; retry after review is complete.

Requires the compliance:sms:write OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
use_case_idstring · uuidRequired
Responses
204

Campaign deleted.

No content

delete/v1/use-case/{use_case_id}/a2p-campaign
DELETE /v1/use-case/{use_case_id}/a2p-campaign HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Get A2P Campaign

get

Read an SMS use case's A2P 10DLC campaign state. 404 if none.

Requires the compliance:sms:read OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
use_case_idstring · uuidRequired
Responses
200

Successful Response

application/json

A2P 10DLC campaign details and review status.

sms_use_case_idstring · uuidRequired

SMS use case this campaign belongs to.

setup_idstring · uuidRequired

Twilio setup under which this campaign is registered.

us_app_to_person_usecasestringRequired

TCR campaign use-case code (e.g. "MARKETING", "2FA").

descriptionstringRequired

Purpose and expected content of the campaign.

message_samplesstring[]Required

Examples of messages this campaign will send.

message_flowstringRequired

How recipients consent to receive campaign messages.

has_embedded_linksbooleanRequired

Whether campaign messages may contain URLs.

has_embedded_phonebooleanRequired

Whether campaign messages may contain phone numbers.

age_gatedbooleanRequired

Whether campaign content is age restricted.

direct_lendingbooleanRequired

Whether the campaign promotes direct lending.

opt_in_messagestringRequired

Confirmation message sent when a recipient opts in.

opt_in_keywordsstring[]Required

Keywords recipients may text to opt in.

opt_out_messagestringRequired

Confirmation message sent when a recipient opts out.

opt_out_keywordsstring[]Required

Keywords recipients may text to opt out.

help_messagestringRequired

Reply sent when a recipient asks for help.

help_keywordsstring[]Required

Keywords recipients may text to request help.

privacy_policy_urlstringRequired

Privacy policy URL shown for the campaign.

terms_and_conditions_urlstringRequired

Terms and conditions URL shown for the campaign.

statusstring · enumRequired

Current campaign review or suspension status.

Possible values:
created_atstring · date-timeRequired

When this A2P campaign was created.

updated_atstring · date-timeRequired

When this A2P campaign was last changed.

get/v1/use-case/{use_case_id}/a2p-campaign
GET /v1/use-case/{use_case_id}/a2p-campaign HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "sms_use_case_id": "123e4567-e89b-12d3-a456-426614174000",
  "setup_id": "123e4567-e89b-12d3-a456-426614174000",
  "us_app_to_person_usecase": "text",
  "description": "text",
  "message_samples": [
    "text"
  ],
  "message_flow": "text",
  "has_embedded_links": true,
  "has_embedded_phone": true,
  "age_gated": true,
  "direct_lending": true,
  "opt_in_message": "text",
  "opt_in_keywords": [
    "text"
  ],
  "opt_out_message": "text",
  "opt_out_keywords": [
    "text"
  ],
  "help_message": "text",
  "help_keywords": [
    "text"
  ],
  "privacy_policy_url": "text",
  "terms_and_conditions_url": "text",
  "status": "IN_PROGRESS",
  "errors": [
    {
      "code": 1,
      "description": "text"
    }
  ],
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}

Submit A2P Campaign

post

Create the A2P 10DLC campaign that gates long-code SMS for an SMS use case.

Needs a verified brand registration on the setup. 409 if a campaign already exists. 422 if the requested use-case code isn't allowed for the brand.

Requires the compliance:sms:write OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
use_case_idstring · uuidRequired
Body

Message content and consent details for a new A2P campaign.

us_app_to_person_usecasestring · min: 1 · max: 128Required

Campaign use-case code allowed for this setup's verified brand.

descriptionstring · min: 40 · max: 4096Required

Short description of what this SMS campaign does.

message_samplesstring[] · min: 2 · max: 5Required

2-5 sample messages, each 20-1024 chars.

message_flowstring · min: 40 · max: 2048Required

How consumers opt in to receive messages (40-2048 chars).

has_embedded_linksbooleanRequired

Whether campaign messages contain URLs.

has_embedded_phonebooleanRequired

Whether campaign messages contain phone numbers.

age_gatedbooleanRequired

Whether the campaign requires age gating (e.g. federally legal but age-restricted content).

direct_lendingbooleanRequired

Whether the campaign supports direct lending offers.

opt_in_messagestring · min: 20 · max: 320Required

Opt-in confirmation copy. Required unconditionally (Twilio treats it as optional): we send it as the FIRST message on the use case, before any other.

opt_in_keywordsstring[]Optional

Keywords that trigger text-to-join opt-in (e.g. "START"). Empty when the campaign offers no keyword opt-in (e.g. consent collected via web/paper form).

opt_out_messagestring · min: 20 · max: 320Required

Auto-reply confirmation sent when an end user opts out.

opt_out_keywordsstring[]Required

Keywords that trigger opt-out. MUST include the full CTIA set — "STOP", "STOPALL", "UNSUBSCRIBE", "CANCEL", "END", "QUIT".

help_messagestring · min: 20 · max: 320Required

Auto-reply sent when an end user asks for help.

help_keywordsstring[]Required

Keywords that trigger help. MUST include "HELP" (CTIA requirement).

privacy_policy_urlstring · uri · min: 1 · max: 2083Required

Public URL of the campaign's privacy policy.

terms_and_conditions_urlstring · uri · min: 1 · max: 2083Required

Public URL of the campaign's terms & conditions.

Responses
201

Successful Response

application/json

A2P 10DLC campaign details and review status.

sms_use_case_idstring · uuidRequired

SMS use case this campaign belongs to.

setup_idstring · uuidRequired

Twilio setup under which this campaign is registered.

us_app_to_person_usecasestringRequired

TCR campaign use-case code (e.g. "MARKETING", "2FA").

descriptionstringRequired

Purpose and expected content of the campaign.

message_samplesstring[]Required

Examples of messages this campaign will send.

message_flowstringRequired

How recipients consent to receive campaign messages.

has_embedded_linksbooleanRequired

Whether campaign messages may contain URLs.

has_embedded_phonebooleanRequired

Whether campaign messages may contain phone numbers.

age_gatedbooleanRequired

Whether campaign content is age restricted.

direct_lendingbooleanRequired

Whether the campaign promotes direct lending.

opt_in_messagestringRequired

Confirmation message sent when a recipient opts in.

opt_in_keywordsstring[]Required

Keywords recipients may text to opt in.

opt_out_messagestringRequired

Confirmation message sent when a recipient opts out.

opt_out_keywordsstring[]Required

Keywords recipients may text to opt out.

help_messagestringRequired

Reply sent when a recipient asks for help.

help_keywordsstring[]Required

Keywords recipients may text to request help.

privacy_policy_urlstringRequired

Privacy policy URL shown for the campaign.

terms_and_conditions_urlstringRequired

Terms and conditions URL shown for the campaign.

statusstring · enumRequired

Current campaign review or suspension status.

Possible values:
created_atstring · date-timeRequired

When this A2P campaign was created.

updated_atstring · date-timeRequired

When this A2P campaign was last changed.

post/v1/use-case/{use_case_id}/a2p-campaign
POST /v1/use-case/{use_case_id}/a2p-campaign HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 439

{
  "us_app_to_person_usecase": "text",
  "description": "text",
  "message_samples": [
    "text"
  ],
  "message_flow": "text",
  "has_embedded_links": true,
  "has_embedded_phone": true,
  "age_gated": true,
  "direct_lending": true,
  "opt_in_message": "text",
  "opt_in_keywords": [
    "text"
  ],
  "opt_out_message": "text",
  "opt_out_keywords": [
    "text"
  ],
  "help_message": "text",
  "help_keywords": [
    "text"
  ],
  "privacy_policy_url": "https://example.com",
  "terms_and_conditions_url": "https://example.com"
}
{
  "sms_use_case_id": "123e4567-e89b-12d3-a456-426614174000",
  "setup_id": "123e4567-e89b-12d3-a456-426614174000",
  "us_app_to_person_usecase": "text",
  "description": "text",
  "message_samples": [
    "text"
  ],
  "message_flow": "text",
  "has_embedded_links": true,
  "has_embedded_phone": true,
  "age_gated": true,
  "direct_lending": true,
  "opt_in_message": "text",
  "opt_in_keywords": [
    "text"
  ],
  "opt_out_message": "text",
  "opt_out_keywords": [
    "text"
  ],
  "help_message": "text",
  "help_keywords": [
    "text"
  ],
  "privacy_policy_url": "text",
  "terms_and_conditions_url": "text",
  "status": "IN_PROGRESS",
  "errors": [
    {
      "code": 1,
      "description": "text"
    }
  ],
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}

Update A2P Campaign

put

Update an A2P campaign's message and consent information.

A failed campaign can be resubmitted when its rejection is remediable. Campaigns under review return 409. Requires the compliance:sms:write scope on the setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
use_case_idstring · uuidRequired
Body

Updatable subset of campaign fields. Twilio's update_async signature is fixed at these 7 fields — no other field is mutable post-create.

descriptionstring · min: 40 · max: 4096Required

Purpose and expected content of the campaign.

message_flowstring · min: 40 · max: 2048Required

How recipients consent to receive campaign messages.

message_samplesstring[] · min: 2 · max: 5Required

Two to five examples of messages the campaign will send.

has_embedded_linksbooleanRequired

Whether campaign messages may contain URLs.

has_embedded_phonebooleanRequired

Whether campaign messages may contain phone numbers.

age_gatedbooleanRequired

Whether campaign content is age restricted.

direct_lendingbooleanRequired

Whether the campaign promotes direct lending.

Responses
200

Successful Response

application/json

A2P 10DLC campaign details and review status.

sms_use_case_idstring · uuidRequired

SMS use case this campaign belongs to.

setup_idstring · uuidRequired

Twilio setup under which this campaign is registered.

us_app_to_person_usecasestringRequired

TCR campaign use-case code (e.g. "MARKETING", "2FA").

descriptionstringRequired

Purpose and expected content of the campaign.

message_samplesstring[]Required

Examples of messages this campaign will send.

message_flowstringRequired

How recipients consent to receive campaign messages.

has_embedded_linksbooleanRequired

Whether campaign messages may contain URLs.

has_embedded_phonebooleanRequired

Whether campaign messages may contain phone numbers.

age_gatedbooleanRequired

Whether campaign content is age restricted.

direct_lendingbooleanRequired

Whether the campaign promotes direct lending.

opt_in_messagestringRequired

Confirmation message sent when a recipient opts in.

opt_in_keywordsstring[]Required

Keywords recipients may text to opt in.

opt_out_messagestringRequired

Confirmation message sent when a recipient opts out.

opt_out_keywordsstring[]Required

Keywords recipients may text to opt out.

help_messagestringRequired

Reply sent when a recipient asks for help.

help_keywordsstring[]Required

Keywords recipients may text to request help.

privacy_policy_urlstringRequired

Privacy policy URL shown for the campaign.

terms_and_conditions_urlstringRequired

Terms and conditions URL shown for the campaign.

statusstring · enumRequired

Current campaign review or suspension status.

Possible values:
created_atstring · date-timeRequired

When this A2P campaign was created.

updated_atstring · date-timeRequired

When this A2P campaign was last changed.

put/v1/use-case/{use_case_id}/a2p-campaign
PUT /v1/use-case/{use_case_id}/a2p-campaign HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 162

{
  "description": "text",
  "message_flow": "text",
  "message_samples": [
    "text"
  ],
  "has_embedded_links": true,
  "has_embedded_phone": true,
  "age_gated": true,
  "direct_lending": true
}
{
  "sms_use_case_id": "123e4567-e89b-12d3-a456-426614174000",
  "setup_id": "123e4567-e89b-12d3-a456-426614174000",
  "us_app_to_person_usecase": "text",
  "description": "text",
  "message_samples": [
    "text"
  ],
  "message_flow": "text",
  "has_embedded_links": true,
  "has_embedded_phone": true,
  "age_gated": true,
  "direct_lending": true,
  "opt_in_message": "text",
  "opt_in_keywords": [
    "text"
  ],
  "opt_out_message": "text",
  "opt_out_keywords": [
    "text"
  ],
  "help_message": "text",
  "help_keywords": [
    "text"
  ],
  "privacy_policy_url": "text",
  "terms_and_conditions_url": "text",
  "status": "IN_PROGRESS",
  "errors": [
    {
      "code": 1,
      "description": "text"
    }
  ],
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}

Delete Hold Music

delete

Clear a voice use case's hold music. 404 when it has none; 400 for non-voice use cases.

Requires the use-case:write OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
use_case_idstring · uuidRequired
Responses
204

Successful Response

No content

delete/v1/use-case/{use_case_id}/hold-music
DELETE /v1/use-case/{use_case_id}/hold-music HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Upload Hold Music

put

Upload a voice use case's hold music (MP3 or WAV, 10 KiB to 5 MiB), replacing any earlier one.

400 for non-voice use cases.

Requires the use-case:write OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
use_case_idstring · uuidRequired
Body
hold_musicstringRequired
Responses
204

Successful Response

No content

put/v1/use-case/{use_case_id}/hold-music
PUT /v1/use-case/{use_case_id}/hold-music HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: multipart/form-data
Accept: */*
Content-Length: 21

{
  "hold_music": "text"
}

No content

Rotate Webhook Secret

post

Rotate a messaging use case's webhook signing secret.

Return the new secret once; the old secret remains valid for 30 minutes. Voice use cases are not supported. Requires the use-case:write scope on the setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
use_case_idstring · uuidRequired
Responses
200

Successful Response

application/json
webhook_secretstringRequired

The freshly-minted signing secret. Returned ONCE — never re-readable via the API; the caller stores it on its receiver to verify future signatures.

old_secret_lasts_untilstring · date-timeRequired

When the previous secret stops being accepted; until then the webhooks dual-sign both, so a receiver reconfigured before this still verifies.

post/v1/use-case/{use_case_id}/webhook-secret
POST /v1/use-case/{use_case_id}/webhook-secret HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "webhook_secret": "text",
  "old_secret_lasts_until": "2026-01-01T00:00:00.000Z"
}

List Voice Calls

get

List calls for a setup, newest first, with optional filters and pagination.

Requires the voice:read scope on the setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
setup_idstring · uuidRequired

Twilio setup whose calls are listed.

use_case_idstring · uuid · nullableOptional

Restrict results to one voice use case.

directionstring · enum · nullableOptional

Filter by inbound or outbound direction.

Possible values:
peer_numberstring · phone · nullableOptional

Filter by the other party's E.164 phone number.

created_beforestring · date-time · nullableOptional

Exclusive upper bound on call creation time.

created_afterstring · date-time · nullableOptional

Inclusive lower bound on call creation time.

sort_bystring[]Optional

Sort axes left-to-right; +field asc, -field desc. Default -created_at.

Default: []
limitinteger · max: 200Optional

Maximum number of calls to return.

Default: 50
continuation_tokenanyOptional

Opaque cursor from a prior response; round-trip it, don't construct it.

Responses
200

Successful Response

application/json
has_morebooleanRequired

Whether another page of results is available.

continuation_tokenanyRequired

Opaque token for the next page, or null when complete.

get/v1/voice-call/
GET /v1/voice-call/?setup_id=123e4567-e89b-12d3-a456-426614174000 HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "items": [
    {
      "call_ref": "123e4567-e89b-12d3-a456-426614174000",
      "use_case_id": "123e4567-e89b-12d3-a456-426614174000",
      "direction": "inbound",
      "phone_number": "text",
      "peer_number": "text",
      "recording_available": true,
      "created_at": "2026-01-01T00:00:00.000Z",
      "started_at": "2026-01-01T00:00:00.000Z",
      "ended_at": "2026-01-01T00:00:00.000Z"
    }
  ],
  "has_more": true,
  "continuation_token": null
}

Create Voice Call

post

Create a call for an outbound-voice use case and select its caller ID.

A repeated idempotency key returns the existing call. Requires the voice:call scope on the setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
use_case_idstring · uuidRequired

Outbound-voice use case whose sender pool the call is placed from.

idempotency_keystring · min: 1 · max: 255 · nullableOptional

Retry-dedup key; a repeat returns the existing call rather than a second one.

Responses
200

Successful Response

application/json
call_refstring · uuidRequired

Identifier used for subsequent call-control requests.

phone_numberstringRequired

The From number selected from the use case's pool.

post/v1/voice-call/
POST /v1/voice-call/ HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 79

{
  "use_case_id": "123e4567-e89b-12d3-a456-426614174000",
  "idempotency_key": "text"
}
{
  "call_ref": "123e4567-e89b-12d3-a456-426614174000",
  "phone_number": "text"
}

Delete Voice Call

delete

End a voice call and disconnect its participants.

Requires the voice:call scope on the setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
call_refstring · uuidRequired
Responses
200

Successful Response

application/json
anyOptional
delete/v1/voice-call/{call_ref}
DELETE /v1/voice-call/{call_ref} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Get Voice Call

get

Return a call and its participants.

Requires the voice:read scope on the call's setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
call_refstring · uuidRequired
Responses
200

Successful Response

application/json
call_refstring · uuidRequired

Identifier of the voice call.

use_case_idstring · uuidRequired

Voice use case associated with this call.

setup_idstring · uuidRequired

Twilio setup that owns this call.

directionstring · enumRequired

Direction of the voice call.

Possible values:
phone_numberstringRequired

Phone number used by the voice use case.

peer_numberstring · nullableRequired

Other party's phone number, if known.

recording_availablebooleanRequired

Whether a call recording can be retrieved.

created_atstring · date-timeRequired

When this voice call was created.

started_atstring · date-time · nullableRequired

When the call began, if started.

ended_atstring · date-time · nullableRequired

When the call ended, if ended.

get/v1/voice-call/{call_ref}
GET /v1/voice-call/{call_ref} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "call_ref": "123e4567-e89b-12d3-a456-426614174000",
  "use_case_id": "123e4567-e89b-12d3-a456-426614174000",
  "setup_id": "123e4567-e89b-12d3-a456-426614174000",
  "direction": "inbound",
  "phone_number": "text",
  "peer_number": "text",
  "recording_available": true,
  "created_at": "2026-01-01T00:00:00.000Z",
  "started_at": "2026-01-01T00:00:00.000Z",
  "ended_at": "2026-01-01T00:00:00.000Z",
  "participants": [
    {
      "participant_ref": "123e4567-e89b-12d3-a456-426614174000",
      "kind": "inbound",
      "role": "caller",
      "to_phone_number": "text",
      "dial_status": "answered",
      "answered_by": "human",
      "created_at": "2026-01-01T00:00:00.000Z",
      "answered_at": "2026-01-01T00:00:00.000Z",
      "joined_at": "2026-01-01T00:00:00.000Z",
      "left_at": "2026-01-01T00:00:00.000Z"
    }
  ]
}

Add Voice Call Participant

post

Add a dialed participant or media stream to a voice call.

An ended call returns 409. Requires the voice:call scope on the setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
call_refstring · uuidRequired
Body
or
Responses
200

Successful Response

application/json
participant_refstring · uuidRequired

Identifier used to control this participant later.

rolestring · enumRequired

Role assigned to the participant.

Possible values:
post/v1/voice-call/{call_ref}/participant
POST /v1/voice-call/{call_ref}/participant HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 103

{
  "kind": "media",
  "stream_url": "https://example.com",
  "stream_context": {
    "ANY_ADDITIONAL_PROPERTY": "text"
  }
}
{
  "participant_ref": "123e4567-e89b-12d3-a456-426614174000",
  "role": "caller"
}

Delete Voice Call Participant

delete

Remove a participant from a call; a participant already removed returns 204.

Requires the voice:call scope on the call's setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
call_refstring · uuidRequired
participant_refstring · uuidRequired
Responses
200

Successful Response

application/json
anyOptional
delete/v1/voice-call/{call_ref}/participant/{participant_ref}
DELETE /v1/voice-call/{call_ref}/participant/{participant_ref} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Update Voice Call Participant

put

Change a participant's hold, mute, or end-call-on-exit setting.

Requires the voice:call scope on the call's setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
call_refstring · uuidRequired
participant_refstring · uuidRequired
Body
holdbooleanOptional

Place the participant on hold or resume them.

mutedbooleanOptional

Mute or unmute the participant.

ends_call_on_exitbooleanOptional

Whether the conference ends when this participant leaves.

Responses
200

Successful Response

application/json
anyOptional
put/v1/voice-call/{call_ref}/participant/{participant_ref}
PUT /v1/voice-call/{call_ref}/participant/{participant_ref} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 51

{
  "hold": true,
  "muted": true,
  "ends_call_on_exit": true
}

No content

Start Participant Media Stream

post

Stream a connected participant's inbound audio to a secure WebSocket URL.

A participant who has not joined or is already streaming returns 409. Requires the voice:call scope on the setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
call_refstring · uuidRequired
participant_refstring · uuidRequired
Body
stream_urlstring · uri · min: 1Required

The wss:// endpoint Twilio forks this participant's inbound audio to.

Responses
200

Successful Response

application/json
anyOptional
post/v1/voice-call/{call_ref}/participant/{participant_ref}/media-stream
POST /v1/voice-call/{call_ref}/participant/{participant_ref}/media-stream HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 88

{
  "stream_url": "https://example.com",
  "stream_context": {
    "ANY_ADDITIONAL_PROPERTY": "text"
  }
}

No content

Redirect Voice Call Participant

post

Redirect a connected call participant to another number or a farewell message.

Requires the voice:call scope on the setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
call_refstring · uuidRequired
participant_refstring · uuidRequired
Body
or
Responses
200

Successful Response

application/json
anyOptional
post/v1/voice-call/{call_ref}/participant/{participant_ref}/redirect
POST /v1/voice-call/{call_ref}/participant/{participant_ref}/redirect HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 27

{
  "kind": "dial",
  "to": "text"
}

No content

Create Whatsapp Setup

post

Register a business identity and return its Hosted Embedded Signup URL.

Requires the whatsapp-setup:create OAuth2 scope (action-only, resource "*" — no setup exists yet, so only a first-party ["*"] grant passes).

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
friendly_namestring · min: 1 · max: 64Required

Operator-facing label for this business identity. Never sent to Meta.

Pattern: ^[A-Za-z0-9_-]+$
meta_business_portfolio_idstring · min: 15 · max: 20Required

Customer's Meta business portfolio ID; only one active setup may use it.

Pattern: ^[0-9]+$
Responses
201

Successful Response

application/json
whatsapp_embedded_signup_urlstringRequired

Meta-hosted Embedded Signup URL to hand the customer. Static per environment — carries no per-setup token.

whatsapp_setup_idstring · uuidRequired

Identifier of the new WhatsApp setup.

post/v1/whatsapp-setup
POST /v1/whatsapp-setup HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 60

{
  "friendly_name": "text",
  "meta_business_portfolio_id": "text"
}
{
  "whatsapp_embedded_signup_url": "text",
  "whatsapp_setup_id": "123e4567-e89b-12d3-a456-426614174000"
}

Delete Whatsapp Setup

delete

Delete a WhatsApp setup and stop receiving its account updates.

Delete active WhatsApp use cases first. Requires the whatsapp-setup:write scope on the setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
setup_idstring · uuidRequired
Responses
204

Successful Response

No content

delete/v1/whatsapp-setup/{setup_id}
DELETE /v1/whatsapp-setup/{setup_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Get Whatsapp Setup

get

Return a WhatsApp setup's name and current setup details.

Requires the whatsapp-setup:read scope on the setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
setup_idstring · uuidRequired
Responses
200

Successful Response

application/json
idstring · uuidRequired

Identifier of the WhatsApp setup.

friendly_namestringRequired

Display name of the setup.

created_atstring · date-timeRequired

When this WhatsApp setup was created.

updated_atstring · date-timeRequired

When this WhatsApp setup was last changed.

deleted_atstring · date-time · nullableRequired

Deletion time; null for an active setup.

get/v1/whatsapp-setup/{setup_id}
GET /v1/whatsapp-setup/{setup_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "friendly_name": "text",
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z",
  "deleted_at": "2026-01-01T00:00:00.000Z"
}

Send Whatsapp Message

post

Send a WhatsApp message from a use case's number to a BSUID-addressed recipient.

Free-form only (no templates): the recipient must have messaged this use case within 23 hours (one hour inside Meta's 24, so an accepted send can't die at the window edge). Requires the whatsapp:send OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
or
or
or
or
or
or
Responses
201

Successful Response

application/json
message_idstring · uuidRequired

Identifier for retrieving this message later.

post/v1/whatsapp/
POST /v1/whatsapp/ HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 170

"use_case_id='123e4567-e89b-12d3-a456-426614174000'&to_bsuid='text'&message_type='text'&message='text'&target_message_id='123e4567-e89b-12d3-a456-426614174000'"
{
  "message_id": "123e4567-e89b-12d3-a456-426614174000"
}

Create Whatsapp Message Template

post

Create a WhatsApp message template for the setup's business account.

Requires the whatsapp:template:write OAuth2 scope on the target setup.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
setup_idstring · uuidRequired

WhatsApp setup that owns the template.

namestring · min: 4 · max: 512Required

Template name using lowercase letters, digits, and underscores.

Pattern: ^[a-z_0-9]+$
languagestring · enumRequired

Language in which the template is written.

Possible values:
categorystring · enumRequired

WhatsApp review category for the template.

Possible values:
headerstring · nullableOptional

Optional header definition supplied as JSON.

header_sample_mediastring · nullableOptional

Sample file required for an image, video, or document header.

body_textstring · min: 1 · max: 1024Required

Template body text with any named parameter placeholders.

body_text_parameter_namesstring[]Optional

Names of every placeholder used in the body text.

Default: []
footer_textstring · min: 1 · max: 60 · nullableOptional

Optional footer text without parameter placeholders.

Responses
201

Successful Response

application/json
template_idstring · uuidRequired

Identifier to use when retrieving the template later.

post/v1/whatsapp/template
POST /v1/whatsapp/template HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 228

"setup_id='123e4567-e89b-12d3-a456-426614174000'&name='text'&language='None'&category='marketing'&header='text'&header_sample_media='text'&body_text='text'&body_text_parameter_names=['text']&footer_text='text'"
{
  "template_id": "123e4567-e89b-12d3-a456-426614174000"
}

Last updated

Was this helpful?