Skip to content

API Users Permissions

Lukas Metzger edited this page Apr 1, 2018 · 5 revisions

User permissions

All actions here are only for admin users. They will return a 403 error for users.

Get list of permissions

GET /users/{id}/permissions?page=5&pagesize=10

parameter explanation
page The page of the results to return, if ommited returns page 1
pagesize How many items should be on each page, if ommited page size is infinite therefore all results are returned

Response

code result
200 Everything was successful
{
  "paging": {
    "page": 5,
    "total": 20,
    "pagesize": 10
  },
  "results": [
    {
      "domainId": 1,
      "domainName": "example.com"
    }
  ]
}

Add new permission

POST /users/{id}/permissions

Body

{
    "domainId": 1
}

Response

code result
204 Everything was successful, the answer body is therefore empty
404 If user does not exist
422 One of the required fields is missing, or key is invalid

Remove permission

DELETE /users/{id}/permissions/{domainId}

Response

code result
204 Everything was successful, the answer body is therefore empty
404 The given permission does not exist