REST API - Space Permissions

Available since v. 2.0.1

New REST APIs:

  • Get all space permission types

  • Get space groups with any permission

  • Get all spaces with 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

New REST APIs:

  • Get space users with any permission

  • Get all spaces with 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

New REST APIs:

  • Get user permissions for space

  • Get group permissions for space

  • Get spaces with anonymous permissions

  • Get all actors with permissions for space

Available since v. 3.1.*

New REST APIs:

  • Manage user space permissions (add and remove permissions with one call)

  • Manage group space permissions (add and remove permissions with one call)

Available since v. 3.16.*

Below REST APIs are now available to space administrators:


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:

[ "VIEWSPACE", "REMOVEOWNCONTENT", "COMMENT", "EDITSPACE", "SETSPACEPERMISSIONS", "REMOVEPAGE", "REMOVECOMMENT", "REMOVEBLOG", "CREATEATTACHMENT", "REMOVEATTACHMENT", "EDITBLOG", "EXPORTSPACE", "REMOVEMAIL", "SETPAGEPERMISSIONS" ]

Permission Name

Value

All - View

EXPORTPAGE
VIEWSPACE

Pages - Add

Pages - Restrict

Pages - Delete

Blog - Add

Blog - Delete

Comments - Add

Comments - Delete

Attachments - Add

Attachments - Delete

Mail - Delete

Space - Export

Space - Admin


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:

 

 


Get all actors with permissions for space

Method type: GET

URL: {CONFLUENCE_URL}/rest/extender/1.0/permission/space/{SPACE_KEY}/getSpacePermissionActors/{PERMISSION_TYPE}

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:

 


Groups

Get space groups with any permission

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:

 


Get group permissions for space

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:

 


Get all spaces with permissions for group

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

 

With spacesAsArray = true

 

 


Manage group space permissions (add and remove permissions with one call)

Method type: PUT

URL: {CONFLUENCE_URL}/rest/extender/1.0/permission/space/{SPACE_KEY}/group/{GROUP_NAME}/manageSpacePermissions

  • where {GROUP_NAME} is the name of the group

  • where {SPACE_KEY} is the space key

Request format: JSON

Example request: Permissions to add

Response format: JSON

Example response:

 


Add space permissions for group

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

Response format: JSON

Example response:

 


Remove all group permissions from space

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:

 


Remove group permissions from space

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

Response format: JSON

Example response:

 


 

 

Users

Get space users with any permission

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:

 

 


Get user permissions for space

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:

 


Get all spaces with permissions for user

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

 

With spacesAsArray

 


Manage user space permissions (add and remove permissions with one call)

Method type: PUT

URL: {CONFLUENCE_URL}/rest/extender/1.0/permission/space/{SPACE_KEY}/user/{USER_NAME}/manageSpacePermissions

  • where {USER_NAME} is the user name

  • where {SPACE_KEY} is the space key

Request format: JSON

Example request: Permissions to add

Response format: JSON

Example response:

 


Add space permissions for user

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

Response format: JSON

Example response:

 


Remove all user permissions from space

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:

 


Remove user permissions from space

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

Response format: JSON

Example response:

 

 


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:

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.