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.
/v1/users/{username}
Use this endpoint to retrieve, delete, or update a user account.
Get information about a specific user account.
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" }] }
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
.
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" }] }
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.
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" }] }
HTTP Status Code | Reason |
---|---|
| Invalid username, |
| Unable to validate the credentials |
| Not using the |
| Account does not exist |
| Unknown reason |