Returns info about all restrictions by operation.
string
Requiredstring
Returns a JSON representation of the restrictions group by operations.
1
2
3
curl --request GET \
--url 'http://{baseurl}/confluence/rest/api/content/{id}/restriction/byOperation' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{
"restrictions": {
"read": {
"operation": "read",
"restrictions": {
"user": {
"results": [],
"start": 0,
"limit": 200,
"size": 0
},
"group": {
"results": [],
"start": 0,
"limit": 200,
"size": 0
}
},
"_links": {
"self": "https://instenv-320828-cq6e.instenv.internal.atlassian.com/rest/api/content/2326529/restriction/byOperation/read"
},
"_expandable": {
"content": "/rest/api/content/2326529"
}
},
"update": {
"operation": "update",
"restrictions": {
"user": {
"results": [],
"start": 0,
"limit": 200,
"size": 0
},
"group": {
"results": [],
"start": 0,
"limit": 200,
"size": 0
}
},
"_links": {
"self": "https://instenv-320828-cq6e.instenv.internal.atlassian.com/rest/api/content/2326529/restriction/byOperation/update"
},
"_expandable": {
"content": "/rest/api/content/2326529"
}
}
},
"get_links": {
"self": "https://instenv-320828-cq6e.instenv.internal.atlassian.com/rest/api/content/2326529/restriction/byOperation/read",
"base": "https://instenv-320828-cq6e.instenv.internal.atlassian.com",
"context": "<string>"
}
}
Returns info about all restrictions of given operation.
string
Requiredstring
Requiredstring
string
string
Returns a JSON representation of the restrictions of given operation.
1
2
3
curl --request GET \
--url 'http://{baseurl}/confluence/rest/api/content/{id}/restriction/byOperation/{operationKey}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
"operation": "read",
"restrictions": {
"user": {
"results": [],
"start": 0,
"limit": 200,
"size": 0
},
"group": {
"results": [],
"start": 0,
"limit": 200,
"size": 0
}
},
"get_links": {
"self": "https://instenv-320828-cq6e.instenv.internal.atlassian.com/rest/api/content/2326529/restriction/byOperation/read",
"base": "https://instenv-320828-cq6e.instenv.internal.atlassian.com",
"context": "<string>"
},
"get_expandable": {
"content": "/rest/api/content/2326529"
}
}
Returns relevant view restriction both direct and inherited for a single content.
string
Requiredstring
string
string
Returns a JSON representation of the restrictions group by operations.
1
2
3
curl --request GET \
--url 'http://{baseurl}/confluence/rest/api/content/{id}/restriction/relevantViewRestrictions' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{
"restrictions": {
"read": {
"operation": "read",
"restrictions": {
"user": {
"results": [],
"start": 0,
"limit": 200,
"size": 0
},
"group": {
"results": [],
"start": 0,
"limit": 200,
"size": 0
}
},
"_links": {
"self": "https://instenv-320828-cq6e.instenv.internal.atlassian.com/rest/api/content/2326529/restriction/byOperation/read"
},
"_expandable": {
"content": "/rest/api/content/2326529"
}
},
"update": {
"operation": "update",
"restrictions": {
"user": {
"results": [],
"start": 0,
"limit": 200,
"size": 0
},
"group": {
"results": [],
"start": 0,
"limit": 200,
"size": 0
}
},
"_links": {
"self": "https://instenv-320828-cq6e.instenv.internal.atlassian.com/rest/api/content/2326529/restriction/byOperation/update"
},
"_expandable": {
"content": "/rest/api/content/2326529"
}
}
},
"get_links": {
"self": "https://instenv-320828-cq6e.instenv.internal.atlassian.com/rest/api/content/2326529/restriction/byOperation/read",
"base": "https://instenv-320828-cq6e.instenv.internal.atlassian.com",
"context": "<string>"
}
}
Sets all the restrictions specified to a piece of content identified by contentId
. Setting per-content restrictions is currently allowed for Pages or BlogPosts only.
Example request URI:
http://example.com/confluence/rest/content/1234567/restriction?expand=
The payload uses the same schema as returned by the GET requests from /rest/api/content/{id}/restriction/byOperation*
which can be used as a template but is not necessary.
Example request for a single content restriction:
1
[ { "operation": "update", "restrictions": { "user": [ { "type": "known", "username": "admin" } ] } } ]
Example request for updating two ContentRestrictions:
1
[ { "operation": "update", "restrictions": { "user": [ { "type": "known", "username": "admin" } ] } }, { "operation": "read", "restrictions": { "user": [ { "type": "known", "username": "fred" } ] } } ]
Rules for using this method:
ContentRestriction
lacks any supported operations, the restrictions for the operations will not be altered.users
and/or groups
map entries as empty arrays will remove the corresponding content restrictions.users
and/or groups
map entries means the corresponding operation's user/group content restrictions won't be changed.string
Requiredstring
string
string
array<ContentRestriction>
ReferenceContent
string
object
string
Returns a full JSON representation of the restrictions present directly on piece of content after the update operation.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
curl --request PUT \
--url 'http://{baseurl}/confluence/rest/api/content/{id}/restriction' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '[
{
"content": {
"idProperties": {},
"expanded": true
},
"operation": "<string>",
"restrictions": {},
"lastModificationDate": "2024-01-01T00:00:00Z"
}
]'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{
"results": [
{
"operation": "read",
"restrictions": {
"user": {},
"group": {}
},
"get_links": {
"self": "https://instenv-320828-cq6e.instenv.internal.atlassian.com/rest/api/content/2326529/restriction/byOperation/read",
"base": "https://instenv-320828-cq6e.instenv.internal.atlassian.com",
"context": "<string>"
},
"get_expandable": {
"content": "/rest/api/content/2326529"
}
}
],
"totalCount": 2154,
"start": 25,
"limit": 25,
"size": 25,
"_links": {
"base": "http://localhost:8085/confluence",
"context": "confluence",
"self": "http://localhost:8085/rest/api/latest/..?limit=25&start=25",
"next": "http://localhost:8085/rest/api/latest/..?limit=25&start=50",
"prev": "http://localhost:8085/rest/api/latest/..?limit=25&start=0"
}
}
Rate this page: