REST API - Space Permissions
- 1 General
- 2 Groups
- 3 Users
- 4 Pagination
Available since v. 2.0.1
Get all space permission types
Get space groups with any permission
Get all spaces and permissions for group
Add space permissions for group
Remove all group permissions from space
Remove group permissions from space
Available since v. 2.1.0
Get space users with any permission
Get all spaces and permissions for user
Add space permissions for user
Remove all user permissions from space
Remove user permissions from space
Available since v. 2.2.0
Get user permissions for space
Get group permissions for space
Get spaces with anonymous permissions
Get all actors with permissions for space
General
Get all space permission types
Available for all users
Method type: GET
URL: {CONFLUENCE_URL}/rest/extender/1.0/permission/space/permissionTypes
Response format: JSON
Example response:
1
2
3
4
5
[
"VIEWSPACE", "REMOVEOWNCONTENT", "COMMENT", "EDITSPACE", "SETSPACEPERMISSIONS",
"REMOVEPAGE", "REMOVECOMMENT", "REMOVEBLOG", "CREATEATTACHMENT", "REMOVEATTACHMENT",
"EDITBLOG", "EXPORTSPACE", "REMOVEMAIL", "SETPAGEPERMISSIONS"
]
Get spaces with anonymous permissions
Available only for Confluence Administrators
This API supports Pagination
This API supports optional parameters
Method type: GET
URL: {CONFLUENCE_URL}/rest/extender/1.0/permission/space/getSpacesWithAnonymousPermissions
Parameters:
creationDateFrom - filter spaces by created date (creation date >= this date)
creationDateTo - filter spaces by created date (creation date <= this date)
dateFormat - define date format for parameters creationDateFrom, creationDateTo and for JSON output fields creationDateString, lastModificationDateString - default format ‘yyyy-MM-dd'
Example URL:
{CONFLUENCE_URL}/rest/extender/1.0/permission/space/getSpacesWithAnonymousPermissions?creationDateTo=2020-05-14
{CONFLUENCE_URL}/rest/extender/1.0/permission/space/getSpacesWithAnonymousPermissions?creationDateFrom=12/01/2019&dateFormat=MM/dd/yyyy
{CONFLUENCE_URL}/rest/extender/1.0/permission/space/getSpacesWithAnonymousPermissions?creationDateTo=03.01.2020&creationDateFrom=01.01.2020&dateFormat=MM.dd.yyyy
Response format: JSON
Example response:
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
{
"total": 2,
"maxResults": 100,
"spaces": {
"SPACEA": {
"creationDateString": "05-14-2020 14:53:21",
"lastModificationDate": 1589460802858,
"permissions": [
"VIEWSPACE"
],
"lastModificationDateString": "05-14-2020 14:53:22",
"creatorName": "admin",
"name": "Space A",
"creationDate": 1589460801648,
"key": "SPACEA"
},
"ds": {
"creationDateString": "09-25-2018 11:05:32",
"lastModificationDate": 1573637171250,
"permissions": [
"VIEWSPACE",
"REMOVEOWNCONTENT",
"COMMENT",
"EDITSPACE",
"REMOVEPAGE",
"REMOVECOMMENT",
"REMOVEBLOG",
"CREATEATTACHMENT",
"REMOVEATTACHMENT",
"EDITBLOG",
"EXPORTSPACE",
"REMOVEMAIL"
],
"lastModificationDateString": "11-13-2019 10:26:11",
"creatorName": "not exist",
"name": "Demonstration Space",
"creationDate": 1537866332331,
"key": "ds"
}
},
"startAt": 0
}
Get all actors with permissions for space
Available only for Confluence Administrators and Space Administrators
Method type: GET
URL: {CONFLUENCE_URL}/rest/extender/1.0/permission/space/{SPACE_KEY}/getSpacePermissionActors/{PERMISSION_TYPE}
where {SPACE_KEY} is the space key
where {PERMISSION_TYPE} is the space permission type from https://it-lab-site.atlassian.net/wiki/spaces/RAEC/pages/559743018/REST+API+-+Space+Permissions#Get-all-space-permission-types or ALL to get all space permissions
Example URL:
{CONFLUENCE_URL}/rest/extender/1.0/permission/space/DEMO/getSpacePermissionActors/ALL
{CONFLUENCE_URL}/rest/extender/1.0/permission/space/DEMO/getSpacePermissionActors/REMOVEPAGE
Response format: JSON
Example response:
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
{
"permissions": {
"EDITSPACE": {
"anonymousAccess": true,
"groups": [
"confluence-users"
]
},
"SETSPACEPERMISSIONS": {
"anonymousAccess": false,
"groups": [
"confluence-administrators"
],
"users": [
"admin",
"john"
]
},
"REMOVEMAIL": {
"anonymousAccess": true,
"groups": [
"confluence-administrators",
"confluence-users"
]
}
},
"name": "Demonstration Space",
"key": "ds"
}
Groups
Get space groups with any permission
Available only for Confluence Administrators and Space Administrators
This API supports Pagination
Method type: GET GET
URL: {CONFLUENCE_URL}/rest/extender/1.0/permission/space/{SPACE_KEY}/allGroupsWithAnyPermission
where {SPACE_KEY} is the space key
Response format: JSON
Example response:
1
2
3
4
5
6
7
8
9
{
"total": 2,
"maxResults": 1000,
"groups": [
"confluence-administrators",
"confluence-users"
],
"startAt": 0
}
Get group permissions for space
Available only for Confluence Administrators
Method type: GET GET
URL: {CONFLUENCE_URL}/rest/extender/1.0/permission/group/{GROUP_NAME}/getPermissionsForSpace/space/{SPACE_KEY}
where {GROUP_NAME} is the name of the group
where {SPACE_KEY} is the space key
Response format: JSON
Example response:
1
2
3
4
5
6
7
8
9
10
11
12
13
{
"permissions": [
"VIEWSPACE",
"REMOVEOWNCONTENT",
"COMMENT",
"EDITSPACE",
"SETSPACEPERMISSIONS",
"REMOVEPAGE",
"REMOVECOMMENT"
],
"name": "Demonstration Space",
"key": "ds"
}
Get all spaces and permissions for group
Available only for Confluence Administrators
Method type: GET
URL: {CONFLUENCE_URL}/rest/extender/1.0/permission/group/{GROUP_NAME}/getAllSpacesWithPermissions
where {GROUP_NAME} is the name of the group
Parameters:
spacesAsArray - change ‘spaces’ parameter in response from HashMap to Array (Available since v. 2.4.0)
This API supports Pagination
Example URL:
{CONFLUENCE_URL}/rest/extender/1.0/permission/group/{GROUP_NAME}/getAllSpacesWithPermissions?spacesAsArray=true
{CONFLUENCE_URL}/rest/extender/1.0/permission/group/{GROUP_NAME}/getAllSpacesWithPermissions?spacesAsArray=true&startAt=100
Response format: JSON
Example response:
Without spacesAsArray
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
{
"total": 2,
"maxResults": 1111,
"spaces": {
"TEST": {
"permissions": [
"VIEWSPACE",
"COMMENT"
],
"name": "Test space for Extender",
"key": "TEST"
},
"ds": {
"permissions": [
"VIEWSPACE",
"REMOVEOWNCONTENT",
"COMMENT",
"EDITSPACE",
"SETSPACEPERMISSIONS",
"REMOVEPAGE",
"REMOVECOMMENT",
"REMOVEBLOG",
"CREATEATTACHMENT",
"REMOVEATTACHMENT",
"EDITBLOG",
"EXPORTSPACE",
"REMOVEMAIL",
"SETPAGEPERMISSIONS"
],
"name": "Demonstration Space",
"key": "ds"
}
},
"startAt": 0
}
With spacesAsArray = true
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
{
"total": 2,
"maxResults": 1111,
"spaces": [
{
"permissions": [
"VIEWSPACE",
"COMMENT"
],
"name": "Test space for Extender",
"key": "TEST"
},
{
"permissions": [
"VIEWSPACE",
"REMOVEOWNCONTENT",
"COMMENT",
"EDITSPACE",
"SETSPACEPERMISSIONS",
"REMOVEPAGE",
"REMOVECOMMENT",
"REMOVEBLOG",
"CREATEATTACHMENT",
"REMOVEATTACHMENT",
"EDITBLOG",
"EXPORTSPACE",
"REMOVEMAIL",
"SETPAGEPERMISSIONS"
],
"name": "Demonstration Space",
"key": "ds"
}
],
"startAt": 0
}
Add space permissions for group
Available only for Confluence Administrators and Space Administrators
Method type: PUT
URL: {CONFLUENCE_URL}/rest/extender/1.0/permission/space/{SPACE_KEY}/group/{GROUP_NAME}/addSpacePermissions
where {GROUP_NAME} is the name of the group
where {SPACE_KEY} is the space key
Request format: JSON
Example request: Permissions to add
1
2
3
4
5
{
"permissions":[
"VIEWSPACE", "COMMENT"
]
}
Response format: JSON
Example response:
1
2
3
4
5
6
7
8
{
"total": 2,
"added": [
"VIEWSPACE",
"COMMENT"
],
"skipped": []
}
Remove all group permissions from space
Available only for Confluence Administrators and Space Administrators
Method type: DELETE
URL: {CONFLUENCE_URL}/rest/extender/1.0/permission/space/{SPACE_KEY}/group/{GROUP_NAME}/removeAllSpacePermissions
where {GROUP_NAME} is the name of the group
where {SPACE_KEY} is the space key
Response format: JSON
Example response:
1
2
3
4
5
6
7
{
"total": 2,
"removed": [
"VIEWSPACE",
"COMMENT"
]
}
Remove group permissions from space
Available only for Confluence Administrators and Space Administrators
Method type: DELETE
URL: {CONFLUENCE_URL}/rest/extender/1.0/permission/space/{SPACE_KEY}/group/{GROUP_NAME}/removeSpacePermissions
where {GROUP_NAME} is the name of the group
where {SPACE_KEY} is the space key
Request format: JSON
Example request: Permissions to add
1
2
3
4
5
{
"permissions":[
"VIEWSPACE", "COMMENT"
]
}
Response format: JSON
Example response:
1
2
3
4
5
6
7
{
"total": 2,
"removed": [
"VIEWSPACE",
"COMMENT"
]
}
Users
Get space users with any permission
Available only for Confluence Administrators and Space Administrators
Method type: GET GET
URL: {CONFLUENCE_URL}/rest/extender/1.0/permission/space/{SPACE_KEY}/allUsersWithAnyPermission
where {SPACE_KEY} is the space key
Response format: JSON
Example response:
1
2
3
4
5
6
7
8
9
{
"total": 2,
"maxResults": 1000,
"users": [
"admin",
"john"
],
"startAt": 0
}
Get user permissions for space
Available only for Confluence Administrators
Method type: GET GET
URL: {CONFLUENCE_URL}/rest/extender/1.0/permission/user/{USER_NAME}/getPermissionsForSpace/space/{SPACE_KEY}
where {USER_NAME} is the user name
where {SPACE_KEY} is the space key
Response format: JSON
Example response:
1
2
3
4
5
6
7
8
9
10
11
12
13
{
"permissions": [
"VIEWSPACE",
"REMOVEOWNCONTENT",
"COMMENT",
"EDITSPACE",
"SETSPACEPERMISSIONS",
"REMOVEPAGE",
"REMOVECOMMENT"
],
"name": "Demonstration Space",
"key": "ds"
}
Get all spaces and permissions for user
Available only for Confluence Administrators
Method type: GET
URL: {CONFLUENCE_URL}/rest/extender/1.0/permission/user/{USER_NAME}/getAllSpacesWithPermissions
where {USER_NAME} is the user name
Parameters:
spacesAsArray - change ‘spaces’ parameter in response from HashMap to Array (Available since v. 2.4.0)
This API supports Pagination
Example URL:
{CONFLUENCE_URL}/rest/extender/1.0/permission/user/{USER_NAME}/getAllSpacesWithPermissions?spacesAsArray=true
{CONFLUENCE_URL}/rest/extender/1.0/permission/user/{USER_NAME}/getAllSpacesWithPermissions?spacesAsArray=true&startAt=100
Response format: JSON
Example response:
Without spacesAsArray
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
{
"total": 2,
"maxResults": 100,
"spaces": {
"KB": {
"permissions": [
"VIEWSPACE",
"SETSPACEPERMISSIONS",
"EXPORTSPACE"
],
"name": "knowledge base",
"key": "KB"
},
"TEAMSP": {
"permissions": [
"VIEWSPACE",
"COMMENT",
"EDITSPACE",
"CREATEATTACHMENT",
"EDITBLOG"
],
"name": "Team Space",
"key": "TEAMSP"
}
},
"startAt": 0
}
With spacesAsArray .
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
{
"total": 2,
"maxResults": 100,
"spaces": {
"KB": {
"permissions": [
"VIEWSPACE",
"SETSPACEPERMISSIONS",
"EXPORTSPACE"
],
"name": "knowledge base",
"key": "KB"
},
"TEAMSP": {
"permissions": [
"VIEWSPACE",
"COMMENT",
"EDITSPACE",
"CREATEATTACHMENT",
"EDITBLOG"
],
"name": "Team Space",
"key": "TEAMSP"
}
},
"startAt": 0
}
Add space permissions for user
Available only for Confluence Administrators and Space Administrators
Method type: PUT
URL: {CONFLUENCE_URL}/rest/extender/1.0/permission/space/{SPACE_KEY}/user/{USER_NAME}/addSpacePermissions
where {USER_NAME} is the user name
where {SPACE_KEY} is the space key
Request format: JSON
Example request: Permissions to add
1
2
3
4
5
{
"permissions":[
"VIEWSPACE", "COMMENT"
]
}
Response format: JSON
Example response:
1
2
3
4
5
6
7
8
{
"total": 2,
"added": [
"VIEWSPACE",
"COMMENT"
],
"skipped": []
}
Remove all user permissions from space
Available only for Confluence Administrators and Space Administrators
Method type: DELETE
URL: {CONFLUENCE_URL}/rest/extender/1.0/permission/space/{SPACE_KEY}/user/{USER_NAME}/removeAllSpacePermissions
where {USER_NAME} is the user name
where {SPACE_KEY} is the space key
Response format: JSON
Example response:
1
2
3
4
5
6
7
8
9
10
{
"total": 5,
"removed": [
"VIEWSPACE",
"CREATEATTACHMENT",
"EDITBLOG",
"COMMENT",
"EDITSPACE"
]
}
Remove user permissions from space
Available only for Confluence Administrators and Space Administrators
Method type: DELETE
URL: {CONFLUENCE_URL}/rest/extender/1.0/permission/space/{SPACE_KEY}/user/{USER_NAME}/removeSpacePermissions
where {USER_NAME} is the user name
where {SPACE_KEY} is the space key
Request format: JSON
Example request: Permissions to add
1
2
3
4
5
{
"permissions":[
"VIEWSPACE", "COMMENT"
]
}
Response format: JSON
Example response:
1
2
3
4
5
6
7
{
"total": 2,
"removed": [
"VIEWSPACE",
"COMMENT"
]
}
Pagination
This REST API uses pagination to improve performance for all users. Pagination is enforced for methods that could return a large collection of items. When you make a request to a paged API, the response will wrap the returned array of values in a JSON object with paging metadata, for example:
1
2
3
4
5
6
7
8
9
10
{
"startAt" : 0,
"maxResults" : 10,
"total": 200,
"objects": [
{ /* result 0 */ },
{ /* result 1 */ },
{ /* result 2 */ }
]
}
Where:
startAt
is the index of the first item returned in the page of results.maxResults
is the maximum number of items that can be returned per page. Each API endpoint may have a different limit for the number of items returned, and these limits may change without notice. (default value - 100)total
is the total number of items contained in all pages. This number may change as the client requests the subsequent pages, therefore the client should always assume that the requested page can be empty.