# Add or remove a reaction

`POST https://evohub.io/api/v1/retro/boards/{boardID}/cards/{cardID}/reactions`

Part of the [Retro API](https://docs.evohub.io/retro.md) reference · operationId `toggleRetroReaction`.

Toggles the caller's reaction with one emoji on a card: adds it if
the caller has not reacted with that emoji, removes it if they have.
`added` says which happened. `reactions` is the card's reactions
afterwards, most used first (`reacted` is not filled in here), or
`null` when none are left. The board must be active.

Requires the `retro:card:write` scope.

## Authorization

Any one of:

- `bearerKey`
- `headerKey`

Where:

- `bearerKey`: HTTP Bearer — An EvoHub API key (`evohub_…`) as a bearer token.
- `headerKey`: API key in the header `X-API-Key` — An EvoHub API key (`evohub_…`).

## Path parameters

- `boardID` (string, required, example `brd_3f9a1c7e2b8d4a60`): The board's ID.
- `cardID` (string, required, example `crd_8d0c4b6e1a9f2357`): The card's ID.

## Request body (required)

Content type: `application/json`

Type: `object`

- `emoji` (string, required): The emoji.

## Responses

### 200 — The reaction was toggled.

Content type: `application/json`

Type: `object`

- `success` (boolean)
- `data` (object)
  - `added` (boolean): `true` if the reaction was added, `false` if it was removed.
  - `reactions` (array of Reaction | null)
    - `emoji` (string)
    - `count` (integer)
    - `reacted` (boolean): Whether the caller reacted with this emoji.

### 400 — The body is not JSON (`INVALID_BODY`), or `emoji` is missing or blank (`MISSING_EMOJI`).

Content type: `application/json`

Type: `Error`

- `success` (boolean, value `false`): Sent by Retro itself; refusals before the request reaches Retro (401, 429) carry only `error`.
- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `board not found`)
  - `request_id` (string)

### 401 — No API key was sent, or it is unknown, revoked or expired (`UNAUTHORIZED`).

Content type: `application/json`

Type: `Error`

- `success` (boolean, value `false`): Sent by Retro itself; refusals before the request reaches Retro (401, 429) carry only `error`.
- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `board not found`)
  - `request_id` (string)

### 403 — The key lacks the scope this endpoint needs (`FORBIDDEN`).

Content type: `application/json`

Type: `Error`

- `success` (boolean, value `false`): Sent by Retro itself; refusals before the request reaches Retro (401, 429) carry only `error`.
- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `board not found`)
  - `request_id` (string)

### 404 — The board is not one the caller can see (`NOT_FOUND`), or the card is not on it (`CARD_NOT_FOUND`).

Content type: `application/json`

Type: `Error`

- `success` (boolean, value `false`): Sent by Retro itself; refusals before the request reaches Retro (401, 429) carry only `error`.
- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `board not found`)
  - `request_id` (string)

### 409 — The board is closed and its content cannot change (`BOARD_CLOSED`). Reopen it first.

Content type: `application/json`

Type: `Error`

- `success` (boolean, value `false`): Sent by Retro itself; refusals before the request reaches Retro (401, 429) carry only `error`.
- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `board not found`)
  - `request_id` (string)

### 429 — Too many requests (`RATE_LIMITED`). Wait for `Retry-After` seconds.

Headers:

- `Retry-After` (integer): Seconds to wait before retrying.

Content type: `application/json`

Type: `Error`

- `success` (boolean, value `false`): Sent by Retro itself; refusals before the request reaches Retro (401, 429) carry only `error`.
- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `board not found`)
  - `request_id` (string)

### 500 — Something went wrong on EvoHub's side (`INTERNAL_ERROR`). Retry later.

Content type: `application/json`

Type: `Error`

- `success` (boolean, value `false`): Sent by Retro itself; refusals before the request reaches Retro (401, 429) carry only `error`.
- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `board not found`)
  - `request_id` (string)

## Example request

```bash
curl -X POST 'https://evohub.io/api/v1/retro/boards/brd_3f9a1c7e2b8d4a60/cards/crd_8d0c4b6e1a9f2357/reactions' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <TOKEN>' \
  -d '{
  "emoji": "🚀"
}'
```
