Getting 403 for Unlike a post by the user

I am trying to hit the unlike API on discourse with HTTP, Node.js. I am sending the particular payload :

      host: discourseHost,
      port: discoursePort,
      path: '/post_actions/' + parseInt(req.params.post_id),
      method: 'DELETE',
      headers: {
        'Content-Type': 'application/json',
        'Content-Length': Buffer.byteLength(data),
        'Api-Key': DISCOURSE_API_KEY,
        'Api-Username': userData.discourse_username,
        'Accept': 'application/json'

But I am getting this as response :

BODY: {“errors”:[“You are not permitted to view the requested resource.”]}

Can anyone suggest me what I need to change in my payload/request.

I tried to hit the discourse API /post_actions/{id} directly from postman, with the following headers :

Api-Key:blah blah

Still I am getting the response as :

    "errors": [
        "You are not permitted to view the requested resource."

I am stuck here. Any help will be fine.

You can cancel a like heart :heart: only within a limited time span.

Maybe you are trying to unlike a too old like.


Oh yeah, Thanks a lot. That was the reason. @jesus2099 .

1 Like

From where I can change this? Can i change this from the admin portal by any chance?

You can change it in the post undo action window mins site setting located here: By default, it should be 10 minutes.