# Read Confluence page restrictions with the REST API

URL: https://goingstellar.ro/reference/atlassian-rest-api/page-restrictions/

GET /wiki/rest/api/content/{id}/restriction returns one entry per operation, read and update, each with a list of users and groups. An empty list means the page has no restriction for that operation. Changing restrictions is a separate set of calls that was not run.

## Endpoints

| Method | Path | What it does |
|---|---|---|
| GET | `/wiki/rest/api/content/{id}/restriction` | v1: returns the restrictions of a page. |
| GET | `/wiki/api/v2/pages/{id}/restriction-state` | v2: returns the restriction state of a page. |

## Examples

### GET /wiki/rest/api/content/{pageId}/restriction

Reads the restrictions of an unrestricted page.

```bash
curl \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  'https://your-domain.atlassian.net/wiki/rest/api/content/{pageId}/restriction'
```

```python
import os
import requests

EMAIL = "you@example.com"
r = requests.get(
    'https://your-domain.atlassian.net/wiki/rest/api/content/{pageId}/restriction',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
)
print(r.status_code, r.text)
```

Response: HTTP 200

```
{
 "results": [
  {
   "operation": "read",
   "restrictions": {
    "user": {
     "results": [],
     "size": 0
    },
    "group": {
     "results": [],
     "size": 0
    }
   }
  },
  {
   "operation": "update",
   "restrictions": {
    "user": {
     "results": [],
     "size": 0
    },
    "group": {
     "results": [],
     "size": 0
    }
   }
  }
 ],
 "start": 0,
 "limit": 25,
 "size": 2
}
```

Sent to Atlassian Cloud on 29 Nov 2026.

### GET /wiki/rest/api/content/search

A search result carries a restrictions key that is empty unless it is expanded.

```bash
curl -G \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  --data-urlencode 'cql=space = SD AND type = page AND title ~ "Example"' \
  --data-urlencode 'limit=2' \
  'https://your-domain.atlassian.net/wiki/rest/api/content/search'
```

```python
import os
import requests

EMAIL = "you@example.com"
r = requests.get(
    'https://your-domain.atlassian.net/wiki/rest/api/content/search',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    params={'cql': 'space = SD AND type = page AND title ~ "Example"', 'limit': '2'},
)
print(r.status_code, r.text)
```

Response: HTTP 200

```
{
 "results": [
  {
   "id": "33784019",
   "title": "Example page created with v1",
   "restrictions": {}
  }
 ]
}
```

Sent to Atlassian Cloud on 29 Nov 2026.

### GET /wiki/rest/api/user/current

The account id to use when a user must be added to a restriction.

```bash
curl \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  'https://your-domain.atlassian.net/wiki/rest/api/user/current'
```

```python
import os
import requests

EMAIL = "you@example.com"
r = requests.get(
    'https://your-domain.atlassian.net/wiki/rest/api/user/current',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
)
print(r.status_code, r.text)
```

Response: HTTP 200

```
{
 "accountId": "<accountId>",
 "accountType": "atlassian",
 "displayName": "<display name>"
}
```

Sent to Atlassian Cloud on 29 Nov 2026.

## How it behaves

- An unrestricted page returns two operations, read and update, each with empty user and group results and size 0 (conf-restrictions).
- The response has a start of 0 and a limit of 25 for the users and groups (conf-restrictions).
- A content object from search has "restrictions": {}, so the call above is needed for the detail (conf-cql-content-search).

## Pitfalls

- Empty user and group lists mean no page-level restriction was set. The call does not describe space permissions.
- Reading restrictions needs permission to view the content, per the spec.

## Questions and answers

### How do I restrict a page?

The v1 spec has PUT and POST on the same path. They were not run.

## Related

- [Get a page](https://goingstellar.ro/reference/atlassian-rest-api/get-page/)
- [CQL search through the API](https://goingstellar.ro/reference/atlassian-rest-api/cql-search-api/)
- [The current user in Confluence](https://goingstellar.ro/reference/atlassian-rest-api/confluence-current-user/)
- [Create a page](https://goingstellar.ro/reference/atlassian-rest-api/create-page/)
- [Spaces](https://goingstellar.ro/reference/atlassian-rest-api/spaces/)

## Sources

- [Get restrictions (Confluence REST API v1)](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions/#api-wiki-rest-api-content-id-restriction-get)
- [Get page restriction state (Confluence REST API v2)](https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-content-permissions/#api-pages-id-restriction-state-get)
- [The Confluence Cloud REST API v1 (Atlassian Developer)](https://developer.atlassian.com/cloud/confluence/rest/v1/intro/)

