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

GET /roles/{id}/users

DescriptionGet a list of all the users associated with this role.
Permissionsuser.manage
Resource URLhttps://app.klipfolio.com/api/1.0/roles/{id}/users
Parametersrole_id={id}
Response codes401 — 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}

DescriptionAdd a user to the role.
Permissionsuser.manage
Resource URLhttps://app.klipfolio.com/api/1.0/roles/{id}/users/{user_id}
Parametersrole_id={id}, user_id={id}
Response codes400 — 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}

DescriptionDelete the specific user from the role
Permissionsuser.manage
Resource URLhttps://app.klipfolio.com/api/1.0/roles/{id}/users/{userid}
ParametersNone.
Response codes400 — 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
  }
}