Contents

API reference

Opt-in links

API reference descriptions are provided in English to preserve the exact published contract.

List hosted opt-in form links

GET /v1/accounts/{AC}/opt-in-links

Required scope: `contacts:read`.

Parameters

Parameters
NameTypeRequiredDescription
ACpath · string (AC… SID)yesAccount SID

Errors: 400, 401, 403, 404, 409, 422, 429, 500, 503 — see errors.

Create a hosted opt-in form link

POST /v1/accounts/{AC}/opt-in-links

Mints a link to a form ShipMsg hosts. A person who submits it becomes a contact with an OPTED_IN consent for the purpose, citing this link and its exact wording as evidence. The token is returned once and stored hashed. Required scope: `contacts:write`.

Parameters

Parameters
NameTypeRequiredDescription
ACpath · string (AC… SID)yesAccount SID
Request body (5 fields)
Request body
NameTypeRequiredDescription
consentTextstring (max 1000 chars)yes
defaultCountrystring (pattern ^[A-Za-z]{2}$)Two-letter country a number typed without + is read against. Defaults to the organization's country.
expiresInDaysinteger (1–3650)
labelstring (max 120 chars)yes
purpose"MARKETING" | "TRANSACTIONAL" | "SUPPORT"

Errors: 400, 401, 403, 404, 409, 422, 429, 500, 503 — see errors.

Revoke a hosted opt-in form link

POST /v1/accounts/{AC}/opt-in-links/{OL}/revoke

The form stops accepting submissions. The row stays, because the consents it collected cite it. Required scope: `contacts:write`.

Parameters

Parameters
NameTypeRequiredDescription
ACpath · stringyes
OLpath · string (OL… SID)yes

Errors: 400, 401, 403, 404, 409, 422, 429, 500, 503 — see errors.

Read a hosted opt-in form (public)

GET /v1/opt-in/{token}

Parameters

Parameters
NameTypeRequiredDescription
tokenpath · string (max 256 chars)yes

Errors: 400, 401, 403, 404, 409, 422, 429, 500, 503 — see errors.

Submit a hosted opt-in form (public)

POST /v1/opt-in/{token}

Creates or finds the contact by phone and records an OPTED_IN consent with source FORM, citing the link and the exact wording that was on the page.

Parameters

Parameters
NameTypeRequiredDescription
tokenpath · string (max 256 chars)yes
Request body (3 fields)
Request body
NameTypeRequiredDescription
agreedbooleanyes
namestring (max 200 chars)
phonestring (max 32 chars)yes

Errors: 400, 401, 403, 404, 409, 422, 429, 500, 503 — see errors.