Manage post reactions

Learn how to list, add, and remove Instagram post reactions with Unipile API.

❗️

For Instagram posts and comments, the only supported reaction value is instagram_like.

List reactions

On a post

To list reactions on a post, use List all Post's Reactions.

const { data } = await postsApi.getPostReactionsList({
  path: {
    account_id: "acc_123456789",
    post_id: "post_id",
  },
});
reactions = posts_api.get_post_reactions_list("post_id", "acc_123456789")
curl --request GET \
     --url https://api.unipile.com/v2/account_id/posts/post_id/reactions \
     --header 'accept: application/json'

On a comment

To list reactions on a comment, use List all Comment's Reactions.

const { data } = await postsApi.getPostCommentReactionsList({
  path: {
    account_id: "acc_123456789",
    post_id: "post_id",
    comment_id: "comment_id",
  },
});
reactions = posts_api.get_post_comment_reactions_list(
    "post_id",
    "comment_id",
    "acc_123456789",
)
curl --request GET \
     --url https://api.unipile.com/v2/account_id/posts/post_id/comments/comment_id/reactions \
     --header 'accept: application/json'

Add a reaction

To a post

To react to a post, use Add Reaction to a Post.

await postsApi.addPostReaction({
  path: {
    account_id: "acc_123456789",
    post_id: "post_id",
  },
  body: {
    reaction: "instagram_like",
  },
});
posts_api.add_post_reaction(
    "post_id",
    "acc_123456789",
    {"reaction": "instagram_like"},
)
curl --request POST \
     --url https://api.unipile.com/v2/account_id/posts/post_id/reactions \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "reaction": "instagram_like"
}
'

To a comment

To react to a comment, use Add Reaction to a Comment.

await postsApi.addPostCommentReaction({
  path: {
    account_id: "acc_123456789",
    post_id: "post_id",
    comment_id: "comment_id",
  },
  body: {
    reaction: "instagram_like",
  },
});
posts_api.add_post_comment_reaction(
    "post_id",
    "comment_id",
    "acc_123456789",
    {"reaction": "instagram_like"},
)
curl --request POST \
     --url https://api.unipile.com/v2/account_id/posts/post_id/comments/comment_id/reactions \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "reaction": "instagram_like"
}
'

Remove a reaction

From a post

To remove your reaction from a post, use Remove Reaction from a Post.

await postsApi.removePostReaction({
  path: {
    account_id: "acc_123456789",
    post_id: "post_id",
  },
  body: {
    reaction: "instagram_like",
  },
});
posts_api.remove_post_reaction(
    "post_id",
    "acc_123456789",
    {"reaction": "instagram_like"},
)
curl --request DELETE \
     --url https://api.unipile.com/v2/account_id/posts/post_id/reactions \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "reaction": "instagram_like"
}
'

From a comment

To remove your reaction from a comment, use Remove Reaction from a Comment.

await postsApi.removePostCommentReaction({
  path: {
    account_id: "acc_123456789",
    post_id: "post_id",
    comment_id: "comment_id",
  },
  body: {
    reaction: "instagram_like",
  },
});
posts_api.remove_post_comment_reaction(
    "post_id",
    "comment_id",
    "acc_123456789",
    {"reaction": "instagram_like"},
)
curl --request DELETE \
     --url https://api.unipile.com/v2/account_id/posts/post_id/comments/comment_id/reactions \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "reaction": "instagram_like"
}
'