The Message Object
Attributes
A 36-character string that uniquely identifies a message detail record.
The exact timestamp at which an outbound message was initiated or an inbound message was received.
Indicates the direction of the message. Values:
outbound, inbound.Current status of the message. Outbound:
queued, sent, failed, delivered, undelivered, read (WhatsApp only). Inbound: received, delivered, undelivered.Type of message. Values:
sms, mms, whatsapp.Source address of the message. For outbound: Plivo phone number, short code, alphanumeric sender ID, or WhatsApp Business number. For inbound: the sender’s phone number.
Destination phone number. For inbound messages, this is the Plivo phone number that received the message.
Number of units the message was split into.
The charge applicable per unit of the message.
The total amount charged for this message.
Plivo error code.
000 for successful delivery. See error codes for failure codes.WhatsApp-only. ID of the conversation to which the message belongs.
WhatsApp-only. How the conversation was initiated. Values:
utility, authentication, marketing, service.Example Message Object
Send a Message
Send an SMS, MMS, or WhatsApp message to one or more recipients.Arguments
Sender ID: phone number, short code, or alphanumeric string. For WhatsApp, use your WhatsApp Business number. Either
src or powerpack_uuid is required.UUID of the Powerpack to use for this message. Either
src or powerpack_uuid is required.Destination phone number in E.164 format. For multiple recipients, separate with
< (e.g., 14156667777<14157778888).Message content. For SMS: max 1,600 GSM characters or 737 Unicode characters. For WhatsApp freeform: max 4,096 characters.
Message type. Values:
sms (default), mms, whatsapp.For MMS: comma-separated URLs (max 10, total size < 5MB). For WhatsApp: single media URL.
WhatsApp template object for templated messages. Required for initiating conversations.
WhatsApp interactive message object for list buttons, reply buttons, or CTA buttons.
WhatsApp location object with
latitude, longitude, name, and address.Callback URL for delivery status updates.
HTTP method for callback URL. Values:
GET, POST (default).Queue expiry time in seconds (5-10,799). Default: 10,800 (3 hours).
Data logging preference. Values:
true (default), false, content_only, number_only.Set
true for messages with trackable actions (e.g., 2FA). Default: false.DLT entity ID for India DLT compliance.
DLT template ID for India DLT compliance.
DLT template category. Values:
transactional, promotional, service_implicit, service_explicit.Response
Returns the message UUID(s) and API request ID.Response
Retrieve a Message
Get details of a specific message by its UUID.Arguments
The unique identifier of the message to retrieve.
List All Messages
Retrieve a list of message records with optional filters.Arguments
Filter by subaccount auth_id.
Filter by direction. Values:
inbound, outbound.Filter by state. Values:
queued, sent, delivered, undelivered, failed, received.Filter by type. Values:
sms, mms, whatsapp.Filter messages after this timestamp (format:
yyyy-MM-dd HH:mm:ss).Filter messages before this timestamp.
Filter by error code.
Filter by Powerpack ID.
Results per page (max 20). Default: 20.
Number of records to skip. Default: 0.
List MMS Media
Retrieve media files associated with an MMS message.Arguments
The unique identifier of the MMS message.
Message Status Callbacks
Configure a callback URL to receive delivery status updates for your messages.Callback Parameters
Status callback parameters
Status callback parameters
| Parameter | Type | Description |
|---|---|---|
From | string | The sender ID of the message. |
To | string | The destination number. |
MessageUUID | string | Unique identifier for the message. |
Status | string | Current status: queued, sent, delivered, undelivered, failed, read. |
Units | integer | Number of message units. |
TotalRate | string | Per-unit charge. |
TotalAmount | string | Total charge for the message. |
ErrorCode | string | Error code if delivery failed. |
MCC | string | Mobile Country Code of the destination. |
MNC | string | Mobile Network Code of the destination. |
Handling Incoming Messages
When a message is received on your Plivo number, Plivo sends a request to your configured Message URL.Incoming Message Parameters
| Parameter | Type | Description |
|---|---|---|
From | string | Sender’s phone number. |
To | string | Your Plivo phone number. |
Text | string | Message content. |
Type | string | Message type (sms, mms, whatsapp). |
MessageUUID | string | Unique message identifier. |
Media0…MediaN | string | MMS media URLs (for MMS messages). |
Configuration
- Create a Messaging Application
- Set your Message URL endpoint
- Assign the application to your Plivo number
200 OK response. Optionally, return Message XML to send a reply.