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

# Add Entity Reaction

> Add or update a reaction on an entity

> [!NOTE]
>
> **Requires the `entities` bundle.** A project without the entities bundle returns `403 database/tables-not-available`. See [Bundles](https://docs.sublay.io/v7/bundles.md).

Adds a reaction of the specified type to an entity. If the user already has a reaction on this entity, it is replaced with the new type. The entity's `reactionCounts` map is updated accordingly. Sending the reaction the user already has changes nothing: the response is the same `200` with the entity, counts stay as they are, and no notification is sent.

**Authentication required.**

## Path Parameters

**entityId** `string` *required*

The UUID of the entity to react to.

## Body Parameters

**reactionType** `string` *required*

The type of reaction to add. One of: `upvote`, `downvote`, `like`, `love`, `wow`, `sad`, `angry`, `funny`.

**userId** `string`

Override which user the reaction is attributed to. **Service key only.** Useful for backfilling reactions from an external system.

## Response

Returns the updated [Entity](https://docs.sublay.io/v7/data-models/entity.md) object with the new `reactionCounts` map.

> [!NOTE]
>
> The entity owner receives an in-app notification when someone reacts to their entity. Milestone notifications are also sent at reaction count thresholds (e.g., 10, 50, 100 reactions).

## Error Responses

> [accordion] Missing User — 400
>
> ```json theme={null}
> { "error": "Missing user ID", "code": "entity/missing-user-id" }
> ```
>
> Returned when no user is authenticated and no `userId` override is provided.

> [accordion] Not Found — 404
>
> ```json theme={null}
> { "error": "Entity not found.", "code": "entity/not-found" }
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.