We are sunsetting On-Premises API. Refer to our On-Premises API Sunset document for details, and to learn how to migrate to our next-generation Cloud API.

User

/v1/users/{username}

Use this endpoint to retrieve, delete, or update a user account.

Read

Get information about a specific user account.

Example

To retrieve a user account, use a GET request on the /users/{username} endpoint:

GET /v1/users/username
Authorization: Bearer your-auth-token

When successful, your response is a HTTP status code 200 OK and a payload similar to the following:

{
   "users": [{
     "ROLES": "ROLE_ADMIN | ROLE_USER",
     "username": "username"
   }]
}

Updating

A user with the role of ROLE_ADMIN can update the password associated with user accounts with roles of ROLE_ADMIN and ROLE_USER. Individual users can also update the password for their own accounts. Updating a user account password does not invalidate any access tokens associated with the user. Currently, only user admin has ROLE_ADMIN; other users have ROLE_USER.

Example

To update the password for an account, provide the Bearer token along with the username and new password.

PUT /v1/users/username
Authorization: Bearer your-auth-token
   
{
  "password": "new-password"
}

If successful, the password associated with the username is updated. The HTTP status code 200 OK is returned, along with a payload similar to the following:

{
   "users": [{
      "username": "username"
   }]
}

Deleting

If an account is compromised or if there are any other reasons to delete it, the admin must delete the account. After you successfully delete an account, all the tokens associated with the account are removed from the system.

The admin account cannot be removed from the system.

Example

Use the following API call to delete a user account, where username is the name of the user account you want to delete. The Bearer token is the token belonging to the admin account.

DELETE /v1/users/username
Authorization: Bearer your-auth-token

If successful, the user account is deleted. The response includes the HTTP status code 200 OK and the following payload:

{
   "users": [{
      "username": "username"
   }]
}

Error Codes

HTTP Status CodeReason

400

Invalid username, admin

401

Unable to validate the credentials

403

Not using the admin account

404

Account does not exist

500

Unknown reason