> ## 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.

# Manage WhatsApp Messages in Node.js

> React to, star, delete, and forward WhatsApp messages, mark them as seen, and read chats from Node.js with the Hypersender WhatsApp API and its TypeScript 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)](https://docs.hypersender.com/v2/api-reference/whatsapp/send-messages/react-to-message.md)

> [tab] Basic Usage
>
> ```typescript theme={null}
> import { Hypersender } from "hypersender-node";
>
> await Hypersender.whatsapp().reactToMessage({
>   chatId: "20123456789@c.us",
>   messageId: "true_111111111111@c.us_3EB08F6AD2A432386EFA0E",
>   reaction: "🥵",
> });
> ```

> [tab] Parameters
>
> | Parameter | Type | Required | Description |
> | - | - | - | - |
> | chatId | string | yes | The WhatsApp chat ID that contains the message |
> | messageId | string | yes | The ID of the message to react to |
> | reaction | string | yes | The emoji or Unicode reaction to apply |

> [!NOTE]
>
> Set `reaction` parameter to an empty string to remove an existing reaction from a message.

### Star Message

Star or unstar a specific message. [(learn more)](https://docs.hypersender.com/v2/api-reference/whatsapp/send-messages/star-message.md)

> [tab] Basic Usage
>
> ```typescript theme={null}
> import { Hypersender } from "hypersender-node";
>
> await Hypersender.whatsapp().starMessage({
>   chatId: "20123456789@c.us",
>   messageId: "true_111111111111@c.us_3EB08F6AD2A432386EFA0E",
>   star: true,
> });
> ```

> [tab] Parameters
>
> | 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 | boolean | yes | `true` to star the message, `false` to unstar |

> [!NOTE]
>
> By default, messages are unstarred. Set `star` to `true` to star a message,
> or set it to `false` to unstar.

### Delete Message

Delete a message from a chat. [(learn more)](https://docs.hypersender.com/v2/api-reference/whatsapp/send-messages/delete-whatsapp-message.md)

> [tab] Basic Usage
>
> ```typescript theme={null}
> import { Hypersender } from "hypersender-node";
>
> await Hypersender.whatsapp().deleteMessage({
>   chatId: "20123456789@c.us",
>   messageId: "true_111111111111@c.us_3EB08F6AD2A432386EFA0E",
> });
> ```

> [tab] Parameters
>
> | 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 |

### Forward Message

Forward a message to another chat. [(learn more)](https://docs.hypersender.com/v2/api-reference/whatsapp/send-messages/forward-message.md)

> [tab] Basic Usage
>
> ```typescript theme={null}
> import { Hypersender } from "hypersender-node";
>
> await Hypersender.whatsapp().forwardMessage({
>   chatId: "20123456789@c.us",
>   messageId: "true_111111111111@c.us_3EB08F6AD2A432386EFA0E",
> });
> ```

> [tab] Parameters
>
> | 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 |

### Send Seen

Mark a message as seen (read). For group messages, provide the participant JID. [(learn more)](https://docs.hypersender.com/v2/api-reference/whatsapp/send-messages/send-seen.md)

> [tab] Basic Usage
>
> ```typescript theme={null}
> import { Hypersender } from "hypersender-node";
>
> await Hypersender.whatsapp().sendSeen({
>   chatId: "20123456789@c.us",
>   messageId: "true_111111111111@c.us_3EB08F6AD2A432386EFA0E",
>   // participant: "20123456789@c.us", // for group messages
> });
> ```

> [tab] Parameters
>
> | 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 |

### Read Chat

Read a chat history window and optionally mark recent messages as read. [(learn more)](https://docs.hypersender.com/v2/api-reference/whatsapp/send-messages/read-chat.md)

> [tab] Basic Usage
>
> ```typescript theme={null}
> import { Hypersender } from "hypersender-node";
>
> const result = await Hypersender.whatsapp().readChat({
>   messages: "20",
>   body: {
>     chatId: "20123456789@c.us",
>   },
> });
>
> console.log(result.ids);
> ```

> [tab] Parameters
>
> | Parameter | Type | Required | Description |
> | - | - | - | - |
> | body.chatId | string | yes | The chat ID to read |
> | messages | string | no | Number of latest messages to read (latest first) |
> | days | string | no | Number of latest days to read (latest first) |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.