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

# Message Management

> Control and interact with messages after they've been sent in WhatsApp using the Laravel SDK

## Overview

Manage sent messages programmatically: react, star, delete, forward, mark as seen, and read chat history.

### React to Message

React to a WhatsApp message with an emoji. [(learn more)](/api-reference/whatsapp/send-messages/react-to-message)

<Tabs>
  <Tab title="Basic Usage" icon="code">
    ```php theme={null}
    use Hypersender\Hypersender;

    Hypersender::whatsapp()
      ->reactToMessage(
          messageId: 'true_111111111111@c.us_3EB08F6AD2A432386EFA0E',
          reaction: '🥵',
      );
    ```
  </Tab>

  <Tab title="Parameters" icon="sliders">
    | Parameter | Type   | Required | Description                            |
    | --------- | ------ | -------- | -------------------------------------- |
    | messageId | string | yes      | The ID of the message to react to      |
    | reaction  | string | yes      | The emoji or Unicode reaction to apply |
  </Tab>
</Tabs>

<Note>
  Set `reaction` parameter to an empty string to remove an existing reaction from a message.
</Note>

### Star Message

Star or unstar a specific message.

<Tabs>
  <Tab title="Basic Usage" icon="code">
    ```php theme={null}
    use Hypersender\Hypersender;

    Hypersender::whatsapp()
      ->star(
          chatId: '20123456789@c.us',
          messageId: 'true_111111111111@c.us_3EB08F6AD2A432386EFA0E',
          star: true,
      );
    ```
  </Tab>

  <Tab title="Parameters" icon="sliders">
    | Parameter | Type   | Required | Description                                    |
    | --------- | ------ | -------- | ---------------------------------------------- |
    | chatId    | string | yes      | The WhatsApp chat ID that contains the message |
    | messageId | string | yes      | The ID of the message to star/unstar           |
    | star      | bool   | yes      | true to star the message, false to unstar      |
  </Tab>
</Tabs>

<Note>
  By default, messages are unstarred. Set `star` to `true` to star a message.
  or set it to `false` to unstar.
</Note>

### Delete Message

Delete a message from a chat. [(learn more)](/api-reference/whatsapp/send-messages/delete-message)

<Tabs>
  <Tab title="Basic Usage" icon="code">
    ```php theme={null}
    use Hypersender\Hypersender;

    Hypersender::whatsapp()
      ->deleteMessage(
          chatId: '20123456789@c.us',
          messageId: 'true_111111111111@c.us_3EB08F6AD2A432386EFA0E',
      );
    ```
  </Tab>

  <Tab title="Parameters" icon="sliders">
    | Parameter | Type   | Required | Description                                    |
    | --------- | ------ | -------- | ---------------------------------------------- |
    | chatId    | string | yes      | The WhatsApp chat ID that contains the message |
    | messageId | string | yes      | The ID of the message to delete                |
  </Tab>
</Tabs>

### Forward Message

Forward a message to another chat. [(learn more)](/api-reference/whatsapp/send-messages/forward-message)

<Tabs>
  <Tab title="Basic Usage" icon="code">
    ```php theme={null}
    use Hypersender\Hypersender;

    Hypersender::whatsapp()
      ->forwardMessage(
          chatId: '20123456789@c.us',
          messageId: 'true_111111111111@c.us_3EB08F6AD2A432386EFA0E',
      );
    ```
  </Tab>

  <Tab title="Parameters" icon="sliders">
    | Parameter | Type   | Required | Description                                       |
    | --------- | ------ | -------- | ------------------------------------------------- |
    | chatId    | string | yes      | The destination chat ID to forward the message to |
    | messageId | string | yes      | The ID of the message to forward                  |
  </Tab>
</Tabs>

### Send Seen

Mark a message as seen (read). For group messages, provide the participant JID.

<Tabs>
  <Tab title="Basic Usage" icon="code">
    ```php theme={null}
    use Hypersender\Hypersender;

    Hypersender::whatsapp()
      ->sendSeen(
          chatId: '20123456789@c.us',
          messageId: 'true_111111111111@c.us_3EB08F6AD2A432386EFA0E',
          participant: null, // e.g. '20123456789@c.us' for group messages
      );
    ```
  </Tab>

  <Tab title="Parameters" icon="sliders">
    | Parameter   | Type   | Required | Description                           |
    | ----------- | ------ | -------- | ------------------------------------- |
    | chatId      | string | yes      | The chat ID that contains the message |
    | messageId   | string | yes      | The message ID to mark as seen        |
    | participant | string | no       | Participant JID for group messages    |
  </Tab>
</Tabs>

### Read Chat

Read a chat history window and optionally mark recent messages as read. [(learn more)](/api-reference/whatsapp/send-messages/read-chat)

<Tabs>
  <Tab title="Basic Usage" icon="code">
    ```php theme={null}
    use Hypersender\Hypersender;

    Hypersender::whatsapp()
      ->readChat(
          chatId: '20123456789@c.us',
          messages: 20,
          days: null,
      );
    ```
  </Tab>

  <Tab title="Parameters" icon="sliders">
    | Parameter | Type   | Required | Description                                      |
    | --------- | ------ | -------- | ------------------------------------------------ |
    | chatId    | string | yes      | The chat ID to read                              |
    | messages  | int    | no       | Number of latest messages to read (latest first) |
    | days      | int    | no       | Number of latest days to read (latest first)     |
  </Tab>
</Tabs>
