> ## Documentation Index
> Fetch the complete documentation index at: https://plivo.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# The Message object

> Message detail record attributes and response fields

A Message Detail Record (MDR) is generated for every message sent or received by Plivo.

An MDR object has these attributes.

### Attributes

<table>
  <tbody>
    <tr>
      <td><strong>message\_uuid<br /> <span>string</span></strong></td>
      <td><p>A 36-character string that uniquely identifies a message detail record.</p></td>
    </tr>

    <tr>
      <td><strong>message\_time<br /> <span>string</span></strong></td>
      <td><p>The exact timestamp at which an outbound message was initiated or an inbound message was received.</p></td>
    </tr>

    <tr>
      <td><strong>message\_direction<br /> <span>string</span></strong></td>
      <td><p>Indicates the direction of the message. It is set to outbound for messages sent out from Plivo’s platform, and to inbound for messages received on Plivo numbers.</p></td>
    </tr>

    <tr>
      <td><strong>message\_state<br /> <span>string</span></strong></td>

      <td>
        <p>Indicates the current status of the message.</p>
        <p>Outbound messages may be in any of the following states: queued, sent, failed, delivered, undelivered, read (WhatsApp only).</p>
        <p>All outbound messages are initially queued. A message is marked as failed if an internal error occurs before the message is passed on to downstream carriers. A message is marked as sent when the message is successfully passed to a downstream carrier. The message is marked delivered or undelivered based on the delivery receipt received from the carrier. Note that delivery receipts are not universally supported across countries, number types, and mobile networks. The final status of a message may remain as sent in cases where delivery receipts are not received. For WhatsApp messages only, a message is marked as read when a user reads an outbound message and the user has read receipts enabled.</p>
        <p>Inbound messages may be in any of the following states: received, delivered, undelivered.</p>
        <p>All inbound messages are initially marked as received. If the Plivo phone number that received the message is associated with an application, and the application has a valid message\_url configured, then the message is forwarded to that URL. The message is marked as delivered on a successful response from the message\_url, else it is marked undelivered.</p>
      </td>
    </tr>

    <tr>
      <td><strong>message\_type<br /> <span>string</span></strong></td>
      <td><p>Set to sms for SMS messages, mms for MMS messages, and whatsapp for WhatsApp messages.</p></td>
    </tr>

    <tr>
      <td><strong>from\_number<br /> <span>string</span></strong></td>

      <td>
        <p>Identifies the source address of the message. For outbound messages, this could be a Plivo phone number, short code, alphanumeric sender ID, or a phone number linked to your WhatsApp Business Account.</p>
        <p>For inbound messages, this is the phone number from which the message to the Plivo phone number was initiated.</p>
      </td>
    </tr>

    <tr>
      <td><strong>conversation\_id<br /> <span>string</span></strong></td>
      <td><p>WhatsApp-only attribute.</p><p>Represents the ID of the conversation to which the given message belongs.</p></td>
    </tr>

    <tr>
      <td><strong>conversation\_origin<br /> <span>string</span></strong></td>

      <td>
        <p>WhatsApp-only attribute.</p>
        <p>Possible values: utility, authentication, marketing, service</p>
        <p>Describes how a WhatsApp conversation was initiated.</p>
        <p>service conversations are initiated when a user sends a message to the business.</p>
        <p>utility, authentication, and marketing conversations are initiated when a business sends a message to users using a template in the respective category.</p>
      </td>
    </tr>

    <tr>
      <td><strong>conversation\_expiry\_timestamp<span>string</span></strong></td>
      <td><p>WhatsApp-only attribute.</p><p>Unix timestamp applies when the current conversation expires. This is 24 hours after the conversation started. A conversation is considered started when you send the first outbound message.</p></td>
    </tr>

    <tr>
      <td><strong>to\_number<br /> <span>string</span></strong></td>
      <td><p>The destination phone number to which the message was sent. For inbound messages, this is the Plivo phone number on which the message was received.</p></td>
    </tr>

    <tr>
      <td><strong>destination\_country\_iso2<br /> <span>string</span></strong></td>
      <td><p>The ISO2 code of the country associated with the destination number.</p></td>
    </tr>

    <tr>
      <td><strong>units<br /> <span>integer</span></strong></td>
      <td><p>Indicates the number of units that a message was split into.</p></td>
    </tr>

    <tr>
      <td><strong>total\_rate<br /> <span>string</span></strong></td>
      <td><p>The charge applicable per unit of the message.</p></td>
    </tr>

    <tr>
      <td><strong>total\_amount<br /> <span>string</span></strong></td>
      <td><p>The total amount charged for this message. Typically, this is equal to the product of total\_rate and units.</p></td>
    </tr>

    <tr>
      <td><strong>requester\_ip<br /> <span>string</span></strong></td>
      <td><p>The IP address from which the message request originated. We recommend you monitor this field to identify possible account misuse and authentication credential takeovers.</p></td>
    </tr>

    <tr>
      <td><strong>error\_code<br /> <span>string</span></strong></td>

      <td>
        <p>The Plivo SMS error code that helps identify the cause for a message delivery failure. For successfully delivered messages, this attribute is set to 000. For failed and undelivered messages it’s set to one of <a href="/docs/messaging/troubleshooting/error-codes">these error codes</a>.</p>
      </td>
    </tr>

    <tr>
      <td><strong>tendlc\_registration\_status<br /> <span>string</span></strong></td>
      <td><p>Indicates nature of 10DLC registration for that message. Relevant only for long code messaging in the US.</p></td>
    </tr>

    <tr>
      <td><strong>tendlc\_campaign\_id<br /> <span>string</span></strong></td>
      <td><p>The campaign ID associated with the message. Relevant only for long code messaging in the US.</p></td>
    </tr>

    <tr>
      <td><strong>replaced\_sender<span>string</span></strong></td>
      <td><p>Sender ID (numeric or alphanumeric) that left Plivo’s system. In some instances, Plivo replaces the sender to ensure compliance and deliverability.</p></td>
    </tr>

    <tr>
      <td><strong>is\_domestic<span>boolean</span></strong></td>
      <td><p>Indicates whether a message is treated as domestic. Relevant only for long code messaging in India. The value of the field is derived from the way the organization classifies the sender ID at registration.</p></td>
    </tr>

    <tr>
      <td><strong>dlt\_entity\_id<span>string</span></strong></td>
      <td><p>Deprecated. Plivo no longer supports domestic India SMS via DLT. Retained in the message object for messages sent before deprecation.</p></td>
    </tr>

    <tr>
      <td><strong>dlt\_template\_id<span>string</span></strong></td>
      <td><p>Deprecated. Plivo no longer supports domestic India SMS via DLT. Retained in the message object for messages sent before deprecation.</p></td>
    </tr>

    <tr>
      <td><strong>dlt\_template\_category <span>string</span></strong></td>
      <td><p>Deprecated. Plivo no longer supports domestic India SMS via DLT. Retained in the message object for messages sent before deprecation.</p></td>
    </tr>

    <tr>
      <td><strong>destination\_network <span>string</span></strong></td>
      <td><p>Indicates the carrier network for the recipient number you are sending messages to.</p></td>
    </tr>

    <tr>
      <td><strong>carrier\_fees\_rate <span>string</span></strong></td>
      <td><p>The carrier surcharge fee applicable per unit of the message.</p></td>
    </tr>

    <tr>
      <td><strong>carrier\_fees<br /> <span>string</span></strong></td>
      <td><p>The total carrier surcharge fee charged for this message. Typically, this is equal to the product of carrier\_fees\_rate and units.</p></td>
    </tr>

    <tr>
      <td><strong>log<br /> <span>string</span></strong></td>

      <td>
        <p>For outbound messages, the data logging preferences were set in the message request. For inbound messages, preferences were set during the application setup as shown <a href="https://docs.plivo.com/docs/messaging/concepts/sms-data-redaction#how-to-enable-inbound-sms-and-mms-redaction">here</a>.</p>
        <p>Possible values: true, false, content\_only, number\_only If set to true, this message’s phone number and content data (text and media) will be logged on Plivo’s infrastructure.</p>
        <p>If set to false, this message's phone number and content data (text and media) will not be logged on Plivo’s infrastructure, and the value will be masked (for example, +141XXXXX528). Media URLs will not be logged for MMS messages, and the message's media sub-resource will return an empty list.</p>
        <p>If set to content\_only, this message's content data (text and media) will be logged on Plivo’s infrastructure. Phone number data will be masked. This is applicable for outbound messages only.</p>
        <p>If set to number\_only, the phone number data of this message will be logged on Plivo’s infrastructure. Content data (text and media) will be masked. This is applicable for outbound messages only.</p>
      </td>
    </tr>
  </tbody>
</table>

### Example Object

```json theme={null}
{
    "api_id": "85a704c8-e47a-11eb-9a69-0242ac110004",
    "carrier_fees": "0.00000",
    "carrier_fees_rate":"0.0000",
    "error_code": "000",
    "from_number": "17087654321",
    "is_domestic": true,
    "mcc": "312",
    "message_direction": "outbound",
    "message_state": "delivered",
    "message_time": "2021-07-13 13:04:06.799021+05:30",
    "message_type": "whatsapp",
    "message_uuid": "b48d95dc-e3ac-11eb-a9c2-0242ac110005",
    "mnc": "650",
    "powerpack_id": "1d5f3dd8-b207-4738-b59f-3c2ac7d3461c",
    "resource_uri": "/v1/Account/{auth_id}/Message/b48d95dc-e3ac-11eb-a9c2-0242ac110005/",
    "to_number": "12401234567",
    "total_amount": "0.00140",
    "total_rate": "0.00140",
    "tendlc_campaign_id": "CD4WJJD",
    "tendlc_registration_status": "registered",
    "destination_country_iso2": "US",
    "units": 1,
    "replaced_sender": "",
    "dlt_entity_id": "",
    "dlt_template_id": "",
    "dlt_template_category": "",
    "conversation_id": "d0dfd12bed80dca89636268d0a67c383",
    "conversation_origin": "utility",
    "conversation_expiry_time": "2023-05-26 18:54:00.000000",
    "requester_ip": "192.168.0.1",
    "log":"true",
    "destination_network": "verizon"
}
```
