Skip to main content
POST
/
reactions
JavaScript
import Whop from '@whop/sdk';

const client = new Whop({
  apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});

const reaction = await client.reactions.create({ resource_id: 'resource_id' });

console.log(reaction.id);
{
  "id": "reac_xxxxxxxxxxxxxxxxxxxxxx",
  "resource_id": "<string>",
  "user": {
    "id": "user_xxxxxxxxxxxxx",
    "username": "johndoe42",
    "name": "John Doe"
  },
  "emoji": ":heart:"
}

Authorizations

Authorization
string
header
required

A company API key, company scoped JWT, app API key, or user OAuth token. You must prepend your key/token with the word 'Bearer', which will look like Bearer ***************************

Body

application/json

Parameters for CreateReaction

resource_id
string
required

The unique identifier of the message or forum post to react to.

emoji
string | null

The emoji to react with, in shortcode or unicode format. For example, ':heart:' or a unicode emoji. Ignored in forums where reactions are always likes.

poll_option_id
string | null

The unique identifier of a poll option to vote for. Only valid when the target message or post contains a poll.

Response

A successful response

A single reaction left by a user on a feed post, such as a like or emoji.

id
string
required

The unique identifier for the entity

Example:

"reac_xxxxxxxxxxxxxxxxxxxxxx"

resource_id
string
required

The unique identifier of the post this reaction was left on.

user
object
required

The user who left this reaction on the post.

emoji
string | null
required

The emoji used for this reaction in shortcode format. Null if the reaction type is not emoji.

Example:

":heart:"