# Flagging a post with API broken

**URL:** <https://meta.discourse.org/t/flagging-a-post-with-api-broken/291084>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [January 9, 2024, 11:17pm UTC](https://meta.discourse.org/t/flagging-a-post-with-api-broken/291084 "2024-01-09T23:17:34Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![markschmucker](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markschmucker/32/141599_2.png) [@markschmucker](https://meta.discourse.org/u/markschmucker)\
**Post date:** [January 9, 2024, 11:17pm UTC](https://meta.discourse.org/t/flagging-a-post-with-api-broken/291084/1 "2024-01-09T23:17:34Z")

</div>

I flag certain posts using the API and Python. This has worked for several years, until a recent upgrade to 3.2.0.beta4-dev. Now I get `DiscourseClientError: You are not permitted to view the requested resource.` My API key is still valid and is not revoked. Reverse-engineering by flagging a post manually shows the payload for flagging has not changed (except maybe the value of flag\_topic, but that doesn’t seem to matter). Any ideas?

```plaintext
       self._post(
            "/post_actions",
            id=post_id,
            post_action_type_id=7, # flag it
            message=msg,
            flag_topic=True
        )

```

---

_[View the full topic](https://meta.discourse.org/t/flagging-a-post-with-api-broken/291084)._
