Developer
Get Support
Sign in
Get Support
Sign in
DOCUMENTATION
Cloud
Data Center
Resources
Sign in
Sign in
DOCUMENTATION
Cloud
Data Center
Resources
Sign in
Cloud
Confluence Cloud / Reference / REST API v2

Space Roles

Postman Collection
OpenAPI
GET

Get available space rolesExperimental

Retrieves the available space roles.

Permissions required: Permission to access the Confluence site; if requesting a certain space's roles, permission to view the space.

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

Connect app scope requiredREAD

Request

Query parameters

space-id

string

role-type

string

principal-id

string

principal-type

PrincipalType

cursor

string

limit

integer

Responses

Returned if the requested space roles are retrieved.

application/json

MultiEntityResult<SpaceRole>
GET/space-roles
1 2 3 4 5 6 7 8 9 10 11 12 // This sample uses Atlassian Forge // https://developer.atlassian.com/platform/forge/ import { requestConfluence } from "@forge/bridge"; const response = await requestConfluence(`/wiki/api/v2/space-roles`, { headers: { 'Accept': 'application/json' } }); 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 13 14 15 16 17 { "results": [ { "id": "<string>", "type": "SYSTEM", "name": "<string>", "description": "<string>", "spacePermissions": [ "<string>" ] } ], "_links": { "next": "<string>", "base": "<string>" } }
POST

Create a space roleExperimental

Create a space role.

Permissions required: User must be an organization or site admin. Connect and Forge app users are not authorized to access this resource.

Data Security Policy: Exempt from app access rules
Scopes
write:configuration:confluence

Connect app scope requiredADMIN

Request

Request bodyapplication/json

name

string

Required
description

string

Required
spacePermissions

array<string>

Required

Responses

Returned if the requested space role is created.

application/json

SpaceRole
POST/space-roles
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 // This sample uses Atlassian Forge // https://developer.atlassian.com/platform/forge/ import { requestConfluence } from "@forge/bridge"; var bodyData = `{ "name": "<string>", "description": "<string>", "spacePermissions": [ "<string>" ] }`; const response = await requestConfluence(`/wiki/api/v2/space-roles`, { method: 'POST', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' }, body: bodyData }); console.log(`Response: ${response.status} ${response.statusText}`); console.log(await response.json());
201Response
1 2 3 4 5 6 7 8 9 { "id": "<string>", "type": "SYSTEM", "name": "<string>", "description": "<string>", "spacePermissions": [ "<string>" ] }
GET

Get space role by IDExperimental

Retrieves the space role by ID.

Permissions required: Permission to access the Confluence site.

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

Connect app scope requiredREAD

Request

Path parameters

id

integer

Required

Responses

Returned if the requested space role is retrieved.

application/json

allOf [SpaceRole, object]

SpaceRole
object
GET/space-roles/{id}
1 2 3 4 5 6 7 8 9 10 11 12 // This sample uses Atlassian Forge // https://developer.atlassian.com/platform/forge/ import { requestConfluence } from "@forge/bridge"; const response = await requestConfluence(`/wiki/api/v2/space-roles/{id}`, { headers: { 'Accept': 'application/json' } }); 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": "<string>", "type": "SYSTEM", "name": "<string>", "description": "<string>", "spacePermissions": [ "<string>" ], "_links": { "base": "<string>" } }
PUT

Update a space roleExperimental

Update a space role.

Permissions required: User must be an organization or site admin. Connect and Forge app users are not authorized to access this resource.

Data Security Policy: Exempt from app access rules
Scopes
write:configuration:confluence

Connect app scope requiredADMIN

Request

Path parameters

id

string

Required

Request bodyapplication/json

name

string

Required
description

string

Required
spacePermissions

array<string>

Required
anonymousReassignmentRoleId

string

guestReassignmentRoleId

string

Responses

Returned if the update of the space role was accepted.

application/json

UpdateSpaceRoleResponse
PUT/space-roles/{id}
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 // This sample uses Atlassian Forge // https://developer.atlassian.com/platform/forge/ import { requestConfluence } from "@forge/bridge"; var bodyData = `{ "name": "<string>", "description": "<string>", "spacePermissions": [ "<string>" ], "anonymousReassignmentRoleId": "<string>", "guestReassignmentRoleId": "<string>" }`; const response = await requestConfluence(`/wiki/api/v2/space-roles/{id}`, { method: 'PUT', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' }, body: bodyData }); console.log(`Response: ${response.status} ${response.statusText}`); console.log(await response.json());
202Response
1 2 3 4 5 6 7 { "id": "<string>", "type": "SYSTEM", "name": "<string>", "description": "<string>", "taskId": "<string>" }
DEL

Delete a space roleExperimental

Delete a space role

Permissions required: User must be an organization or site admin. Connect and Forge app users are not authorized to access this resource.

Data Security Policy: Exempt from app access rules
Scopes
write:configuration:confluence

Connect app scope requiredADMIN

Request

Path parameters

id

string

Required

Responses

Returned if the deletion of the space role was accepted.

application/json

DeleteSpaceRoleResponse
DEL/space-roles/{id}
1 2 3 4 5 6 7 8 9 10 11 12 13 // This sample uses Atlassian Forge // https://developer.atlassian.com/platform/forge/ import { requestConfluence } from "@forge/bridge"; const response = await requestConfluence(`/wiki/api/v2/space-roles/{id}`, { method: 'DELETE', headers: { 'Accept': 'application/json' } }); console.log(`Response: ${response.status} ${response.statusText}`); console.log(await response.json());
202Response
1 2 3 { "taskId": "<string>" }
GET

Get space role modeExperimental

Retrieves the space role mode.

Permissions required: Permission to access the Confluence site ('Can use' global permission).

Data Security Policy: Exempt from app access rules
Scopes
read:configuration:confluence

Connect app scope requiredREAD

Request

This request has no parameters.

Responses

Returned if the requested space role mode is returned.

application/json

object
GET/space-role-mode
1 2 3 4 5 6 7 8 9 10 11 12 // This sample uses Atlassian Forge // https://developer.atlassian.com/platform/forge/ import { requestConfluence } from "@forge/bridge"; const response = await requestConfluence(`/wiki/api/v2/space-role-mode`, { headers: { 'Accept': 'application/json' } }); console.log(`Response: ${response.status} ${response.statusText}`); console.log(await response.json());
200Response
1 2 3 { "mode": "PRE_ROLES" }
GET

Get space role assignmentsExperimental

Retrieves the space role assignments.

Permissions required: Permission to view the space.

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

Connect app scope requiredREAD

Request

Path parameters

id

integer

Required

Query parameters

role-id

string

role-type

string

principal-id

string

principal-type

PrincipalType

cursor

string

limit

integer

Responses

Returned if the requested space role assignments are retrieved.

application/json

MultiEntityResult<SpaceRoleAssignment>
GET/spaces/{id}/role-assignments
1 2 3 4 5 6 7 8 9 10 11 12 // This sample uses Atlassian Forge // https://developer.atlassian.com/platform/forge/ import { requestConfluence } from "@forge/bridge"; const response = await requestConfluence(`/wiki/api/v2/spaces/{id}/role-assignments`, { headers: { 'Accept': 'application/json' } }); 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 13 14 15 { "results": [ { "principal": { "principalType": "USER", "principalId": "<string>" }, "roleId": "<string>" } ], "_links": { "next": "<string>", "base": "<string>" } }
POST

Set space role assignmentsExperimental

Sets space role assignments as specified in the payload.

Permissions required: Permission to manage roles in the space.

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

Connect app scope requiredSPACE_ADMIN

Request

Path parameters

id

integer

Required

Request bodyapplication/json

array<object>

principal

Principal

Required
roleId

string

Responses

Returned if the requested update to space role assignments succeeds in its entirety.

application/json

MultiEntityResult<SpaceRoleAssignment>
POST/spaces/{id}/role-assignments
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 // This sample uses Atlassian Forge // https://developer.atlassian.com/platform/forge/ import { requestConfluence } from "@forge/bridge"; var bodyData = `[ { "principal": { "principalType": "USER", "principalId": "<string>" }, "roleId": "<string>" } ]`; const response = await requestConfluence(`/wiki/api/v2/spaces/{id}/role-assignments`, { 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 13 14 15 { "results": [ { "principal": { "principalType": "USER", "principalId": "<string>" }, "roleId": "<string>" } ], "_links": { "next": "<string>", "base": "<string>" } }

Rate this page: