Legacy API Notice: This documentation covers the Legacy Sent API (v2). For new integrations, please refer to the latest Sent API v3 Data Models.

Data Models

Complete reference for the data structures used in the legacy Sent API v2.

Contact Models

Contact Object

The contact object represents a phone number with its various formats and available messaging channels.

FieldTypeDescription
idUUIDUnique contact identifier
phoneNumberStringPhone number as originally provided
formatE164StringE.164 international format
formatInternationalStringHuman-readable international format
formatNationalStringNational format for the country
formatRfcStringRFC 3966 tel: URI format
countryCodeStringCountry calling code
regionCodeStringISO 3166-1 alpha-2 country code
availableChannelsStringComma-separated available channels
defaultChannelStringRecommended messaging channel

Contact List Response

GET /v2/contacts returns the pagination wrapper with each entry in items being a Contact object:

{
  "items": [
    {
      "id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
      "phoneNumber": "+1234567890",
      "formatE164": "+1234567890",
      "formatInternational": "+1 234-567-890",
      "formatNational": "(234) 567-890",
      "formatRfc": "tel:+1-234-567-890",
      "countryCode": "1",
      "regionCode": "US",
      "availableChannels": "sms,whatsapp",
      "defaultChannel": "sms"
    }
  ],
  "totalCount": 150,
  "page": 0,
  "pageSize": 20,
  "totalPages": 8
}

Template Models

Template Object

Message templates for multi-channel messaging (SMS, WhatsApp).

FieldTypeDescription
idUUIDUnique template identifier
displayNameStringHuman-readable template name
categoryEnumTemplate category (see below)
languageISO CodeLanguage/locale (for example, en_US)
definitionObjectTemplate Definition object (see below)
statusEnumTemplate status (see below)
isPublishedBooleanWhether template is published for use
whatsappTemplateIdStringWhatsApp internal template ID (when applicable)
whatsappTemplateNameStringWhatsApp internal template name (when applicable)
createdAtDateTimeISO 8601 creation timestamp
updatedAtDateTimeISO 8601 last update timestamp

Template Definition Object

Defines the content and components of a template, including channel-specific bodies and interactive elements.

FieldTypeDescription
headerObject?Optional header; supports type and template, with variables
bodyObjectMessage body definitions: supports multiChannel, sms, and whatsapp
footerObject?Optional footer with type and template
buttonsArray<Button>Optional interactive buttons (max 10, WhatsApp limit; per type: 1 COPY_CODE, 1 PHONE_NUMBER, 2 URL, 10 QUICK_REPLY)
definitionVersionStringDefinition schema version (for example, 1.0)

Body fields (multiChannel, sms, whatsapp) share the same shape:

FieldTypeDescription
templateStringMessage text with variable placeholders (for example, Hello {{1:name}})
variablesArray<Variable>Variables referenced in the template

Variable Object

Represents a dynamic placeholder used in headers and bodies.

FieldTypeDescription
idIntegerSequential variable ID starting from 1
nameStringReadable variable name
typeEnumOne of variable, link, media
props.variableTypeEnumOne of text, link, image, file
props.sampleStringSample value for approval and previews
props.urlString?Full URL (for link/media)
props.shortUrlString?Shortened URL (optional)
props.altString?Alternative text (media)
props.mediaTypeEnum?One of image, video, document (media only)

Button Object

Interactive button used primarily for WhatsApp templates.

FieldTypeDescription
idIntegerButton identifier
typeEnumOne of URL, PHONE_NUMBER, QUICK_REPLY, VOICE_CALL, COPY_CODE
props.textStringButton label
props.urlTypeEnum?One of static, dynamic (URL buttons)
props.urlString?Destination URL (URL buttons)
props.countryCodeString?For example, +1 (phone buttons)
props.phoneNumberString?Local number (phone buttons)
props.quickReplyTypeString?One of custom, pre-configured (quick reply)
props.activeForInteger?Active window in seconds (voice call)
props.offerCodeString?Code to copy (copy code)

Template Categories

CategoryDescriptionUse Cases
AUTHENTICATIONOTP and verification2FA, login codes
MARKETINGPromotional contentCampaigns, offers
UTILITYTransactional messagesConfirmations, updates

Template Status Values

StatusDescription
DRAFTNot submitted for review
PENDINGUnder review
APPROVEDApproved for use
REJECTEDRejected and cannot be used
PAUSEDTemporarily disabled
ARCHIVEDArchived and not in active use

Template List Response

GET /v2/templates returns the pagination wrapper with each entry in items being a Template object.

Message Models

Send Message Request

Request payload for sending messages via contact ID or phone number.

FieldTypeRequiredDescription
contactIdUUIDYes*Contact ID (for contact endpoint)
phoneNumberStringYes*Phone number (for phone endpoint)
templateIdUUIDYesTemplate to use
templateVariablesObjectNoTemplate variable values

*One of contactId or phoneNumber is required depending on endpoint

Message Response

POST /v2/messages/phone and POST /v2/messages/contact return 202 Accepted with the ID of the queued message:

{
  "messageId": "8ba7b830-9dad-11d1-80b4-00c04fd430c8"
}

POST /v2/messages/quick-message returns 200 OK with one message ID per channel; whatsappMessageId is null when the number is not WhatsApp-capable:

{
  "smsMessageId": "8ba7b830-9dad-11d1-80b4-00c04fd430c8",
  "whatsappMessageId": "8ba7b830-9dad-11d1-80b4-00c04fd430c9"
}

Pagination Model

Standard pagination structure used by list endpoints.

FieldTypeDescription
itemsArrayList of objects
totalCountIntegerTotal items available
pageIntegerCurrent page (0-based)
pageSizeIntegerItems per page
totalPagesIntegerTotal pages available

Channel Types

ChannelDescription
smsTraditional SMS messaging
whatsappWhatsApp Business messaging

Phone Number Formats

The API accepts various phone number formats and normalizes them:

FormatExampleDescription
E.164+1234567890International format (recommended)
International+1 234-567-890With formatting
National(234) 567-890Country-specific format
IDD Prefix0011234567890International dialing
Raw1234567890Digits only (requires context)

Webhook Payload

Delivery status updates are not returned by v2 endpoints. They are delivered as events to the webhook endpoints registered for your account, using the platform-wide envelope:

FieldTypeDescription
fieldStringParent event type; message for status updates
eventStringGranular sub-type, for example message.delivered
timestampStringISO 8601 timestamp of event creation
payloadObjectEvent-specific data (see below)

For message status events, payload contains:

FieldTypeDescription
updated_atStringISO 8601 timestamp of the status change
account_idUUIDYour account identifier
message_idUUIDThe message ID returned by the send endpoint
template_idUUIDTemplate used for the message
template_nameStringTemplate display name
outbound_numberStringSending phone number
message_statusStringMessage status (see below)
channelStringsms or whatsapp

Example event:

{
  "field": "message",
  "event": "message.delivered",
  "timestamp": "2025-10-31T10:10:42Z",
  "payload": {
    "updated_at": "2025-10-31T10:10:41Z",
    "account_id": "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
    "message_id": "8ba7b830-9dad-11d1-80b4-00c04fd430c8",
    "template_id": "9ba7b840-9dad-11d1-80b4-00c04fd430c8",
    "template_name": "order_confirmation",
    "outbound_number": "+1987654321",
    "message_status": "DELIVERED",
    "channel": "sms"
  }
}

Webhook Status Values

StatusEventDescription
QUEUEDmessage.queuedMessage accepted and waiting to be dispatched
ROUTEDmessage.routedMessage assigned to a carrier or provider
SENTmessage.sentMessage sent to carrier or WhatsApp
DELIVEREDmessage.deliveredMessage delivered to recipient's device
READmessage.readMessage read by recipient (WhatsApp and RCS)
FAILEDmessage.failedMessage delivery failed permanently
SCHEDULEDmessage.scheduledMessage deferred until the recipient's quiet hours end
FILTEREDmessage.filteredMessage suppressed by a policy gate; not dispatched
BLOCKEDmessage.blockedMessage gated by an account-level precondition; not dispatched

The full event catalog, including inbound message and template events, signature verification, and retry behavior, is documented in the webhook events reference.

On this page