Skip to main content
POST/gate/password-reset/request

Request Password Reset

Initiates a password reset flow for the specified email address by dispatching a single-use reset token.

The reset token has a 1-hour TTL.

Parameters
projectSlug *path

The project's slug: the path segment after @.

It is unique within the org.

Request body
email *string <email>

The address to send the reset code to.

The response is the same whether or not an active end user has this address; a code is only emailed when one does.

Responses
HTTPK9O CodeDescription
200Success
404K9O_END_USER_NOT_FOUNDNo account was found for the provided email address.
Response body (200)
data *object

The result of the reset request.

If the address belongs to an end user of the project, a reset code is emailed to it.

reset *object

The reset request was accepted.

The answer is the same for every address.

requested *true

Always true, whether or not the address belongs to an end user, so the response does not reveal who is registered.

expiresAt *string <date-time>

When the reset code expires, one hour from now.

Present for every address, registered or not.

debugTokenstring

The reset code itself.

Only in a test deployment that turns this on; a production deployment never includes it.

meta *any

Request metadata: cost, timing and the request and trace ids.

TypeScript
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.gate.passwordReset.request({
  email: '[email protected]'
})

Showing example in TypeScript

Request example
{
  "email": "[email protected]"
}
Response example (200)
{
  "data": {
    "reset": {
      "requested": true,
      "expiresAt": "string"
    },
    "debugToken": "string"
  }
}

More in Sign-in & Sessions