GET

Get all restrictions by Operation

Returns info about all restrictions by operation.

Request

Path parameters

id

string

Required

Query parameters

expand

string

Responses

Returns a JSON representation of the restrictions group by operations.

application/json

MockRestrictionsResponse
GET/rest/api/content/{id}/restriction/byOperation
1 2 3 curl --request GET \ --url 'http://{baseurl}/confluence/rest/api/content/{id}/restriction/byOperation' \ --header 'Accept: application/json'
200Response
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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 { "restrictions": { "read": { "operation": "read", "restrictions": { "user": { "results": [], "start": 0, "limit": 200, "size": 0 }, "group": { "results": [], "start": 0, "limit": 200, "size": 0 } }, "_links": { "self": "https://instenv-320828-cq6e.instenv.internal.atlassian.com/rest/api/content/2326529/restriction/byOperation/read" }, "_expandable": { "content": "/rest/api/content/2326529" } }, "update": { "operation": "update", "restrictions": { "user": { "results": [], "start": 0, "limit": 200, "size": 0 }, "group": { "results": [], "start": 0, "limit": 200, "size": 0 } }, "_links": { "self": "https://instenv-320828-cq6e.instenv.internal.atlassian.com/rest/api/content/2326529/restriction/byOperation/update" }, "_expandable": { "content": "/rest/api/content/2326529" } } }, "get_links": { "self": "https://instenv-320828-cq6e.instenv.internal.atlassian.com/rest/api/content/2326529/restriction/byOperation/read", "base": "https://instenv-320828-cq6e.instenv.internal.atlassian.com", "context": "<string>" } }
GET

Get all restrictions for given operation

Returns info about all restrictions of given operation.

Request

Path parameters

operationKey

string

Required
id

string

Required

Query parameters

expand

string

limit

string

start

string

Responses

Returns a JSON representation of the restrictions of given operation.

application/json

OperationRestriction
GET/rest/api/content/{id}/restriction/byOperation/{operationKey}
1 2 3 curl --request GET \ --url 'http://{baseurl}/confluence/rest/api/content/{id}/restriction/byOperation/{operationKey}' \ --header 'Accept: application/json'
200Response
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 { "operation": "read", "restrictions": { "user": { "results": [], "start": 0, "limit": 200, "size": 0 }, "group": { "results": [], "start": 0, "limit": 200, "size": 0 } }, "get_links": { "self": "https://instenv-320828-cq6e.instenv.internal.atlassian.com/rest/api/content/2326529/restriction/byOperation/read", "base": "https://instenv-320828-cq6e.instenv.internal.atlassian.com", "context": "<string>" }, "get_expandable": { "content": "/rest/api/content/2326529" } }
GET

Get all view restriction both direct and inherited.

Returns relevant view restriction both direct and inherited for a single content.

Request

Path parameters

id

string

Required

Query parameters

expand

string

limit

string

start

string

Responses

Returns a JSON representation of the restrictions group by operations.

application/json

MockRestrictionsResponse
GET/rest/api/content/{id}/restriction/relevantViewRestrictions
1 2 3 curl --request GET \ --url 'http://{baseurl}/confluence/rest/api/content/{id}/restriction/relevantViewRestrictions' \ --header 'Accept: application/json'
200Response
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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 { "restrictions": { "read": { "operation": "read", "restrictions": { "user": { "results": [], "start": 0, "limit": 200, "size": 0 }, "group": { "results": [], "start": 0, "limit": 200, "size": 0 } }, "_links": { "self": "https://instenv-320828-cq6e.instenv.internal.atlassian.com/rest/api/content/2326529/restriction/byOperation/read" }, "_expandable": { "content": "/rest/api/content/2326529" } }, "update": { "operation": "update", "restrictions": { "user": { "results": [], "start": 0, "limit": 200, "size": 0 }, "group": { "results": [], "start": 0, "limit": 200, "size": 0 } }, "_links": { "self": "https://instenv-320828-cq6e.instenv.internal.atlassian.com/rest/api/content/2326529/restriction/byOperation/update" }, "_expandable": { "content": "/rest/api/content/2326529" } } }, "get_links": { "self": "https://instenv-320828-cq6e.instenv.internal.atlassian.com/rest/api/content/2326529/restriction/byOperation/read", "base": "https://instenv-320828-cq6e.instenv.internal.atlassian.com", "context": "<string>" } }
PUT

Update restrictions

Sets all the restrictions specified to a piece of content identified by contentId. Setting per-content restrictions is currently allowed for Pages or BlogPosts only.

Example request URI:

http://example.com/confluence/rest/content/1234567/restriction?expand=

The payload uses the same schema as returned by the GET requests from /rest/api/content/{id}/restriction/byOperation* which can be used as a template but is not necessary.

Example request for a single content restriction:

1 [ { "operation": "update", "restrictions": { "user": [ { "type": "known", "username": "admin" } ] } } ]

Example request for updating two ContentRestrictions:

1 [ { "operation": "update", "restrictions": { "user": [ { "type": "known", "username": "admin" } ] } }, { "operation": "read", "restrictions": { "user": [ { "type": "known", "username": "fred" } ] } } ]

Rules for using this method:

  • The provided ContentRestrictions will overwrite any existing restrictions on the Content for the corresponding operations.
  • If the provided ContentRestriction lacks any supported operations, the restrictions for the operations will not be altered.
  • Setting users and/or groups map entries as empty arrays will remove the corresponding content restrictions.
  • Missing users and/or groups map entries means the corresponding operation's user/group content restrictions won't be changed.
  • Modifying restrictions to revoke the requesting user's access is prohibited.

Request

Path parameters

id

string

Required

Query parameters

expand

string

limit

string

start

string

Request bodyapplication/json

array<ContentRestriction>

content

ReferenceContent

operation

string

restrictions

object

lastModificationDate

string

Responses

Returns a full JSON representation of the restrictions present directly on piece of content after the update operation.

application/json

object
PUT/rest/api/content/{id}/restriction
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 curl --request PUT \ --url 'http://{baseurl}/confluence/rest/api/content/{id}/restriction' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '[ { "content": { "idProperties": {}, "expanded": true }, "operation": "<string>", "restrictions": {}, "lastModificationDate": "2024-01-01T00:00:00Z" } ]'
200Response
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 29 30 { "results": [ { "operation": "read", "restrictions": { "user": {}, "group": {} }, "get_links": { "self": "https://instenv-320828-cq6e.instenv.internal.atlassian.com/rest/api/content/2326529/restriction/byOperation/read", "base": "https://instenv-320828-cq6e.instenv.internal.atlassian.com", "context": "<string>" }, "get_expandable": { "content": "/rest/api/content/2326529" } } ], "totalCount": 2154, "start": 25, "limit": 25, "size": 25, "_links": { "base": "http://localhost:8085/confluence", "context": "confluence", "self": "http://localhost:8085/rest/api/latest/..?limit=25&start=25", "next": "http://localhost:8085/rest/api/latest/..?limit=25&start=50", "prev": "http://localhost:8085/rest/api/latest/..?limit=25&start=0" } }

Rate this page: