Skip to content
v2.7

Create password recovery

Sends the user an email with a temporary secret key for password reset.

POST/account/recoveryScope sessions.write

Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the PUT /account/recovery endpoint to complete the process. The verification link sent to the user’s email address is valid for 1 hour.

email string required

User email.

url string required

URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an open redirect attack against your project API.

Access: no key or session: the project ID is enough.

201Success
400Invalid or missing parameter
401No session, no permission on the resource or key without the scope
429Rate limit

Every error comes as JSON with code, type and message: see Errors.

import { Client, Account } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.createRecovery({
url: 'https://example.com',
});
console.log(result);
Response201 Created
{
"$id": "bb8ea5c16897e",
"$createdAt": "2020-10-15T06:38:00.000+00:00",
"userId": "5e5ea5c168bb8",
"secret": "",
"expire": "2020-10-15T06:38:00.000+00:00",
"phrase": "Golden Fox"
}

The descriptions on this page come from the server API specification (BSD-3-Clause license), and the examples come from the SDK generator (MIT license). The full notices are in the NOTICE file of the @owbase/web and @owbase/node packages.

Was this page helpful?