This set of endpoints is for managing users in the new CloudTrax user system.
| functionality | method | endpoint |
|---|---|---|
| Edit a user | PUT | /user/<id> |
| Disable a user | PUT | /user/<id>/disable |
| Enable a user | PUT | /user/<id>/enable |
| Delete a user | DELETE | /user/<id> |
| Get a user | GET | /user/<id> |
| Create a user API key | POST | /user/<id>/key |
| Create a user API key | POST | /user/key |
| List user API keys | GET | /user/<id>/key/list |
| Delete a user API key | DELETE | /user/<id>/key/<id> |
| Delete a user API key | DELETE | /user/key/<id> |
| Create a user | POST | /user |
| List users | GET | /user/list |
| Edit a user password | PUT | /user/<id>/password |
| Create a user password reset token | POST | /user/<id>/password_set |
| Get a user network permission | GET | /user/<id>/network/<id> |
| Get a user account permission | GET | /user/<id>/account |
| Get a user service agreement status | GET | /user/<id>/service_agreement |
| Edit a user service agreement status | PUT | /user/<id>/service_agreement |
| Create a permission for a user on a network | PUT | /network/<id>/user/<id> |
| Delete a permission for a user on a network | DELETE | /network/<id>/user/<id> |
| Create a permission for a user on a network group | PUT | /networkgroup/<id>/user/<id> |
| Delete a permission for a user on a network group | DELETE | /networkgroup/<id>/user/<id> |
PUT /user/<id>
Edit details about a user.
| Role | Permitted |
|---|---|
| Account Admin | X |
| Group Manager | X |
| Network User |
N/A
PUT https://api-v2.cloudtrax.com/user/123
{
"name":"foo",
"notes":"district manager. watch out for him."
}{
}30002 20000 20038
PUT /user/<id>/disable
Disable a user. User will not be able to login or make any requests to the API after this endpoint has been successfully called. User information and permissions will be retained, but API keys will be removed.
| Role | Permitted |
|---|---|
| Account Admin | X |
| Group Manager | X |
| Network User |
N/A
PUT https://api-v2.cloudtrax.com/user/123/disable
{
}30002 20038 20029
PUT /user/<id>/enable
Enable a user. User will be able to login and make requests to the API after this endpoint has been successfully called. User information and permissions will be restored, but new API keys will have to be generated.
| Role | Permitted |
|---|---|
| Account Admin | X |
| Group Manager | X |
| Network User |
N/A
PUT https://api-v2.cloudtrax.com/user/123/enable
{
}30002 20038 20029
DELETE /user/<id>
Delete a user. All user information (including permissions and API keys) will be permanently removed.
| Role | Permitted |
|---|---|
| Account Admin | X |
| Group Manager | X |
| Network User |
N/A
DELETE https://api-v2.cloudtrax.com/user/123
{
}30002 20004 20038 20029
GET /user/<id>
Get a user's information. This is information that is likely only of interest to Account Admins and Group Managers and not Network Users. For example, "notes" about a user may not be something administrators want to share. Or, "permissions" are only relevant to administrators, because a Network User cannot change their own.
| Role | Permitted |
|---|---|
| Account Admin | X |
| Group Manager | X |
| Network User |
N/A
GET https://api-v2.cloudtrax.com/user/123
{
"email":"foo@bar.com",
"name":"foo",
"notes":"he is a bar",
"role_id":2, /* account role ID */
"account_id":123,
"enabled":true,
"verified":true,
"permissions":{
/* networks that were assigned explicitly and via network groups */
"all_networks":[
{"network_id":1, "role_id":3},
{"network_id":2, "role_id":3},
{"network_id":3, "role_id":3}
],
/* only specifically assigned networks */
"assigned_networks":[
{"network_id":3, "role_id":3}
],
/* only specifically assigned network groups */
"assigned_networkgroups":[
{"networkgroup_id":1, "role_id":3} /* contains network IDs 1 and 2 */
],
}
}30002 20004 20038
POST /user/<id>/key
POST /user/key
Create an API key for the specified user or the user making the request (if the <id> is not specified). API keys have identical API permissions to a logged in user, but do not require entering the user's email and password. They should still be kept secret, even though the user's password is never accessible.
Limit 10 keys generated via this endpoint per user at once.
The "key" property must be stored after creation, because it is stored securely and cannot be retrieved again.
| Role | Permitted |
|---|---|
| Account Admin | X |
| Group Manager | X |
| Network User | X |
N/A
POST https://api-v2.cloudtrax.com/user/123/key
POST https://api-v2.cloudtrax.com/user/key
{
"user_key_id":123,
"key":"abc",
"secret":"def",
"created":"1970-01-01T00:00:00Z"
}30002 20004 20038 20044
GET /user/<id>/key/list
Get a list of API keys for the specified user that were generated via the Create user API key endpoint.
The "key" is not returned, because it is stored securely. If you lose the "key", you must generated a new API key.
| Role | Permitted |
|---|---|
| Account Admin | X |
| Group Manager | |
| Network User |
N/A
GET https://api-v2.cloudtrax.com/user/123/key/list
{
"keys":[
{
"user_key_id":123,
"secret":"def",
"created":"1970-01-01T00:00:00Z"
}
]
}30002 20004 20038
DELETE /user/<id>/key/<id>
DELETE /user/key/<id>
Delete an API key (generated via the Create user API key endpoint) for the specified user or the user making the request (if the <id> following /user/ is not specified).
| Role | Permitted |
|---|---|
| Account Admin | X |
| Group Manager | |
| Network User |
N/A
DELETE https://api-v2.cloudtrax.com/user/123/key/456
DELETE https://api-v2.cloudtrax.com/user/key/456
{
}30002 20004 20038 20043
POST /user
Create a user in the same account as the requester.
| Role | Permitted |
|---|---|
| Account Admin | X |
| Group Manager | X |
| Network User |
N/A
POST https://api-v2.cloudtrax.com/user
{
"email":"foo@bar.com",
"name":"foo",
"role_id":1, /* account role ID */
"notes":"foo needs bar"
}{
"user_id":2,
"account_id":123,
"token":"abc", /* used to verify the user */
"email":"foo@bar.com",
"name":"foo",
"role_id":1 /* account role ID */
}30002 20000 20010 20012 20014 20015 20029 20036
GET /user/list
Get a list of users on the requester's account.
| Role | Permitted |
|---|---|
| Account Admin | X |
| Group Manager | X |
| Network User |
N/A
GET https://api-v2.cloudtrax.com/user/list
{
"users":[
{
"user_id":2,
"email":"fizz@buzz.com",
"name":"fizz",
"verified":true,
"enabled":true,
"notes":"fizzbuzz",
"role_id":7,
"created":"2017-06-08T00:00:00Z",
"highest_network_role_id":4 /* only applicable to users with assigned roles, i.e., not Account Admins */
}
]
}30002
PUT /user/<id>/password
Update the requester's password.
Only the requester may access this endpoint.
N/A
PUT https://api-v2.cloudtrax.com/user/123/password
{
"password_current":"L33T",
"password_new":"$P34K"
}{
}20003 20004 20029 20030 20038 20045
POST /user/<id>/password_set
Create a token for resetting a password. This is meant for administrators to be able to reset a user's password without having to see the password; rather they can just deliver the token to the user and have the user set their own password.
Limit 10 tokens per user at once.
| Role | Permitted |
|---|---|
| Account Admin | X |
| Group Manager | X |
| Network User |
N/A
POST https://api-v2.cloudtrax.com/user/123/password_set
{
"user_id":2,
"token":"abc"
}30002 20004 20029 20033 20038 20045
GET /user/<id>/network/<id>
Get the role ID for the given network for the requester.
Only the requester may access this endpoint.
N/A
GET https://api-v2.cloudtrax.com/user/123/network/456
{
"role_id":4
}12047 20029
GET /user/<id>/account
Get the account role ID for the given network for the requester.
Only the requester may access this endpoint.
N/A
GET https://api-v2.cloudtrax.com/user/123/account
{
"account_id":1,
"role_id":2
}30002 20004 20038 20043
GET /user/<id>/service_agreement
Get the status of the requester's acceptance of the service agreement.
Only the requester may access this endpoint.
N/A
GET https://api-v2.cloudtrax.com/user/123/service_agreement
{
"valid":true
}20029
PUT /user/<id>/service_agreement
Accept the service agreement for the requester.
Only the requester may access this endpoint.
N/A
PUT https://api-v2.cloudtrax.com/user/123/service_agreement
{
}20029
PUT /network/<id>/user/<id>
Create a permission for the specified user on the specified network.
| Role | Permitted |
|---|---|
| Account Admin | X |
| Group Manager | X |
| Network User |
| Role | Permitted |
|---|---|
| Network Editor | X |
| Network Viewer | |
| Voucher Editor |
PUT https://api-v2.cloudtrax.com/network/1/user/123
{
"role_id":4
}{
}12047 20000 20016 20018 20027
DELETE /network/<id>/user/<id>
Delete the specified user's permission the specified network.
| Role | Permitted |
|---|---|
| Account Admin | X |
| Group Manager | X |
| Network User |
| Role | Permitted |
|---|---|
| Network Editor | X |
| Network Viewer | |
| Voucher Editor |
DELETE https://api-v2.cloudtrax.com/network/1/user/123
{
}30002 20019 20020 40006
PUT /networkgroup/<id>/user/<id>
Create a permission for the specified user on the specified network group.
| Role | Permitted |
|---|---|
| Account Admin | X |
| Group Manager | X |
| Network User |
| Role | Permitted |
|---|---|
| Network Editor | X |
| Network Viewer | |
| Voucher Editor |
PUT https://api-v2.cloudtrax.com/networkgroup/1/user/123
{
"role_id":4
}{
}30002 20000 20016 20017 20027 40006
DELETE /networkgroup/<id>/user/<id>
Delete the specified user's permission the specified network group.
| Role | Permitted |
|---|---|
| Account Admin | X |
| Group Manager | X |
| Network User |
| Role | Permitted |
|---|---|
| Network Editor | X |
| Network Viewer | |
| Voucher Editor |
DELETE https://api-v2.cloudtrax.com/networkgroup/1/user/123
{
}30002 20019 20020 40006