---
ai:
  exclude: true
search:
  tags:
    - Space Permissions
    - POST
seo:
  description: >-
    Sets permissions to multiple users/groups in the… Reference for the POST
    /rest/api/space/{spaceKey}/permissions endpoint in the Confluence Data
    Center API.
sidebar:
  label: Set permissions to multiple users/groups/anonymous user in the given space
  badge: POST
title: Set permissions to multiple users/groups/anonymous user in the given space
type: openapi-operation
---
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 &lt;a href="https://confluence.atlassian.com/display/DOC/Space+Permissions+Overview">Space Permissions documentation&lt;/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`

**Request body** (`application/json`)

Request body example:

```json
[
  {
    "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"
      }
    ]
  }
]
```

**Responses**

- `200` — Space permissions successfully set.
- `400` — Returned if incorrect permissions are passed in request (for e.g. non existing operation or global permission).
- `401` — Returned if the calling User is not authenticated.
- `403` — Returned if the calling User does not have necessary permission.
- `404` — Returned if user or group with specified key not found.
