# React to a WhatsApp message

`PUT /v1/whatsapp/messages/{message_id}/reaction`

Places an emoji reaction on a message this workspace received, the same way
tapping and holding a message in WhatsApp does.

You hold at most one reaction per message, so this replaces your existing
one rather than adding another. To take a reaction back entirely, delete it.

The `202` means the reaction was accepted, not that WhatsApp applied it.
Reactions carry no delivery or read receipt, so the furthest one gets is
sent. Read the message's `reactions` for what currently stands, or
[List reaction events for a WhatsApp message](/docs/api/reference/list-whatsapp-message-reaction-events)
for what became of each change, including one WhatsApp refused.

Each of these returns a `422`:

- A message this workspace sent. This endpoint places reactions on messages
  the contact sent; reacting to your own outbound message is not supported.
- More than one emoji, since WhatsApp takes exactly one.

A message Bird can no longer resolve returns a `404` instead. WhatsApp
accepts a reaction on a message up to 30 days old, but Bird keeps the
provider id a reaction needs for **15 days**, so that is the practical age
limit. The message and its reaction log stay readable for 30; only the id
a placement needs is gone.

Reactions are not charged for.

## Code samples

### TypeScript

```ts
const reaction = await bird.whatsapp.reaction.set("wam_01krdgeqcxet5s7t44vh8rt9mg", {
  emoji: "\u{1F44D}",
});
console.log(reaction.id, reaction.emoji);
```

### Python

```py
reaction = client.whatsapp.reaction.set("wam_01krdgeqcxet5s7t44vh8rt9mg", emoji="\U0001f44d")
print(reaction.id, reaction.emoji)
```

### Go

```go
reaction, err := client.Whatsapp.Reaction.Set(context.Background(), "wam_01krdgeqcxet5s7t44vh8rt9mg", bird.WhatsappReactionSetParams{
	Emoji: "\U0001F44D",
})
if err != nil {
	log.Fatal(err)
}
fmt.Println(reaction.Id, reaction.Emoji)
```

### PHP

```php
$reaction = $bird->whatsapp->reaction->set(
    'wam_01krdgeqcxet5s7t44vh8rt9mg',
    (new WhatsAppReactionUpsert())->setEmoji("\u{1F44D}"),
);
echo $reaction->getId(), ' ', $reaction->getEmoji();
```

### CLI

```sh
bird whatsapp reaction set <message-id> --emoji 👍
```

### cURL

```sh
curl -X PUT "https://us1.platform.bird.com/v1/whatsapp/messages/{message_id}/reaction" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "emoji": "👍"
  }'
```

## Example response `202`

```json
{
  "id": "war_01krdgeqcxet5s7t44vh8rt9mg",
  "emoji": "👍"
}
```

## Path parameters

- `message_id` (string): ID of the message to react to, as returned in the `id` field of the message. Must be a message this workspace received.

## Request body

- `emoji` (string, required): The emoji to place, as the character itself. Replaces your existing reaction on this message if you have one. To take a reaction back entirely, delete it rather than sending an empty value. WhatsApp takes exactly one emoji, so a value carrying more than one is refused with a `422` rather than sent. The length cap is generous because a single joined emoji is many code points: a couple-kissing one carrying two skin tones is ten, which is why the cap alone cannot express the limit.

## Response body

- `id` (string, required): ID of the reaction-log entry this request created, matching the `id` that entry carries in [List reaction events for a WhatsApp message](/docs/api/reference/list-whatsapp-message-reaction-events).
- `emoji` (string, required): The emoji as accepted, echoing the one the request carried.

## Related resources

- [Should I use a Bird SDK or call the API directly?](/explained/platform/should-i-use-an-sdk-or-call-the-api-directly) (answer)
- [Build your first integration](/learn/paths/integration) (course)
- [Send your first email](/docs/get-started/send-your-first-email) (docs)

[Get an implementation brief](/learn/workspace?topic=api-basics)
