# Not enough permissions to alter ContentRestrictions (Confluence via REST API)

**URL:** <https://community.developer.atlassian.com/t/not-enough-permissions-to-alter-contentrestrictions-confluence-via-rest-api/45883>\
**Category:** Confluence Cloud\
**Tags:** rest-api\
**Created:** [March 6, 2021, 12:59pm UTC](https://community.developer.atlassian.com/t/not-enough-permissions-to-alter-contentrestrictions-confluence-via-rest-api/45883 "2021-03-06T12:59:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![philip.colmer](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/philip.colmer/32/35979_2.png) [@philip.colmer](https://community.developer.atlassian.com/u/philip.colmer)\
**Post date:** [March 6, 2021, 12:59pm UTC](https://community.developer.atlassian.com/t/not-enough-permissions-to-alter-contentrestrictions-confluence-via-rest-api/45883/1 "2021-03-06T12:59:56Z")

</div>

I’ve got a Python script that is creating/updating pages on Confluence Cloud via the REST API. The account being used to perform the changes is a space admin.

I’m trying to extend the script so that it applies view restrictions to each page after it has been saved to Confluence. However, I am getting the error “Not enough permissions to alter ContentRestrictions” when I try to do this.

```auto
    body = [
        {
            "operation": "read",
            "restrictions": {
                "user": [
                    {
                        "type": "known",
                        "accountId": bot_id
                    }
                ],
                "group": [
                    {
                        "type": "group",
                        "name": "employees"
                    },
                    {
                        "type": "group",
                        "name": group_name
                    }
                ]
            }
        },
        {
            "operation": "update",
            "restrictions": {
                "user": [
                    {
                        "type": "known",
                        "accountId": bot_id
                    }
                ],
                "group": []
            }
        }
    ]

```

where bot\_id is retrieved from `GET /rest/api/user/current` with the same authentication.

The weird thing is that if I do this using my own account credentials then it works but I’m struggling to find where I have more power/permissions than the bot account.

Thanks.

---

<div class="post-metadata">

**Author:** ![candid](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/candid/32/39734_2.png) [@candid](https://community.developer.atlassian.com/u/candid)\
**Post date:** [March 8, 2021, 4:46pm UTC](https://community.developer.atlassian.com/t/not-enough-permissions-to-alter-contentrestrictions-confluence-via-rest-api/45883/2 "2021-03-08T16:46:48Z")

</div>

I haven’t checked your particular request object, but one thing that you might check is whether your account actually has the `setpagepermissions` permission. That one is required to set content restrictions. As far as I’m aware, the space admin permission does not imply any of the other space permissions.

 ![image](https://global.discourse-cdn.com/atlassiandeveloper/original/3X/a/c/ac0d2f64925a037218f7fcce6470df296f09457f.png)

---

<div class="post-metadata">

**Author:** ![philip.colmer](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/philip.colmer/32/35979_2.png) [@philip.colmer](https://community.developer.atlassian.com/u/philip.colmer)\
**Post date:** [March 9, 2021, 7:51am UTC](https://community.developer.atlassian.com/t/not-enough-permissions-to-alter-contentrestrictions-confluence-via-rest-api/45883/3 "2021-03-09T07:51:14Z")

</div>

Good catch, @candid!

That permission was indeed missing and adding it solved my problem.

Thank you very much.
