Admins API
Manage account role assignments
An Admin object looks like:
{
// The unique identifier for the account role/user assignment.
"id": 1023,
// The account role assigned. This can be 'AccountAdmin' or a user-defined role
// created by the Roles API.
"role": "AccountAdmin",
// The user the role is assigned to. See the Users API for details.
"user": null,
// The status of the account role/user assignment.
"workflow_state": "deleted"
}
Make an account admin AdminsController#create
POST /api/v1/accounts/:account_id/admins
url:POST|/api/v1/accounts/:account_id/admins
Flag an existing user as an admin within the account.
Request Parameters:
Parameter | Type | Description | |
---|---|---|---|
user_id | Required | integer |
The id of the user to promote. |
role | string |
created with the given role. Defaults to ‘AccountAdmin’. |
|
role_id | integer |
The user’s admin relationship with the account will be created with the given role. Defaults to the built-in role for ‘AccountAdmin’. |
|
send_confirmation | boolean |
Send a notification email to the new admin if true. Default is true. |
Remove account admin AdminsController#destroy
DELETE /api/v1/accounts/:account_id/admins/:user_id
url:DELETE|/api/v1/accounts/:account_id/admins/:user_id
Remove the rights associated with an account admin role from a user.
Request Parameters:
Parameter | Type | Description | |
---|---|---|---|
role | string |
|
|
role_id | Required | integer |
The id of the role representing the user’s admin relationship with the account. |
List account admins AdminsController#index
GET /api/v1/accounts/:account_id/admins
url:GET|/api/v1/accounts/:account_id/admins
A paginated list of the admins in the account
Request Parameters:
Parameter | Type | Description | |
---|---|---|---|
user_id[] | [Integer] |
Scope the results to those with user IDs equal to any of the IDs specified here. |
List my admin roles AdminsController#self_roles
GET /api/v1/accounts/:account_id/admins/self
url:GET|/api/v1/accounts/:account_id/admins/self
A paginated list of the current user’s roles in the account. The results are the same as those returned by the List account admins endpoint with user_id
set to self
, except the “Admins - Add / Remove” permission is not required.