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

# Reactions

> Add or remove a standard or custom reaction on one Message part.

React to an exact Message part.

## Add a reaction

<CodeGroup>
  ```typescript TypeScript SDK theme={null}
  await relay.messages.addReaction(messageId, {
    operation: "add",
    type: "love",
    part_index: 0,
  });
  ```

  ```bash cURL theme={null}
  curl -sS -X POST \
    https://api.relayapp.im/v1/messages/$MESSAGE_ID/reactions \
    -H "Authorization: Bearer $RELAY_AGENT_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "operation":"add",
      "type":"love",
      "part_index":0
    }'
  ```
</CodeGroup>

## Reaction types

| Type        | Meaning                     |
| ----------- | --------------------------- |
| `love`      | Heart                       |
| `like`      | Thumbs up                   |
| `dislike`   | Thumbs down                 |
| `laugh`     | Laugh                       |
| `emphasize` | Emphasis                    |
| `question`  | Question                    |
| `custom`    | Unicode from `custom_emoji` |

## Remove a reaction

Send the same `type`, `custom_emoji`, and `part_index` with
`operation: "remove"`.

<CodeGroup>
  ```typescript TypeScript SDK theme={null}
  await relay.messages.addReaction(messageId, {
    operation: "remove",
    type: "love",
    part_index: 0,
  });
  ```

  ```bash cURL theme={null}
  curl -sS -X POST \
    https://api.relayapp.im/v1/messages/$MESSAGE_ID/reactions \
    -H "Authorization: Bearer $RELAY_AGENT_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{"operation":"remove","type":"love","part_index":0}'
  ```
</CodeGroup>

Repeated add or remove operations are idempotent. Each Contact has one current reaction slot per Message part.

## Events

Agents can subscribe to:

* `reaction.added`
* `reaction.removed`

## Related

* [Webhook events](/guides/webhooks/events)
* [Replies](/guides/messaging/replies)
