Endpoints to create and delete a user when logged in as Administrator.
Admin - Users API
Interfaces
Object Synopses
UserRequest
-
uid
String
Uid must be included. Unique user id
-
first_name
String
User first name
-
last_name
String
User last name
-
full_name
String
User full name
-
sortable_name
String
User sortable name (last, first in European-American culture)
-
email
String
User email address
-
locale
String
The user’s language code
-
manager_id
String
Optional: ID of the user’s manager. Alternatively, the UID of the user’s manager, prefixed with uid:.
-
hire_date
Date
Date that user was hired, in ISO 8601 format (YYYY-MM-DD)
-
job_title
string
Job title of user
-
department
string
Department of user
-
hris_id
string
HRIS ID of user, must be unique
-
custom_fields
Array
Optional custom fields. These must be created before assigning them to users.
Add a user
POST
/api/admin/users
Response Codes
200 OK
if the user was created
400 Bad Request
if the user already exists
Parameters
-
An array of UserRequest objects. Even though an array is passed in to this endpoint, it only adds one user a time. All extra entries in the array are ignored.
Example Request
Example Response
{
"meta": {},
"linked": {},
"users": [{
"id": 3,
"uid": "hsolo",
"first_name": "Han",
"last_name": "Solo",
"email": "h.solo@millennium-falcon.com",
"locale": "en",
"roles": [],
"name": "Han Solo",
"avatar_url": null,
"deleted_at": null,
"hire_date": "2016-01-31",
"links": [],
"meta": {
"can_masquerade": true
}
}]
}
Delete a user
DELETE
/api/admin/users/:id
This endpoint deletes the user by id. A user cannot delete himself/herself.
Response Codes
204 No Content
when deletion is complete
404 Not Found
if requested user id does not exist
Parameters
-
id
Integer
Required
The id of the user to be deleted. Alternatively, the user’s uid,
prefixed with “uid:”.
-
async
Boolean
If true, the user destroy is processed with an async worker
Return summary information for user
GET
/api/admin/users/:id/summary
This endpoint returns counts for the following:
Completed Courses
Completed Programs
Completed Live Trainings
Total Completed On Time
Total Overdue
Response Codes
- ‘200’ If user is valid
- ‘404 Not Found’ if requested user doesn’t exist
Parameters
-
id
Integer
Required
The id of the user for which information is to be returned.
-
start_date
Date
Start of the time period to pull data from.
-
end_date
Date
End of the time period to pull data from.
Example Response
{
"summary": {
"completed_courses":17,
"completed_programs":2,
"completed_live_courses":2,
"total_on_time":11,
"total_overdue":8
}
}
Hide a deleted user
POST
/api/admin/users/:id/hide
This endpoint hides the deleted user by id. A user cannot hide himself/herself nor hide an active user.
Response Codes
204 No Content
when hiding is complete
404 Not Found
if requested user id does not exist
Parameters
-
id
Integer
Required
The id of the user to be hidden. Alternatively, the user’s uid,
prefixed with “uid:”.
Interfaces
Object Synopses
UserRequest
-
uid
StringUid must be included. Unique user id
-
first_name
StringUser first name
-
last_name
StringUser last name
-
full_name
StringUser full name
-
sortable_name
StringUser sortable name (last, first in European-American culture)
-
email
StringUser email address
-
locale
StringThe user’s language code
-
manager_id
StringOptional: ID of the user’s manager. Alternatively, the UID of the user’s manager, prefixed with uid:.
-
hire_date
DateDate that user was hired, in ISO 8601 format (YYYY-MM-DD)
-
job_title
stringJob title of user
-
department
stringDepartment of user
-
hris_id
stringHRIS ID of user, must be unique
-
custom_fields
ArrayOptional custom fields. These must be created before assigning them to users.
Add a user
Response Codes
200 OK
if the user was created400 Bad Request
if the user already exists
Parameters
-
An array of UserRequest objects. Even though an array is passed in to this endpoint, it only adds one user a time. All extra entries in the array are ignored.
Example Request
Example Response
{ "meta": {}, "linked": {}, "users": [{ "id": 3, "uid": "hsolo", "first_name": "Han", "last_name": "Solo", "email": "h.solo@millennium-falcon.com", "locale": "en", "roles": [], "name": "Han Solo", "avatar_url": null, "deleted_at": null, "hire_date": "2016-01-31", "links": [], "meta": { "can_masquerade": true } }] }
Delete a user
This endpoint deletes the user by id. A user cannot delete himself/herself.
Response Codes
204 No Content
when deletion is complete404 Not Found
if requested user id does not exist
Parameters
-
id
Integer RequiredThe id of the user to be deleted. Alternatively, the user’s uid, prefixed with “uid:”.
-
async
BooleanIf true, the user destroy is processed with an async worker
Return summary information for user
This endpoint returns counts for the following: Completed Courses Completed Programs Completed Live Trainings Total Completed On Time Total Overdue
Response Codes
- ‘200’ If user is valid
- ‘404 Not Found’ if requested user doesn’t exist
Parameters
-
id
Integer RequiredThe id of the user for which information is to be returned.
-
start_date
DateStart of the time period to pull data from.
-
end_date
DateEnd of the time period to pull data from.
Example Response
{ "summary": { "completed_courses":17, "completed_programs":2, "completed_live_courses":2, "total_on_time":11, "total_overdue":8 } }
Hide a deleted user
This endpoint hides the deleted user by id. A user cannot hide himself/herself nor hide an active user.
Response Codes
204 No Content
when hiding is complete404 Not Found
if requested user id does not exist
Parameters
-
id
Integer RequiredThe id of the user to be hidden. Alternatively, the user’s uid, prefixed with “uid:”.