Skip to content

Like a post

POST
/posts/{id}/like

Likes the post for you. Liking a post you’ve already liked doesn’t add a second like: the request still succeeds and the post’s like_count doesn’t go up again.

You need to be signed in and hold posts.like (part of the Base role) or system.admin; without either you get 403, before the post is looked at. You then need to be able to read the post: it’s the same read check GET /posts/{id} makes, without the mature settings, and a post you can’t read answers 404, as one that doesn’t exist or is deleted does.

Each successful request also records a like activity. Once it’s saved, the server tries to give the post’s author an in-app notice; none is created if they liked their own post, if one of you has blocked the other, if their notice settings for likes leave out in-app notices, or if creating it fails, which is only logged. A repeat like records another activity and tries again to notify the author. Notices aren’t emailed. Passing the activity on to paired instances is a separate, later step and isn’t part of this request. The post’s cached details are refreshed afterwards on a best-effort basis, so another read can briefly show the old count.

id
required
string format: uuid

The post’s id.

The post is liked, whether or not it already was.

Authentication required, missing, or invalid

object
error
required

Human-readable error summary

string
Example
the request could not be completed
Example
{
"error": "authentication required: sign in and retry with a valid session or API token"
}

Authenticated but missing required capabilities

object
error
required

Human-readable error summary

string
Example
the request could not be completed

Resource not found

object
error
required

Human-readable error summary

string
Example
the request could not be completed