For the complete documentation index, see llms.txt. This page is also available as Markdown.

Reactions

Introduction

Reactions let a User attach one emoji value to a resource with the Reactions capability. Posting again for the same user and resource updates that record.

Model Definition

Reactable Types

Capabilities

  • Notifications - Creating or changing a reaction can trigger notifications according to the target resource and notification settings.

Relations

Key
Relation
Type
Relation Field(s)

user

Belongs to

user_id

reactable

Reactable resource

Morph to

reactable_type, reactable_id

Reactable resources can return reactions_summary as an append. It contains emoji/count pairs sorted by descending count.

List by Reactable

List Reactions for one reactable entity.

Definition

GET /api/reactions/{reactableType}/{reactableId}

Route Parameters

Parameter
Type
Description

reactableType

string

Selects one of the supported Reactable Types.

reactableId

integer

Existing reactable ID.

Request Keys

Key
Type
Default
Description

selects

string

All fields

Comma-separated fields to return.

relations

string

Default relations

Pipe-separated relations to include.

Example Request

Example Response

Summary by Reactable

Summarize Reactions for one reactable entity.

Definition

GET /api/reactions/{reactableType}/{reactableId}/summary

Route Parameters

Parameter
Type
Description

reactableType

string

Selects one of the supported Reactable Types.

reactableId

integer

Existing reactable ID.

Example Request

Example Response

Show

Show one Reaction.

Definition

GET /api/reactions/{reaction}

Route Parameters

Parameter
Type
Description

reaction

integer

Reaction ID.

Request Keys

Key
Type
Default
Description

selects

string

All fields

Comma-separated fields to return.

relations

string

Default relations

Pipe-separated relations to include.

Example Request

Example Response

Create or Update

Create or update the current user's Reaction for one reactable entity.

Definition

POST /api/reactions

Request Keys

Key
Type
Default
Description

reactable_type*

string

-

Selects one of the supported Reactable Types.

reactable_id*

integer

-

Existing reactable ID.

value*

string

-

Emoji value, at most 10 characters.

Keys with * are required.

Behavior

user_id is always taken from the authenticated user. The complete request combination determines whether the response is a newly created reaction or the updated existing reaction.

Example Request

Example Response

Delete

Delete an existing Reaction.

Definition

DELETE /api/reactions/{reaction}

Route Parameters

Parameter
Type
Description

reaction

integer

Reaction ID.

Example Request

Example Response

Last updated