Skip to main content

Create password

The endpoint provides functionality for creating a password for an existing user.

HTTP request

POST https://$instanceId.id.nevis.cloud/nevis/api/v1/users/$userId/password

Parameters

ParameterInTypeRequired / OptionalDescription
instanceIdpathstringrequiredThe ID of your Identity Cloud instance
userIdpathstringrequiredThe ID of the user

Request body

You can create password of a user by only providing the password value.

ParameterTypeRequired / OptionalDescription
passwordstringrequiredThe password of the user
stateNameenumoptionalThe state of the password Default: active Values: active,initial

Example request

Adjust the user ID in the following snippet and type a password value to be set in the variable password

userId=your-user-id-123 \
read -s password
curl --request POST "https://$instanceId.id.nevis.cloud/nevis/api/v1/users/$userId/password" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $accessKey" \
--data "{ \"password\" : \"$password\" }"

HTTP response

On success

HTTP/1.1 201 is returned if the password is successfully created.

The response has the following additional header Location, containing the userId of the user:

https://$instanceId.id.nevis.cloud/nevis/api/v1/users/$userId/password

On failure

HTTP/1.1 401 is returned if the authorization fails due to an invalid access key.

HTTP/1.1 422 is returned if invalid request content is given.

HTTP/1.1 500 is returned if an unexpected error occurs.