Role Users

View, update and manage users that belong to a specific role in your company or client account.

GET /roles/{id}/users

DescriptionGet a list of all the users associated with this role in the company or client account.
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
GET
https://app.klipfolio.com/api/1/roles/fedcba9876543210fedcba9876543210/users?client_id=0123456789abcdef0123456789abcdef

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 in the company or client account.
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
PUT https://app.klipfolio.com/api/1/roles/fedcba9876543210fedcba9876543210/users/9876543210abcdef?client_id=0123456789abcdef0123456789abcdef

Example Response

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

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

DescriptionDelete the specific user from the role in the company or client account.
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
DELETE https://app.klipfolio.com/api/1/roles/0123456789abcdef0123456789abcdef/users/0123456789abc?client_id=0123456789abcdef0123456789abcdef

Example Response

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