# Delete User Secret
This endpoint deletes a User Secret of a given user.
Method | Path | Operation* |
---|---|---|
DELETE | /users/{user}/secrets | delete_user_secret |
*
In order for a user to perform the "delete_user_secret" operation, the permission "delete_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 was created. |
In our example, we want to delete the User Secret of the user with the user UUID "333b4bf7-43b6-4df1-927a-9ddbd7336144"
.
Request
curl --location --request DELETE 'https://rest.trustedtwin.com/users/333b4bf7-43b6-4df1-927a-9ddbd7336144/secrets/' \
--header 'Authorization: VVNSC3bOfkVsVt/NsuQMr8VVJ+i0GTefQAcGjiu9V1TpqopWR75fC1W0pa10R3Gg'
from trustedtwin.tt_api import TTRESTService
TT_SERVICE = TTRESTService(
tt_auth="VVNSC3bOfkVsVt/NsuQMr8VVJ+i0GTefQAcGjiu9V1TpqopWR75fC1W0pa10R3Gg"
)
status, response = TT_SERVICE.delete_user_secret("333b4bf7-43b6-4df1-927a-9ddbd7336144")
import { SecretsApi, Configuration } from "@trustedtwin/js-client";
var secretsApi = new SecretsApi(new Configuration({apiKey: "VVNSC3bOfkVsVt/NsuQMr8VVJ+i0GTefQAcGjiu9V1TpqopWR75fC1W0pa10R3Gg"}))
const deletedUserSecret = await secretsApi.deleteUserSecret({
user: "3d0f1348-612a-4804-b632-24c4b871e76e",
});
# 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). |
Example JSON response
{
"fingerprint": "hdS2",
"account": "9891264d-4a77-4fa2-ae7f-84c9af14ae3b",
"user": "333b4bf7-43b6-4df1-927a-9ddbd7336144",
"validity_ts": 1645716174.796,
"created_ts": 1646227994.603,
"updated_ts": 1646228121.176
}
# 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?