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

# Add Reaction

> Add emoji reaction to a message

## Description

This endpoint allows adding an emoji reaction to a specific message in a chat. To remove a reaction, send an empty string in the `reaction` field.

**Note:** This endpoint uses the HTTP `PUT` method, not `POST`.

## Body

```json theme={null}
{
  "sessionId": "my-session",
  "jid": "5511999999999@s.whatsapp.net",
  "messageId": "3EB0XXXXXX",
  "sender": "value",
  "reaction": "value"
}
```

### Body Parameters

| Property    | Type     | Required | Description                                                                                                          |
| ----------- | -------- | -------- | -------------------------------------------------------------------------------------------------------------------- |
| `sessionId` | `string` | ✅ Yes    | Authenticated session ID that will add the reaction                                                                  |
| `jid`       | `string` | ✅ Yes    | Chat identifier (WhatsApp JID). Format: `5511999999999@s.whatsapp.net` for contacts or `120363XXXXX@g.us` for groups |
| `messageId` | `string` | ✅ Yes    | Message ID que receberá a reaction                                                                                   |
| `sender`    | `string` | ✅ Yes    | JID do remetente da message original                                                                                 |
| `reaction`  | `string` | ✅ Yes    | Emoji da reaction (example: `❤️`, `👍`, `😂`). Use string vazia (`""`) para remover a reaction                       |

<ResponseExample>
  ```json Success Response theme={null}
  {
    "success": true
  }
  ```
</ResponseExample>

## Status Codes

* `200` - Reaction adicionada/removed successfully
* `400` - Invalid parameters
* `401` - Unauthorized session
* `404` - Session not found

## Usage Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT https://api.wappfy.com.br/api/reaction \
    -H "Content-Type: application/json" \
    -d '{
      "sessionId": "my-session",
      "jid": "5511999999999@s.whatsapp.net",
      "messageId": "3EB0XXXXXX",
      "sender": "5511999999999@s.whatsapp.net",
      "reaction": "❤️"
    }'
  ```

  ```javascript JavaScript theme={null}
  // Add reaction
  const response = await fetch('https://api.wappfy.com.br/api/reaction', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      sessionId: 'my-session',
      jid: '5511999999999@s.whatsapp.net',
      messageId: '3EB0XXXXXX',
      sender: '5511999999999@s.whatsapp.net',
      reaction: '❤️'
    })
  });
  const data = await response.json();
  console.log(data);

  // Remove reaction
  const removeReaction = await fetch('https://api.wappfy.com.br/api/reaction', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      sessionId: 'my-session',
      jid: '5511999999999@s.whatsapp.net',
      messageId: '3EB0XXXXXX',
      sender: '5511999999999@s.whatsapp.net',
      reaction: ''
    })
  });
  ```

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

  # Add reaction
  response = requests.put(
      'https://api.wappfy.com.br/api/reaction',
      json={
          'sessionId': 'my-session',
          'jid': '5511999999999@s.whatsapp.net',
          'messageId': '3EB0XXXXXX',
          'sender': '5511999999999@s.whatsapp.net',
          'reaction': '❤️'
      }
  )
  data = response.json()
  print(data)

  # Remove reaction
  remove_response = requests.put(
      'https://api.wappfy.com.br/api/reaction',
      json={
          'sessionId': 'my-session',
          'jid': '5511999999999@s.whatsapp.net',
          'messageId': '3EB0XXXXXX',
          'sender': '5511999999999@s.whatsapp.net',
          'reaction': ''
      }
  )
  ```
</CodeGroup>


## OpenAPI

````yaml viewer-en.json put /api/reaction
openapi: 3.1.0
info:
  title: Wappfy - WhatsApp HTTP API
  version: '2.0'
  contact: {}
servers:
  - url: https://{host}
    description: Customizable Server
    variables:
      host:
        default: api.wappfy.com.br
        description: Server URL (e.g., api.wappfy.com.br or your-server.com)
security:
  - api_key: []
tags:
  - name: 🖥️ Sessions
    description: Control WhatsApp sessions (accounts)
  - name: 🔑 Auth
    description: Authentication
  - name: 🆔 Profile
    description: Your profile information
  - name: 🖼️ Screenshot
    description: Get WhatsApp screenshot and display QR code
  - name: 📤 Chatting
    description: Conversation methods
  - name: 📢 Channels
    description: Channels (newsletters) methods
  - name: 🟢 Status
    description: Status (aka stories) methods
  - name: 💬 Chats
    description: Conversations methods
  - name: 👤 Contacts
    description: |-
      Contacts methods.<br>
                      Use phone number (without +) or phone number and `@c.us` at the end as `contactId`.<br>
                      E.g: `12312312310` OR `12312312310@c.us`<br>
  - name: 👥 Groups
    description: Groups methods.<br>
  - name: ✅ Presence
    description: Presence information
  - name: 📅 Events
    description: Event Message
  - name: 🏷️ Labels
    description: Labels - available only for WhatsApp Business accounts
  - name: 🔍 Observability
    description: Other methods
  - name: 🗄️ Storage
    description: Storage methods
externalDocs:
  description: Wappfy - WhatsApp API
  url: https://docs.wappfy.com.br/
paths:
  /api/reaction:
    put:
      tags:
        - 📤 Chatting
      summary: React to a message with an emoji
      operationId: ChattingController_setReaction
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MessageReactionRequest'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
      security:
        - api_key: []
components:
  schemas:
    MessageReactionRequest:
      type: object
      properties:
        messageId:
          type: string
          description: Message ID that will receive the reaction
          example: false_5511999999999@c.us_AAAAAAAAAAAAAAAAAAAA
        reaction:
          type: string
          description: Reaction emoji. Send an empty string to remove the reaction
          example: 👍
        session:
          type: string
          example: my-session
          description: Session name (instanceName)
      required:
        - messageId
        - reaction
        - session
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: apikey
      description: Your Wappfy API key (get it at dash.wappfy.com.br)

````