View, update and manage users that belong to a specific role.

GET /roles/{id}/users

Description

Get a list of all the users associated with this role.

Permissions

user.manage

Resource URL

https://app.klipfolio.com/api/1.0/roles/{id}/users

Parameters

role_id={id}

Response codes

401 — access denied
404 — role id not found

Example Request

GET https://app.klipfolio.com/api/1/roles/fedcba9876543210fedcba9876543210/users

Example Response

{
 "data": {
     "users": [
         {
"first_name":"John",
"last_name":"Smith",
"email":"[email protected]"
         }
     ]
 },
 "meta": {
     "status": 200,
     "success": true
 }
}

PUT /roles/{id}/users/{id}

Description

Add a user to the role.

Permissions

user.manage

Resource URL

https://app.klipfolio.com/api/1.0/roles/{id}/users/{user_id}

Parameters

role_id={id}, user_id={id}

Response codes

400 — missing user id
401 — access denied to non-admins and users from other companies)
403 — user already has role
404 — user id or role id not found

Example Request

PUT https://app.klipfolio.com/api/1/roles/fedcba9876543210fedcba9876543210/users/9876543210abcdef -d "{'data':{'users':['id':'9876543210abcdef’]}}”

Example Response

{
 "data": {
     "users": [
         {
"id":"9876543210abcdef"
         }
     ]
 },
 "meta": {
     "status": 200,
     "success": true
 }
}

DELETE /roles/{id}/users/{id}

Description

Delete the specific user from the role

Permissions

user.manage

Resource URL

https://app.klipfolio.com/api/1.0/roles/{id}/users/{userid}

Parameters

None.

Response codes

400 — missing user id
401 — access denied to non-admins and users from other companies
403 — user does not have role
403 — admin role must have one or more users
404 — user id or role id not found

Example Request

DELETE https://app.klipfolio.com/api/1/roles/0123456789abcdef0123456789abcdef/users/0123456789abc

Example Response

{
"meta": {
      "status": 200,
      "success": true
  }
}