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

# The Message Object

> The message object represents a message sent or received on WhatsApp.

**Attributes**

<ParamField path="message_id" type="string">
  A unique identifier for the message, containing information about the chat, sender, and message details.
</ParamField>

<ParamField path="org_id" type="string">
  The unique identifier of the organization that owns the WhatsApp account.
</ParamField>

<ParamField path="org_phone" type="string">
  The organization phone where the message was sent or received (in the format `{phone_number}@c.us`)
</ParamField>

<ParamField path="ack" type="string">
  The delivery and read status acknowledgment of the message.
  To know more about `ack` statuses, check the [Ack Status Guide](/api-reference/delivery-status)
</ParamField>

<ParamField path="author" type="string">
  The WhatsApp ID of the message author (format: `{phone_number}@c.us`).
</ParamField>

<ParamField path="body" type="string">
  The text content of the message. For media messages, this represents the caption.
</ParamField>

<ParamField path="broadcast" type="boolean | null">
  Indicates if the message was sent as a broadcast message.
</ParamField>

<ParamField path="device_type" type="string">
  The type of device used to send the message (e.g., "android", "ios", "web").
</ParamField>

<ParamField path="flag_status" type="boolean">
  Indicates whether the message has been flagged for attention or review.
</ParamField>

<ParamField path="duration" type="number | null">
  The duration in seconds for audio or video messages. Null for other message types.
</ParamField>

<ParamField path="forwarding_score" type="string">
  The number of times this message has been forwarded.
</ParamField>

<ParamField path="from" type="string">
  The WhatsApp ID of the message sender (format: `{phone_number}@c.us`).
</ParamField>

<ParamField path="from_me" type="boolean">
  Indicates if the message was sent from the organization's WhatsApp account.
</ParamField>

<ParamField path="has_media" type="boolean">
  Indicates if the message contains media content (image, video, audio, or document).
</ParamField>

<ParamField path="has_quoted_msg" type="boolean">
  Indicates if the message is a reply to another message.
</ParamField>

<ParamField path="has_reaction" type="boolean">
  Indicates if the message has received any reactions.
</ParamField>

<ParamField path="id" type="object">
  Detailed identification information for the message.

  <Expandable>
    <ParamField path="id" type="string">
      A unique identifier for this specific message.
    </ParamField>

    <ParamField path="fromMe" type="boolean">
      Indicates if the message was sent by the organization's WhatsApp account.
    </ParamField>

    <ParamField path="remote" type="string">
      The chat or group ID where the message was sent.
    </ParamField>

    <ParamField path="_serialized" type="string">
      A complete serialized string containing all message identifiers.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField path="invite_v4" type="object | null">
  Group invitation details if the message contains a group invite. Null otherwise.
</ParamField>

<ParamField path="is_ephemeral" type="boolean | null">
  Indicates if the message is configured to disappear after a set time.
</ParamField>

<ParamField path="is_forwarded" type="boolean">
  Indicates if the message was forwarded from another chat.
</ParamField>

<ParamField path="is_gif" type="boolean">
  Indicates if the message contains a GIF animation.
</ParamField>

<ParamField path="is_starred" type="boolean">
  Indicates if the message has been starred/favorited.
</ParamField>

<ParamField path="is_status" type="boolean">
  Indicates if the message is a status update.
</ParamField>

<ParamField path="links" type="string">
  JSON string containing an array of URLs found in the message.
</ParamField>

<ParamField path="location" type="object | null">
  Location information if the message contains a shared location.

  <Expandable>
    <ParamField path="latitude" type="number">
      The latitude coordinate of the shared location.
    </ParamField>

    <ParamField path="longitude" type="number">
      The longitude coordinate of the shared location.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField path="media_key" type="string | null">
  Unique identifier for media content if present.
</ParamField>

<ParamField path="mentioned_ids" type="string[]">
  Array of WhatsApp IDs (format: `{phone_number}@c.us`) mentioned in the message.
</ParamField>

<ParamField path="message_type" type="string">
  The type of message content. Possible values: `chat`, `image`, `video`, `audio`, `document`, `ptt`.
</ParamField>

<ParamField path="vcards" type="string[]">
  An array of vCards (virtual contact cards).
</ParamField>

<ParamField path="chat_id" type="string">
  The unique identifier of the chat/group where the message was sent.
</ParamField>

<ParamField path="broadcast_id" type="string">
  A unique identifier for the broadcast session.
</ParamField>

<ParamField path="is_deleted" type="boolean | null">
  Is set to `true` if message is deleted. It is `null` otherwise.
</ParamField>

<ParamField path="media" type="object | null">
  Details about media content if present in the message.

  <Expandable>
    <ParamField path="path" type="string">
      The public URL path to access the media file.
    </ParamField>

    <ParamField path="size" type="number">
      The size of the media file in bytes.
    </ParamField>

    <ParamField path="filename" type="string">
      The unique filename of the media file.
    </ParamField>

    <ParamField path="mimetype" type="string">
      The MIME type of the media content.
    </ParamField>

    <ParamField path="dimensions" type="object">
      Dimensions for image and video content.

      <Expandable>
        <ParamField path="ar" type="number">
          The aspect ratio of the media.
        </ParamField>

        <ParamField path="width" type="number">
          The width of the media in pixels.
        </ParamField>

        <ParamField path="height" type="number">
          The height of the media in pixels.
        </ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

<ParamField path="prev_body" type="string">
  The original content of the message before editing.
</ParamField>

<ParamField path="quoted_message_id" type="string">
  The ID of the message to which this message is replying to.
</ParamField>

<ParamField path="sender_phone" type="string">
  Phone from which the message was sent.
</ParamField>

<ParamField path="sent_message_id" type="string">
  ID of the sent message.
</ParamField>

<ParamField path="delivery_info" type="object">
  Information about message delivery and read status.

  <Expandable>
    <ParamField path="read" type="object">
      Map of phone numbers to timestamps when the message was read.

      <Expandable>
        <ParamField path="[phoneNumber]" type="number">
          Timestamp when the message was read by this recipient (format: `{phone_number}@c.us`).
        </ParamField>
      </Expandable>
    </ParamField>

    <ParamField path="pending" type="string[]">
      Array of recipient WhatsApp IDs who haven't received the message yet.
    </ParamField>

    <ParamField path="delivered" type="object">
      Map of phone numbers to timestamps when the message was delivered.

      <Expandable>
        <ParamField path="[phoneNumber]" type="number">
          Timestamp when the message was delivered to this recipient (format: `{phone_number}@c.us`).
        </ParamField>
      </Expandable>
    </ParamField>

    <ParamField path="read_count" type="number">
      Total number of recipients who have read the message.
    </ParamField>

    <ParamField path="delivered_count" type="number">
      Total number of recipients the message has been delivered to.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField path="flag_metadata" type="object">
  Details about message flagging status.

  <Expandable>
    <ParamField path="status" type="boolean">
      Current flag status of the message.
    </ParamField>

    <ParamField path="response_id" type="string">
      Unique identifier for the flag response.
    </ParamField>

    <ParamField path="response_type" type="string">
      The type of flagged content (e.g., "message").
    </ParamField>

    <ParamField path="response_email" type="string">
      WhatsApp ID of the user who flagged the message (format: `{phone_number}@c.us`).
    </ParamField>

    <ParamField path="response_timestamp" type="string">
      ISO 8601 formatted timestamp when the message was flagged.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField path="poll_info" type="object | null">
  Information about poll messages.

  <Expandable>
    <ParamField path="options" type="object">
      Poll configuration settings.

      <Expandable>
        <ParamField path="allowMultipleAnswers" type="boolean">
          Indicates if users can select multiple poll options.
        </ParamField>
      </Expandable>
    </ParamField>

    <ParamField path="pollName" type="string">
      The poll question or title.
    </ParamField>

    <ParamField path="pollOptions" type="string[]">
      Array of available poll options.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField path="poll_results" type="object">
  Results of the poll voting.

  <Expandable>
    <ParamField path="[optionName]" type="object">
      Voting data for each poll option.

      <Expandable>
        <ParamField path="[phoneNumber]" type="string">
          ISO 8601 formatted timestamp when the user voted for this option (format: `{phone_number}@c.us`).
        </ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

<ParamField path="interactive" type="object | null">
  Details about interactive surfaces attached to the message (quick-reply buttons, single-select lists, CTA URL buttons). `null` for non-interactive messages.

  <Expandable>
    <ParamField path="type" type="string">
      The interactive surface kind. One of `button`, `list`, `cta_url`, `unknown`.
    </ParamField>

    <ParamField path="header" type="object">
      Optional header block above the body.

      <Expandable>
        <ParamField path="type" type="string">
          The kind of header. One of `image`, `video`, `document`, `location`, `text`, `unknown`.
        </ParamField>

        <ParamField path="title" type="string">
          The header title text, if provided.
        </ParamField>
      </Expandable>
    </ParamField>

    <ParamField path="bodyText" type="string">
      The main text body of the interactive message. Supports WhatsApp markdown.
    </ParamField>

    <ParamField path="footerText" type="string">
      The small footer line shown beneath the body, above the CTAs.
    </ParamField>

    <ParamField path="buttonText" type="string">
      The label of the CTA that opens the list bottom sheet. Present only when `type` is `list`.
    </ParamField>

    <ParamField path="listType" type="string">
      List variant. One of `SINGLE_SELECT` or `UNKNOWN`.
    </ParamField>

    <ParamField path="buttons" type="array">
      Tap targets attached to the message, in render order.

      <Expandable>
        <ParamField path="id" type="string">
          Stable identifier for the tap target, echoed back in response messages.
        </ParamField>

        <ParamField path="title" type="string">
          The visible button label.
        </ParamField>

        <ParamField path="url" type="string">
          The destination URL for `cta_url` buttons.
        </ParamField>

        <ParamField path="phone" type="string">
          The dial target for call buttons.
        </ParamField>

        <ParamField path="buttonType" type="string">
          The kind of tap target (e.g. `quick_reply`, `cta_url`, `call`, `single_select`). Open-ended — use for analytics, not for rendering logic.
        </ParamField>
      </Expandable>
    </ParamField>

    <ParamField path="listSections" type="array">
      Sections of rows for `list` surfaces, in render order.

      <Expandable>
        <ParamField path="title" type="string">
          The header above a group of rows.
        </ParamField>

        <ParamField path="rows" type="array">
          The selectable rows within this section.

          <Expandable>
            <ParamField path="id" type="string">
              Stable identifier used to know which row was tapped.
            </ParamField>

            <ParamField path="title" type="string">
              The visible row title.
            </ParamField>

            <ParamField path="description" type="string">
              Secondary line shown under the row title.
            </ParamField>
          </Expandable>
        </ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

<ParamField path="performed_by" type="string">
  Email address of the user who sent the message through Periskope.
</ParamField>

<ParamField path="timestamp" type="string">
  ISO 8601 formatted timestamp when the message was sent.
</ParamField>

<ParamField path="updated_at" type="string">
  ISO 8601 formatted timestamp when the message was last updated.
</ParamField>

<ParamField path="unique_id" type="string">
  A unique identifier for the message, matching the `id.id` field.
</ParamField>

<ResponseExample>
  ```json The Message Object theme={null}
  {
    "message_id": "true_12036329726967XXXX@g.us_3EB01F4653XX9XX05E9859_9190043XXXXX@c.us",
    "org_id": "2997xx64-89bf-48d3-9a22-b314fxx017e5",
    "ack": "2",
    "author": "9190043XXXXX@c.us",
    "body": "Hello, world",
    "broadcast": null,
    "device_type": "android",
    "flag_status": false,
    "duration": null,
    "forwarding_score": "0",
    "from": "9190043XXXXX@c.us",
    "from_me": true,
    "has_media": true,
    "has_quoted_msg": false,
    "has_reaction": false,
    "id": {
      "id": "3EB01F4653XX9XX05E9859",
      "fromMe": true,
      "remote": "12036329726967XXXX@g.us",
      "_serialized": "true_12036329726967XXXX@g.us_3EB01F4653XX9XX05E9859_9190043XXXXX@c.us"
    },
    "invite_v4": null,
    "is_ephemeral": null, //disappearing messages
    "is_forwarded": false,
    "is_gif": false,
    "is_starred": false,
    "is_status": false,
    "links": "[]",
    "location": null,
    "media_key": null,
    "mentioned_ids": [],
    "order_id": null,
    "raw_data": null,
    "to": "12036329726967XXXX@g.us",
    "token": null,
    "message_type": "image",
    "vcards": [],
    "chat_id": "12036329726967XXXX@g.us",
    "timestamp": "2024-05-13 11:19:34+00",
    "org_phone": "9190043XXXXX@c.us",
    "broadcast_id": null,
    "is_deleted": null,
    "media": {
      "path": "/storage/v1/object/public/message-media/2997xx64-89bf-48d3-9a22-b314fxx017e5/12036329726967XXXX@g.us/true_12036329726967XXXX@g.us_3EB01F4653XX9XX05E9859_9190043XXXXX@c.us/dbd33c9e-bedc-4df7-8a4c-f9eadf957ac9",
      "size": 19940,
      "filename": "dbd33c9e-bedc-4df7-8a4c-f9eadf957ac9",
      "mimetype": "image/jpeg",
      "dimensions": {
        "ar": 1,
        "width": 512,
        "height": 512
      }
    },
    "performed_by": "harsh.gour@hashlabs.dev",
    "prev_body": null,
    "quoted_message_id": null,
    "sender_phone": "9190043XXXXX@c.us",
    "sent_message_id": "f7b10126-5d5e-432f-941c-94ced28debac",
    "delivery_info": {
      "read": {
         "919XXXXXXXXXXX@c.us": 1731984657443
      },
      "pending": [
        "9184XXXXXXXXXX@c.us",
        "919XXXXXXXXXXX@c.us"
      ],
      "delivered": {
        "919XXXXXXXXXXX@c.us": 1731214159000,
        "919XXXXXXXXXXX@c.us": 1731195010000,
        "919XXXXXXXXXXX@c.us": 1731175846000,
        "919XXXXXXXXXXX@c.us": 1731175848000,
        "919XXXXXXXXXXX@c.us": 1731175847000
      },
      "read_count": 0,
      "delivered_count": 5
    },
     "flag_metadata": {
      "status": false,
      "response_id": "3A1AXXXXXXXXXX",
      "response_type": "message",
      "response_email": "91XXXXXXXXX@c.us",
      "response_timestamp": "2024-11-26T15:16:32.179Z"
    },
    "poll_info": {
      "options": {
        "allowMultipleAnswers": true
      },
      "pollName": "pollQuestion",
      "pollOptions": [
        "option1",
        "option2",
        "option3"
      ]
    },
    "poll_results": {
      "option1": {
        "91903XXXXXX0@c.us": "2024-05-24T15:24:11.336Z"
      },
      "option2": {},
      "option3": {}
    },
    "interactive": null,
    "updated_at": "2024-05-13 11:19:36.114+00",
    "message_ticket_id": null,
    "unique_id": "3EB01F4653XX9XX05E9859"
  }
  ```
</ResponseExample>
