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

# Send Reaction

> React with an emoji to a specific message (or remove the reaction)

**Auth:** `TokenAccount` or `TokenInstance` • **Rate-limit:** `Global` (100/min) • **Idempotent:** no

## Description

Adds or removes a reaction (emoji) on an existing message. The `reaction` field accepts the emoji (`"👍"`, `"❤️"`, `"😂"`, etc.) or the literal string `"remove"` to remove the reaction. In 1-to-1 chats, `messageId` + `fromMe` is enough. In **groups**, when the original message **was not sent by the instance** (`fromMe: false`), you must provide `participant` with the original author's JID, without it, WhatsApp can't locate the target. Reactions **do not support** `delay`, `replyTo` or `mention`.

## Examples

### React in a 1-to-1 chat

`fromMe: false` indicates that the target message was received (not sent) by the instance.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://ryzeapi.cloud/api/message/reaction/$Instance_Name" \
    -H "token: $Token_Instance" \
    -H "Content-Type: application/json" \
    -d '{
      "number":    "5511999999999",
      "messageId": "3EB08FCF27E532F1B0F5",
      "reaction":  "👍",
      "fromMe":    false
    }'
  ```

  ```javascript JavaScript theme={null}
  await fetch(`https://ryzeapi.cloud/api/message/reaction/${process.env.Instance_Name}`, {
    method: "POST",
    headers: {
      "token":        process.env.Token_Instance,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      number:    "5511999999999",
      messageId: "3EB08FCF27E532F1B0F5",
      reaction:  "👍",
      fromMe:    false
    })
  });
  ```

  ```python Python theme={null}
  import os, requests

  requests.post(
      f"https://ryzeapi.cloud/api/message/reaction/{os.environ['Instance_Name']}",
      headers={
          "token":        os.environ["Token_Instance"],
          "Content-Type": "application/json"
      },
      json={
          "number":    "5511999999999",
          "messageId": "3EB08FCF27E532F1B0F5",
          "reaction":  "👍",
          "fromMe":    False
      }
  )
  ```

  ```go Go theme={null}
  package main

  import (
      "net/http"
      "os"
      "strings"
  )

  func main() {
      body := strings.NewReader(`{
          "number":    "5511999999999",
          "messageId": "3EB08FCF27E532F1B0F5",
          "reaction":  "👍",
          "fromMe":    false
      }`)
      req, _ := http.NewRequest("POST", "https://ryzeapi.cloud/api/message/reaction/"+os.Getenv("Instance_Name"), body)
      req.Header.Set("token", os.Getenv("Token_Instance"))
      req.Header.Set("Content-Type", "application/json")
      http.DefaultClient.Do(req)
  }
  ```
</CodeGroup>

### React in a group (message from another participant)

In groups, when you react to a message that **isn't yours** (`fromMe: false`), the `participant` with the original author's JID is **required**. Without it the server returns `400 missing_participant`.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://ryzeapi.cloud/api/message/reaction/$Instance_Name" \
    -H "token: $Token_Instance" \
    -H "Content-Type: application/json" \
    -d '{
      "number":      "120363406289005073@g.us",
      "messageId":   "3EB08FCF27E532F1B0F5",
      "reaction":    "❤️",
      "fromMe":      false,
      "participant": "5511888888888@s.whatsapp.net"
    }'
  ```

  ```javascript JavaScript theme={null}
  await fetch(`https://ryzeapi.cloud/api/message/reaction/${process.env.Instance_Name}`, {
    method: "POST",
    headers: {
      "token":        process.env.Token_Instance,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      number:      "120363406289005073@g.us",
      messageId:   "3EB08FCF27E532F1B0F5",
      reaction:    "❤️",
      fromMe:      false,
      participant: "5511888888888@s.whatsapp.net"
    })
  });
  ```

  ```python Python theme={null}
  import os, requests

  requests.post(
      f"https://ryzeapi.cloud/api/message/reaction/{os.environ['Instance_Name']}",
      headers={
          "token":        os.environ["Token_Instance"],
          "Content-Type": "application/json"
      },
      json={
          "number":      "120363406289005073@g.us",
          "messageId":   "3EB08FCF27E532F1B0F5",
          "reaction":    "❤️",
          "fromMe":      False,
          "participant": "5511888888888@s.whatsapp.net"
      }
  )
  ```

  ```go Go theme={null}
  package main

  import (
      "net/http"
      "os"
      "strings"
  )

  func main() {
      body := strings.NewReader(`{
          "number":      "120363406289005073@g.us",
          "messageId":   "3EB08FCF27E532F1B0F5",
          "reaction":    "❤️",
          "fromMe":      false,
          "participant": "5511888888888@s.whatsapp.net"
      }`)
      req, _ := http.NewRequest("POST", "https://ryzeapi.cloud/api/message/reaction/"+os.Getenv("Instance_Name"), body)
      req.Header.Set("token", os.Getenv("Token_Instance"))
      req.Header.Set("Content-Type", "application/json")
      http.DefaultClient.Do(req)
  }
  ```
</CodeGroup>

### Remove a reaction

Send `reaction: "remove"` to clear a reaction previously placed on the message.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://ryzeapi.cloud/api/message/reaction/$Instance_Name" \
    -H "token: $Token_Instance" \
    -H "Content-Type: application/json" \
    -d '{
      "number":    "5511999999999",
      "messageId": "3EB08FCF27E532F1B0F5",
      "reaction":  "remove",
      "fromMe":    true
    }'
  ```

  ```javascript JavaScript theme={null}
  await fetch(`https://ryzeapi.cloud/api/message/reaction/${process.env.Instance_Name}`, {
    method: "POST",
    headers: {
      "token":        process.env.Token_Instance,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      number:    "5511999999999",
      messageId: "3EB08FCF27E532F1B0F5",
      reaction:  "remove",
      fromMe:    true
    })
  });
  ```

  ```python Python theme={null}
  import os, requests

  requests.post(
      f"https://ryzeapi.cloud/api/message/reaction/{os.environ['Instance_Name']}",
      headers={
          "token":        os.environ["Token_Instance"],
          "Content-Type": "application/json"
      },
      json={
          "number":    "5511999999999",
          "messageId": "3EB08FCF27E532F1B0F5",
          "reaction":  "remove",
          "fromMe":    True
      }
  )
  ```

  ```go Go theme={null}
  package main

  import (
      "net/http"
      "os"
      "strings"
  )

  func main() {
      body := strings.NewReader(`{
          "number":    "5511999999999",
          "messageId": "3EB08FCF27E532F1B0F5",
          "reaction":  "remove",
          "fromMe":    true
      }`)
      req, _ := http.NewRequest("POST", "https://ryzeapi.cloud/api/message/reaction/"+os.Getenv("Instance_Name"), body)
      req.Header.Set("token", os.Getenv("Token_Instance"))
      req.Header.Set("Content-Type", "application/json")
      http.DefaultClient.Do(req)
  }
  ```
</CodeGroup>

## Success response

The returned `messageId` is for the **reaction itself** (not the reacted message, that one stays in `replyTo.messageId`). `content` carries the applied emoji, or an empty string when the reaction was removed.

```json 200 OK theme={null}
{
  "success": true,
  "message": "Reaction sent successfully",
  "status":  "sent",
  "data": {
    "messageId":   "3EB08FCF27E532F1C2C2",
    "direction":   "sent",
    "messageType": "reaction",
    "content":     "👍",
    "source":      "api",
    "timestamp":   "2026-04-30T14:30:00Z",
    "chat": {
      "jid":     "5511999999999@s.whatsapp.net",
      "isGroup": false
    },
    "sender": {
      "jid":      "5511777777777@s.whatsapp.net",
      "instance": "my-instance"
    },
    "replyTo": {
      "messageId": "3EB08FCF27E532F1B0F5"
    }
  }
}
```

<Note>
  When the reaction is removed (`reaction: "remove"`), the returned `message` becomes `"Reaction removed successfully"` and `content` is empty. The reaction appears on the recipient anchored to the original message, if you react again with another emoji, WhatsApp **replaces** the previous reaction.
</Note>

## Path parameters

<ParamField path="instance" type="string" required>
  Instance name (e.g., `$Instance_Name`).
</ParamField>

## Headers

<ParamField header="token" type="string" required>
  `TokenAccount` or `TokenInstance`.
</ParamField>

<ParamField header="Content-Type" type="string" required>
  `application/json`
</ParamField>

## Request body

<ParamField body="number" type="string" required>
  Chat where the target message lives: phone (`5511999999999`) or JID (`@s.whatsapp.net`, `@lid`, `@g.us`).
</ParamField>

<ParamField body="messageId" type="string" required>
  ID of the message that will receive the reaction.
</ParamField>

<ParamField body="reaction" type="string" required>
  Reaction emoji (e.g., `"👍"`, `"❤️"`, `"😂"`, `"🔥"`) **or** the literal string `"remove"` to clear an existing reaction.
</ParamField>

<ParamField body="fromMe" type="boolean" default="false">
  `true` when the original message was **sent by the instance itself**; `false` when it was received from another contact/participant. WhatsApp uses this flag along with `participant` to locate the target.
</ParamField>

<ParamField body="participant" type="string">
  JID of the original message author (e.g., `5511888888888@s.whatsapp.net`). **Required in groups when `fromMe: false`**, without it the server returns `400 missing_participant`. In 1-to-1 chats or when `fromMe: true`, it's ignored.
</ParamField>

<ParamField body="source" type="string" default="api">
  Origin identifier for traceability (e.g., `crm`, `support-bot`, `n8n`). Saved on the message record and propagated to webhooks.
</ParamField>

## Notes

<Note>
  * Reactions **do not support** `delay`, `replyTo`, `replyPrivate`, `mention` or `mentionAll`, only the fields listed above.
  * To **change** an existing reaction, just send a new one with another emoji. WhatsApp replaces it automatically.
  * In groups, without the correct `participant` the reaction fails with `missing_participant` even if the `messageId` exists in the database.
  * `fromMe` must reflect the actual side of the message. If inverted, WhatsApp may fail to locate the target and the reaction silently disappears on the recipient's app.
</Note>

## Errors

| HTTP | Internal status       | Message                                                         |
| ---- | --------------------- | --------------------------------------------------------------- |
| 400  | ,                     | `Instance name is required`                                     |
| 400  | ,                     | `Invalid request body: <detail>`                                |
| 400  | ,                     | `Number is required`                                            |
| 400  | ,                     | `MessageID is required`                                         |
| 400  | ,                     | `Reaction is required`                                          |
| 400  | `invalid_number`      | `Invalid phone number format: <detail>`                         |
| 400  | `invalid_message_id`  | (reason for invalid messageId)                                  |
| 400  | `missing_participant` | `Participant is required for group reactions when fromMe=false` |
| 404  | ,                     | `Instance not found`                                            |
| 500  | `send_failed`         | `Failed to send reaction: <reason>`                             |
| 503  | `disconnected`        | `Instance is not connected to WhatsApp`                         |

Error envelope:

```json theme={null}
{
  "success": false,
  "error": { "message": "Reaction is required" }
}
```
