Posts

Like a post and other actions

POST
https://discourse.example.com/post_actions.json

Body

application/json
idintegerrequired

The ID of the post to perform the action on

post_action_type_idintegerrequired

The ID of the post action type (e.g., 2 for like)

flag_topicboolean

Whether to flag the entire topic

Parameters

Api-Keystringrequiredheader
Api-Usernamestringrequiredheader

Response

200OKany

post updated

Response fields application/json
idintegerrequired

The ID of the post

namestringrequired

The name of the post author

usernamestringrequired

The username of the post author

avatar_templatestringrequired

Template for the author's avatar URL

created_atstringrequired

When the post was created

cookedstringrequired

The HTML content of the post

post_numberintegerrequired

The post number within the topic

post_typeintegerrequired

The type of post

posts_countintegerrequired

Total posts count for the user

updated_atstringrequired

When the post was last updated

reply_countintegerrequired

Number of replies to this post

reply_to_post_numberstring | nullrequired

Post number this post is replying to

quote_countintegerrequired

Number of times this post has been quoted

readsintegerrequired

Number of reads

readers_countintegerrequired

Number of readers

scorenumberrequired

Post score

yoursbooleanrequired

Whether this post belongs to the current user

topic_idintegerrequired

ID of the topic this post belongs to

topic_slugstringrequired

Slug of the topic this post belongs to

display_usernamestringrequired

Display username of the post author

primary_group_namestring | nullrequired

Primary group name of the author

flair_namestring | nullrequired

Flair name of the author

flair_urlstring | nullrequired

Flair URL of the author

flair_bg_colorstring | nullrequired

Flair background color of the author

flair_colorstring | nullrequired

Flair color of the author

flair_group_idinteger | nullrequired

Flair group ID of the author

badges_grantedarrayrequired

Badges granted to the user

versionintegerrequired

Version number of the post

can_editbooleanrequired

Whether the current user can edit this post

can_deletebooleanrequired

Whether the current user can delete this post

can_recoverbooleanrequired

Whether the current user can recover this post

can_see_hidden_postbooleanrequired

Whether the current user can see hidden posts

can_wikibooleanrequired

Whether the current user can wiki this post

user_titlestring | nullrequired

Title of the post author

bookmarkedbooleanrequired

Whether the post is bookmarked by the current user

actions_summaryArray<object>required

Summary of actions performed on this post

Show child attributes
idinteger

ID of the action type (e.g., 2 for like)

countinteger

Number of times this action has been performed

actedboolean

Whether the current user has performed this action

can_undoboolean

Whether the current user can undo this action

can_actboolean

Whether the current user can perform this action

moderatorbooleanrequired

Whether the post author is a moderator

adminbooleanrequired

Whether the post author is an admin

staffbooleanrequired

Whether the post author is staff

user_idintegerrequired

ID of the post author

hiddenbooleanrequired

Whether the post is hidden

trust_levelintegerrequired

Trust level of the post author

deleted_atstring | nullrequired

When the post was deleted

user_deletedbooleanrequired

Whether the post was deleted by the user

edit_reasonstring | nullrequired

Reason for the last edit

can_view_edit_historybooleanrequired

Whether the current user can view edit history

wikibooleanrequired

Whether this is a wiki post

reviewable_idinteger | nullrequired

ID of the reviewable if this post is under review

reviewable_score_countintegerrequired

Number of reviewable scores

reviewable_score_pending_countintegerrequired

Number of pending reviewable scores

post_urlstringrequired

URL of the post