User Management API Methods
Rest API methods to manage users, including creating, updating, listing, deleting, and returning user objects.
Create a User
A POST
method to create a new user.
Request
POST /api/v1/users/
Sample Request Body
{
"username" : <string>,
"status" : <"ACTIVE"|"INACTIVE"|"LOCKED">
"firstName" : <string>,
"lastName" : <string>,
"email" : <string>,
"title" : <string_may_be_null>,
"phoneNumber" : <string_may_be_null>,
"groups" : [<group_1_id>, ...],
"isAdmin" : true | false
}
Response
{
"pid" : <integer>,
"userId": <integer>,
"username" : <string>,
"status" : <"ACTIVE"|"INACTIVE"|"LOCKED">
"firstName" : <string>,
"lastName" : <string>,
"email" : <string>,
"title" : <string_may_be_null>,
"phoneNumber" : <string_may_be_null>,
"groups" : [<group_1_id>, ...],
"isAdmin" : <"true"|"false">
}
If isAdmin
is set to true, the user is created as a partner admin. This property also lets you know whether a user is a partner admin.
Returns 409 Conflict
if the username is already taken.
Update a User
A PUT
method to update a user.
Request
PUT /api/v1/users/
<userId>
Sample Request Body
{
"username" : <string>,
"status" : <"ACTIVE"|"INACTIVE"|"LOCKED">
"firstName" : <string>,
"lastName" : <string>,
"email" : <string>,
"title" : <string_may_be_null>,
"phoneNumber" : <string_may_be_null>,
"groups" : [<group_1_id>, ...]
}
Response
{
"pid" : <integer>,
"userId": <integer>,
"username" : <string>,
"status" : <"ACTIVE"|"INACTIVE"|"LOCKED">
"firstName" : <string>,
"lastName" : <string>,
"email" : <string>,
"groups" : [<group_1_id>, ...]
}
Returns 409 Conflict
if the username is already taken.
Update Logged-In User
A PUT
method to update the currently logged-in user.
Request
PUT /self/update
Sample Request Body
{
"status" : <"ACTIVE"|"INACTIVE"|"LOCKED">
"firstName" : <string>,
"lastName" : <string>,
"email" : <string>,
"title" : <string_may_be_null>,
"phoneNumber" : <string_may_be_null>
}
Response
{
"userId": <integer>,,
"status" : <"ACTIVE"|"INACTIVE"|"LOCKED">
"firstName" : <string>,
"lastName" : <string>,
"email" : <string>
"title" : <string_may_be_null>,
"phoneNumber" : <string_may_be_null>
}
Returns 409 Conflict
if the username is already taken.
Update Logged-In User Password
A PUT
method to update the currently logged-in user.
Request
POST /users/self/update-password
Sample Request Body
{ "oldPassword" : "old password", "newPassword" : "new password" }
Returns 200 OK
if successful. Returns 400 Bad Request
if something is wrong with either password.
Reset Logged-In User Password
A PUT
method to reset the currently logged-in user. Audience Management sends the user a system-generated password.
Request
POST /self/reset-password
Returns 200 OK
if successful.
Return User Object for a User ID
A Get
method to return the user object for a User ID.
Request
GET /api/v1/users/
<userId>
Response
{
"pid" : <integer>,
"userId": <integer>,
"username" : <string>,
"status" : <"ACTIVE"|"INACTIVE"|"LOCKED">
"firstName" : <string>,
"lastName" : <string>,
"email" : <string>,
"title" : <string_may_be_null>,
"phoneNumber" : <string_may_be_null>,
"groups" : [<groupd_id_1>, ...]
}
Return User Object for Logged-In User
A Get
method to return the user object for the currently logged-in user.
Request
GET /api/v1/users/self
Response
{
"pid" : <integer>,
"userId": <integer>,
"username" : <string>,
"status" : <"ACTIVE"|"INACTIVE"|"LOCKED">
"firstName" : <string>,
"lastName" : <string>,
"email" : <string>,
"title" : <string_may_be_null>,
"phoneNumber" : <string_may_be_null>,
"groups" : [<groupd_id_1>, ...]
}
List Users
A GET
method to list users.
Request
GET /api/v1/users/
You can specify multiple group IDs in the query parameters:
GET /api/v1/users/?groupId=343&groupdId=12
This query returns a list of all users in the specified groups.
Response
{
"pid" : <integer>,
"userId": <integer>,
"username" : <string>,
"status" : <"ACTIVE"|"INACTIVE"|"LOCKED">
"firstName" : <string>,
"lastName" : <string>,
"email : <string>,
"title" : <string_may_be_null>,
"phoneNumber" : <string_may_be_null>,
"groups" : [<group_1_id>, ...]
}
Delete a User
A DELETE
method to delete a user.
Request
DELETE /api/v1/users/
<user_id>
Returns 204 No Content
if successful. In case of conflict returns 409 Conflict
.
Delete Users in Bulk
A POST
method to delete multiple users in bulk.
Request
POST /api/v1/users/bulk-delete
Sample Request Body
{[<user_id_1>, <user_id_2>, ...]}