POST

Add new permission to space

Adds new permission to space.

If the permission to be added is a group permission, the group can be identified by its group name or group id.

Note: Apps cannot access this REST resource - including when utilizing user impersonation.

Permissions required: 'Admin' permission for the space.

Data Security Policy: Exempt from app access rules
Scopes
read:space.permission:confluence, write:space.permission:confluence

Connect apps cannot access this REST resource.

Request

Path parameters

spaceKey

string

Required

Request bodyapplication/json

The permission to be created.

subject

PermissionSubject

Required
operation

object

Required
_links

GenericLinks

Additional Properties

any

Responses

Returned if the requested content is returned.

application/json

SpacePermissionV2

This object represents a single space permission. Permissions consist of at least one operation object with an accompanying subjects object.

The following combinations of operation.key and operation.target values are valid for the operation object:

1 2 3 4 5 6 7 'create': 'page', 'blogpost', 'comment', 'attachment' 'read': 'space' 'delete': 'page', 'blogpost', 'comment', 'attachment', 'space' 'export': 'space' 'administer': 'space' 'archive': 'page' 'restrict_content': 'space'

For example, to enable Delete Own permission, set the operation object to the following:

1 2 3 4 "operation": { "key": "delete", "target": "space" }

To enable Add/Delete Restrictions permissions, set the operation object to the following:

1 2 3 4 "operation": { "key": "restrict_content", "target": "space" }
POST/wiki/rest/api/space/{spaceKey}/permission
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 // This sample uses Atlassian Forge // https://developer.atlassian.com/platform/forge/ import api, { route } from "@forge/api"; var bodyData = `{ "subject": { "type": "user", "identifier": "<string>" }, "operation": { "key": "administer", "target": "page" }, "_links": {} }`; const response = await api.asUser().requestConfluence(route`/wiki/rest/api/space/{spaceKey}/permission`, { method: 'POST', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' }, body: bodyData }); console.log(`Response: ${response.status} ${response.statusText}`); console.log(await response.json());
200Response
1 2 3 4 5 6 7 8 9 10 11 12 { "id": 2154, "subject": { "type": "user", "identifier": "<string>" }, "operation": { "key": "administer", "target": "page" }, "_links": {} }
POST

Add new custom content permission to space

Adds new custom content permission to space.

If the permission to be added is a group permission, the group can be identified by its group name or group id.

Note: Only apps can access this REST resource and only make changes to the respective app permissions.

Permissions required: 'Admin' permission for the space.

Data Security Policy: Exempt from app access rules
Scopes
read:space.permission:confluence, write:space.permission:confluence

Connect app scope requiredWRITE

Request

Path parameters

spaceKey

string

Required

Request bodyapplication/json

The permissions to be created.

subject

PermissionSubject

Required
operations

array<object>

Required

Responses

Returned if the requested content is returned.

POST/wiki/rest/api/space/{spaceKey}/permission/custom-content
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 // This sample uses Atlassian Forge // https://developer.atlassian.com/platform/forge/ import api, { route } from "@forge/api"; var bodyData = `{ "subject": { "type": "user", "identifier": "<string>" }, "operations": [ { "key": "read", "target": "<string>", "access": true } ] }`; const response = await api.asUser().requestConfluence(route`/wiki/rest/api/space/{spaceKey}/permission/custom-content`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: bodyData }); console.log(`Response: ${response.status} ${response.statusText}`); console.log(await response.text());
DEL

Remove a space permission

Removes a space permission. Note that removing Read Space permission for a user or group will remove all the space permissions for that user or group.

Note: Apps cannot access this REST resource - including when utilizing user impersonation.

Permissions required: 'Admin' permission for the space.

Data Security Policy: Exempt from app access rules
Scopes
write:space.permission:confluence

Connect apps cannot access this REST resource.

Request

Path parameters

spaceKey

string

Required
id

integer

Required

Responses

Permission successfully removed.

DEL/wiki/rest/api/space/{spaceKey}/permission/{id}
1 2 3 4 5 6 7 8 9 10 // This sample uses Atlassian Forge // https://developer.atlassian.com/platform/forge/ import api, { route } from "@forge/api"; const response = await api.asUser().requestConfluence(route`/wiki/rest/api/space/{spaceKey}/permission/{id}`, { method: 'DELETE' }); console.log(`Response: ${response.status} ${response.statusText}`); console.log(await response.text());

Rate this page: