Comment on page
Reset Users E2E Key
URL | Requires Auth | HTTP Method |
---|---|---|
/api/v1/users.resetE2EKey | yes | POST |
Argument | Example | Required | Description |
---|---|---|---|
X-User-Id | myuser-name | Required | The authenticated user ID. |
X-Auth-Token | myauth-token | Required | Auth token. |
x-2fa-code | 148750 | Required | The 2fa code. |
Argument | Example | Required | Description |
---|---|---|---|
userId | Q29yYlEZEByCLOQa70-QGNLRjVRhshsN2Sky6-FLAlMXbhU | Required | The userId of the user whose e2e key you want to reset. You can also use username. |
{
"userId":"GonjPyg3gB3Z9ur9s"
}
curl --location 'http://localhost:3000/api/v1/users.resetE2EKey' \
--header 'x-auth-token: Q29yYlEZEByCLOQa70-QGNLRjVRN2Sky6-FLAlMXbhU' \
--header 'x-user-id: GonjPyg3gB3Z9ur9s' \
--header 'x-2fa-code: 175842' \
--data '{
"userId":"GonjPyg3gB3Z9ur9s"
}'
{
"success": true
}
Any of the following errors can occur on the endpoint.
- Authorization: Requires an authentication token for the request to be made.
- No Permission: This occurs when the authenticated user doesn't have the
edit-other-user-e2ee
permission. - Invalid User: This occurs when the
userId
orusername
in the body is invalid. - TOTP Required: Requires two-factor authentication for the request to be made.
- Invalid TOTP: Requires a valid two-factor authentication code.
Authorization
No Permission
Invalid User
TOTP Required
Invalid TOTP
{
"status": "error",
"message": "You must be logged in to do this."
}
{
"success": false,
"error": "Not allowed [error-not-allowed]",
"errorType": "error-not-allowed"
}
{
"success": false,
"error": "The required \"userId\" or \"username\" param provided does not match any users [error-invalid-user]",
"errorType": "error-invalid-user"
}
{
"success": false,
"error": "TOTP Required [totp-required]",
"errorType": "totp-required",
"details": {
"method": "totp",
"codeGenerated": false,
"availableMethods": [
"totp"
]
}
}
{
"success": false,
"error": "TOTP Invalid [totp-invalid]",
"errorType": "totp-invalid",
"details": {
"method": "totp",
"codeGenerated": false
}
}
Version | Description |
---|---|
3.6.0 | Added |
Last modified 4mo ago