Skip to main content
A Message Detail Record (MDR) is generated for every message sent or received by Plivo. Use the Message API to send outbound messages, retrieve message details, and monitor message delivery status.

The Message Object

Attributes

string
A 36-character string that uniquely identifies a message detail record.
string
The exact timestamp at which an outbound message was initiated or an inbound message was received.
string
Indicates the direction of the message. Values: outbound, inbound.
string
Current status of the message. Outbound: queued, sent, failed, delivered, undelivered, read (WhatsApp only). Inbound: received, delivered, undelivered.
string
Type of message. Values: sms, mms, whatsapp.
string
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.
string
Destination phone number. For inbound messages, this is the Plivo phone number that received the message.
integer
Number of units the message was split into.
string
The charge applicable per unit of the message.
string
The total amount charged for this message.
string
Plivo error code. 000 for successful delivery. See error codes for failure codes.
string
WhatsApp-only. ID of the conversation to which the message belongs.
string
WhatsApp-only. How the conversation was initiated. Values: utility, authentication, marketing, service.

Example Message Object


List All Messages

Retrieve a list of message records with optional filters.

Arguments

string
Filter by subaccount auth_id.
string
Filter by direction. Values: inbound, outbound.
string
Filter by state. Values: queued, sent, delivered, undelivered, failed, received.
string
Filter by type. Values: sms, mms, whatsapp.
string
Filter messages after this timestamp (format: yyyy-MM-dd HH:mm:ss).
string
Filter messages before this timestamp.
integer
Filter by error code.
string
Filter by Powerpack ID.
integer
Results per page (max 20). Default: 20.
integer
Number of records to skip. Default: 0.

Retrieve a Message

Get details of a specific message by its UUID.

Arguments

string
required
The unique identifier of the message to retrieve.

Send a Message

Send an SMS, MMS, or WhatsApp message to one or more recipients.

Arguments

string
required
Sender ID: phone number, short code, or alphanumeric string. For WhatsApp, use your WhatsApp Business number. Either src or powerpack_uuid is required.
string
UUID of the Powerpack to use for this message. Either src or powerpack_uuid is required.
string
required
Destination phone number in E.164 format. For multiple recipients, separate with < (e.g., 14156667777<14157778888).
string
Message content. For SMS: max 1,600 GSM characters or 737 Unicode characters. For WhatsApp freeform: max 4,096 characters.
string
Message type. Values: sms (default), mms, whatsapp.
array
For MMS: comma-separated URLs (max 10, total size < 5MB). For WhatsApp: single media URL.
object
WhatsApp template object for templated messages. Required for initiating conversations.
object
WhatsApp interactive message object for list buttons, reply buttons, or CTA buttons.
object
WhatsApp location object with latitude, longitude, name, and address.
string
Callback URL for delivery status updates.
string
HTTP method for callback URL. Values: GET, POST (default).
integer
Queue expiry time in seconds (5-10,799). Default: 10,800 (3 hours).
string
Data logging preference. Values: true (default), false, content_only, number_only.
boolean
Set true for messages with trackable actions (e.g., 2FA). Default: false.
string
deprecated
Deprecated. Plivo no longer supports domestic India SMS via DLT; messages to India are delivered over international (ILDO) routes.
string
deprecated
Deprecated. Plivo no longer supports domestic India SMS via DLT; messages to India are delivered over international (ILDO) routes.
string
deprecated
Deprecated. Plivo no longer supports domestic India SMS via DLT; messages to India are delivered over international (ILDO) routes.

Response

Returns the message UUID(s) and API request ID.
Response

List MMS Media

Retrieve media files associated with an MMS message.

Arguments

string
required
The unique identifier of the MMS message.

Message Status Callbacks

Configure a callback URL to receive delivery status updates for your messages.

Callback Parameters


Handling Incoming Messages

When a message is received on your Plivo number, Plivo sends a request to your configured Message URL.

Incoming Message Parameters

Configuration

  1. Create a Messaging Application
  2. Set your Message URL endpoint
  3. Assign the application to your Plivo number
Your endpoint should return a 200 OK response. Optionally, return Message XML to send a reply.