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

> React to, star, delete, and forward WhatsApp messages, mark them as seen, and read chats from Python with the Hypersender WhatsApp API and its Python 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
>
> ```python theme={null}
> from hypersender import Hypersender
>
> hs = Hypersender()
>
> hs.whatsapp.react_to_message(
>     "20123456789@c.us",
>     "true_111111111111@c.us_3EB08F6AD2A432386EFA0E",
>     "🥵",
> )
> ```

> [tab] Parameters
>
> | Parameter | Type | Required | Description |
> | - | - | - | - |
> | chat\_id | str | yes | The WhatsApp chat ID that contains the message |
> | message\_id | str | yes | The ID of the message to react to |
> | reaction | str | 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
>
> ```python theme={null}
> from hypersender import Hypersender
>
> hs = Hypersender()
>
> hs.whatsapp.star_message(
>     "20123456789@c.us",
>     "true_111111111111@c.us_3EB08F6AD2A432386EFA0E",
>     star=True,
> )
> ```

> [tab] Parameters
>
> | Parameter | Type | Required | Description |
> | - | - | - | - |
> | chat\_id | str | yes | The WhatsApp chat ID that contains the message |
> | message\_id | str | yes | The ID of the message to star/unstar |
> | star | bool | no | `True` to star the message (default), `False` to unstar |

> [!NOTE]
>
> By default, messages are unstarred. Call `star_message` to star a message,
> or pass `star=False` to unstar it.

### 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
>
> ```python theme={null}
> from hypersender import Hypersender
>
> hs = Hypersender()
>
> hs.whatsapp.delete_message(
>     "20123456789@c.us",
>     "true_111111111111@c.us_3EB08F6AD2A432386EFA0E",
> )
> ```

> [tab] Parameters
>
> | Parameter | Type | Required | Description |
> | - | - | - | - |
> | chat\_id | str | yes | The WhatsApp chat ID that contains the message |
> | message\_id | str | 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
>
> ```python theme={null}
> from hypersender import Hypersender
>
> hs = Hypersender()
>
> hs.whatsapp.forward_message(
>     "20123456789@c.us",
>     "true_111111111111@c.us_3EB08F6AD2A432386EFA0E",
> )
> ```

> [tab] Parameters
>
> | Parameter | Type | Required | Description |
> | - | - | - | - |
> | chat\_id | str | yes | The destination chat ID to forward the message to |
> | message\_id | str | 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
>
> ```python theme={null}
> from hypersender import Hypersender
>
> hs = Hypersender()
>
> hs.whatsapp.send_seen(
>     "20123456789@c.us",
>     "true_111111111111@c.us_3EB08F6AD2A432386EFA0E",
>     # participant="20123456789@c.us",  # for group messages
> )
> ```

> [tab] Parameters
>
> | Parameter | Type | Required | Description |
> | - | - | - | - |
> | chat\_id | str | yes | The chat ID that contains the message |
> | message\_id | str | yes | The message ID to mark as seen |
> | participant | str | no | Participant JID for group messages (keyword-only) |

### 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
>
> ```python theme={null}
> from hypersender import Hypersender
>
> hs = Hypersender()
>
> result = hs.whatsapp.read_chat("20123456789@c.us", messages=20)
>
> print(result["ids"])
> ```

> [tab] Parameters
>
> | Parameter | Type | Required | Description |
> | - | - | - | - |
> | chat\_id | str | yes | The chat ID to read |
> | messages | int | no | Number of latest messages to read (latest first, keyword-only) |
> | days | int | no | Number of latest days to read (latest first, keyword-only) |


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