Skip to content
atlassian-dc-mcp
Esc
↑↓navigate↵open⌘Jpreview

Set permissions to multiple users/groups/anonymous user in the given space

Sets permissions to multiple users/groups in the given space. Request should contain all permissions that user/group/anonymous user will have in a given space. If permission is absent in the request, but was granted before, it will be revoked. If empty list of permissions passed to user/group/anonymous user, then all their existing permissions will be revoked. If user/group/anonymous user not mentioned in the request, their permissions will not be revoked.

Maximum 40 different users/groups/anonymous user could be passed in the request.

See <a href=“https://confluence.atlassian.com/display/DOC/Space+Permissions+Overview">Space Permissions documentation</a> for additional information about supported permissions.

Example request URI’s: https://example.com/confluence/rest/api/space/TESTSPACE/permissions

POST/rest/api/space/{spaceKey}/permissions
Path parameters
spaceKeystringrequired
Request body
application/json
Array of SpacePermissionsForSubject
userKeystring
groupNamestring
operationsOperationDescription[]
Show properties
Array of OperationDescription
targetTypestring
operationKeystring
Responses
200

Space permissions successfully set.

400

Returned if incorrect permissions are passed in request (for e.g. non existing operation or global permission).

statusCodeinteger<int32>
dataValidationResult
Show properties
authorizedboolean
validboolean
errorsobject
successfulboolean
allowedInReadOnlyModeboolean
messagestring
reasonstring
401

Returned if the calling User is not authenticated.

statusCodeinteger<int32>
dataValidationResult
Show properties
authorizedboolean
validboolean
errorsobject
successfulboolean
allowedInReadOnlyModeboolean
messagestring
reasonstring
403

Returned if the calling User does not have necessary permission.

statusCodeinteger<int32>
dataValidationResult
Show properties
authorizedboolean
validboolean
errorsobject
successfulboolean
allowedInReadOnlyModeboolean
messagestring
reasonstring
404

Returned if user or group with specified key not found.

statusCodeinteger<int32>
dataValidationResult
Show properties
authorizedboolean
validboolean
errorsobject
successfulboolean
allowedInReadOnlyModeboolean
messagestring
reasonstring
Try it
Server
Parameters
Bodyapplication/json
Request
curl -X POST 'http://example.com:7990/confluence/rest/api/space/string/permissions' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '[
  {
    "userKey": "4028ae289154667d0191546e11a10001",
    "operations": [
      {
        "operationKey": "read",
        "targetType": "space"
      },
      {
        "operationKey": "administer",
        "targetType": "space"
      }
    ]
  },
  {
    "groupName": "group1",
    "operations": [
      {
        "operationKey": "read",
        "targetType": "space"
      },
      {
        "operationKey": "create",
        "targetType": "comment"
      }
    ]
  },
  {
    "operations": [
      {
        "operationKey": "read",
        "targetType": "space"
      }
    ]
  }
]'
Response
Space permissions successfully set.

Was this page helpful?