# Update User Secret

This endpoint updates the "validity_ts" the User Secret (API key) of a given user.

Method Path Operation*
PATCH /users/{user}/secrets update_user_secret

*

In order for a user to perform the "update_user_secret" operation, the permission "update_user_secret" must be included in the list of allowed actions in the statement of the user's role.

# Request

Parameter Type In Description
{user}
required
string path User UUID of the user for whom the User Secret (API key) was created.
validity_ts
optional *
timestamp body Time at which the User Secret (API key) expires. Measured in seconds (to three decimal places) that have elapsed since the Unix epoch(opens new window). If the value is null, the User Secret (API key) does not expire.

*

If you don't include the "validity_ts" parameter in the request body or if you set the value of the parameter to null, the User Secret (API key) will not be set to expire.

In our example, we want to change the "validity_ts" of the User Secret, so that the User Secret does not expire. We send a request to the endpoint with the value of the "validity_ts" parameter set to null).

# Response

Attribute Type Description
fingerprint string 4 last characters of the User Secret.
account string Account UUID.
user string User UUID of the user for whom the User Secret was created.
validity_ts timestamp Time at which the User Secret expires. Measured in seconds (to three decimal places) that have elapsed since the Unix epoch(opens new window). If the value is null, the User Secret does not expire.
created_ts timestamp Time at which the User Secret was created. Measured in seconds (to three decimal places) that have elapsed since the Unix epoch(opens new window).
updated_ts timestamp Time at which the User Secret was last updated. Measured in seconds (to three decimal places) that have elapsed since the Unix epoch(opens new window).

# Status codes

Requests to this endpoint result in generic status codes. For a comprehensive list of status codes, please consult the Status codes section.

Was this article helpful?