Skip to content
V2 (Legacy) API ReferenceGet started

Add or remove a reaction to a message

client.messages.addReaction(stringmessageID, MessageAddReactionParams { operation, type, custom_emoji, part_index } body, RequestOptionsoptions?): MessageAddReactionResponse { message, status, trace_id }
POST/v3/messages/{messageId}/reactions

Add or remove emoji reactions to messages. Reactions let users express their response to a message without sending a new message.

Supported Reactions:

  • love ❤️
  • like 👍
  • dislike 👎
  • laugh 😂
  • emphasize ‼️
  • question ❓
  • custom - any emoji (use custom_emoji field to specify)
ParametersExpand Collapse
messageID: string
formatuuid
body: MessageAddReactionParams { operation, type, custom_emoji, part_index }
operation: "add" | "remove"

Whether to add or remove the reaction

One of the following:
"add"
"remove"

Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh, emphasize, question. Custom emoji reactions have type “custom” with the actual emoji in the custom_emoji field. Sticker reactions have type “sticker” with sticker attachment details in the sticker field.

One of the following:
"love"
"like"
"dislike"
"laugh"
"emphasize"
"question"
"custom"
"sticker"
custom_emoji?: string

Custom emoji string. Required when type is “custom”.

part_index?: number

Optional index of the message part to react to. If not provided, reacts to the entire message (part 0).

ReturnsExpand Collapse
MessageAddReactionResponse { message, status, trace_id }
message?: string
status?: string
trace_id?: string

Add or remove a reaction to a message

import LinqAPIV3 from '@linqapp/sdk';

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

const response = await client.messages.addReaction('69a37c7d-af4f-4b5e-af42-e28e98ce873a', {
  operation: 'add',
  type: 'love',
});

console.log(response.trace_id);
{
  "message": "Reaction processed",
  "status": "accepted",
  "trace_id": "trace_id"
}
{
  "error": {
    "status": 400,
    "code": 1002,
    "message": "Phone number must be in E.164 format"
  },
  "success": false
}
{
  "error": {
    "status": 401,
    "code": 2004,
    "message": "Unauthorized - missing or invalid authentication token"
  },
  "success": false
}
{
  "error": {
    "status": 500,
    "code": 3006,
    "message": "Internal server error"
  },
  "success": false
}
Returns Examples
{
  "message": "Reaction processed",
  "status": "accepted",
  "trace_id": "trace_id"
}
{
  "error": {
    "status": 400,
    "code": 1002,
    "message": "Phone number must be in E.164 format"
  },
  "success": false
}
{
  "error": {
    "status": 401,
    "code": 2004,
    "message": "Unauthorized - missing or invalid authentication token"
  },
  "success": false
}
{
  "error": {
    "status": 500,
    "code": 3006,
    "message": "Internal server error"
  },
  "success": false
}