---
title: "Like a post and other actions"
method: POST
path: "/post_actions.json"
tags: ["Posts"]
---

# Like a post and other actions

`POST /post_actions.json`

## Headers

- `Api-Key` string, required
- `Api-Username` string, required

## Request body

- object
  - `id` integer, required — The ID of the post to perform the action on
  - `post_action_type_id` integer, required — The ID of the post action type (e.g., 2 for like)
  - `flag_topic` boolean — Whether to flag the entire topic

## Response `200`

post updated

- object
  - `id` integer, required — The ID of the post
  - `name` string, required — The name of the post author
  - `username` string, required — The username of the post author
  - `avatar_template` string, required — Template for the author's avatar URL
  - `created_at` string, required — When the post was created
  - `cooked` string, required — The HTML content of the post
  - `post_number` integer, required — The post number within the topic
  - `post_type` integer, required — The type of post
  - `posts_count` integer, required — Total posts count for the user
  - `updated_at` string, required — When the post was last updated
  - `reply_count` integer, required — Number of replies to this post
  - `reply_to_post_number` string, nullable, required — Post number this post is replying to
  - `quote_count` integer, required — Number of times this post has been quoted
  - `incoming_link_count` integer, required — Number of incoming links to this post
  - `reads` integer, required — Number of reads
  - `readers_count` integer, required — Number of readers
  - `score` number, required — Post score
  - `yours` boolean, required — Whether this post belongs to the current user
  - `topic_id` integer, required — ID of the topic this post belongs to
  - `topic_slug` string, required — Slug of the topic this post belongs to
  - `display_username` string, required — Display username of the post author
  - `primary_group_name` string, nullable, required — Primary group name of the author
  - `flair_name` string, nullable, required — Flair name of the author
  - `flair_url` string, nullable, required — Flair URL of the author
  - `flair_bg_color` string, nullable, required — Flair background color of the author
  - `flair_color` string, nullable, required — Flair color of the author
  - `flair_group_id` integer, nullable, required — Flair group ID of the author
  - `badges_granted` unknown[], required — Badges granted to the user
    - unknown
  - `version` integer, required — Version number of the post
  - `can_edit` boolean, required — Whether the current user can edit this post
  - `can_delete` boolean, required — Whether the current user can delete this post
  - `can_recover` boolean, required — Whether the current user can recover this post
  - `can_see_hidden_post` boolean, required — Whether the current user can see hidden posts
  - `can_wiki` boolean, required — Whether the current user can wiki this post
  - `user_title` string, nullable, required — Title of the post author
  - `bookmarked` boolean, required — Whether the post is bookmarked by the current user
  - `actions_summary` object[], required — Summary of actions performed on this post
    - `id` integer — ID of the action type (e.g., 2 for like)
    - `count` integer — Number of times this action has been performed
    - `acted` boolean — Whether the current user has performed this action
    - `can_undo` boolean — Whether the current user can undo this action
    - `can_act` boolean — Whether the current user can perform this action
  - `moderator` boolean, required — Whether the post author is a moderator
  - `admin` boolean, required — Whether the post author is an admin
  - `staff` boolean, required — Whether the post author is staff
  - `user_id` integer, required — ID of the post author
  - `hidden` boolean, required — Whether the post is hidden
  - `trust_level` integer, required — Trust level of the post author
  - `deleted_at` string, nullable, required — When the post was deleted
  - `user_deleted` boolean, required — Whether the post was deleted by the user
  - `edit_reason` string, nullable, required — Reason for the last edit
  - `can_view_edit_history` boolean, required — Whether the current user can view edit history
  - `wiki` boolean, required — Whether this is a wiki post
  - `reviewable_id` integer, nullable, required — ID of the reviewable if this post is under review
  - `reviewable_score_count` integer, required — Number of reviewable scores
  - `reviewable_score_pending_count` integer, required — Number of pending reviewable scores
  - `post_url` string, required — URL of the post

---

[API](https://skmtc.dev/discourse/apis/discourse-api-documentation.md) · [All operations](https://skmtc.dev/discourse/apis/discourse-api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/discourse/discourse-api-documentation/revisions/2fd8fd2d6fd0/schema)
