# Set a new password from a reset email

Canonical page: https://docs.ovok.com/authentication/account/process-password-reset

| Method | Path |
| --- | --- |
| `POST` | `/v2/auth/reset-password/process` |

[Authentication](/authentication) · [Account routes](/authentication#account-routes) · [Email templates](/email-templates)

Sets a new password using the `id` and `secret` from a reset or invitation email. Use it when your app handles the password form itself, on the page that the emailed link opens. The first step for a reset is [Send a password reset email](/authentication/account/reset-password).

<Callout type="info">

This is an account-level route. It has no `/v1/auth/tenant/` variant and needs no token.

</Callout>

**Auth:** None. The `id` and `secret` from the reset or invitation email are the credential.
**Scope:** The user the request was created for.

## Request [#request]

### Body [#body]

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The request id from the reset or invitation email's `<app URL>/setpassword/<id>/<secret>` link. |
| `secret` | `string` | Yes | The secret from the same link. |
| `password` | `string` | Yes | The new password. It must meet the [password policy](/authentication#password-policy). |

## Behaviour [#behaviour]

- A request can be used once. Ovok marks it used before it changes the password. If the password change then fails, the request cannot be retried and the user must ask for a new email.
- A newer reset email replaces the older one: after a second [reset request](/authentication/account/reset-password), only the newest `id` and `secret` work.
- Reset links have no lifetime limit. A set-password link from an invitation works for 7 days after it was sent; see [Invitations](/invitations#limits-and-shared-behaviour).
- Setting the password also marks the user's email address as verified, because the secret came by email.
- The route does not end existing sessions.
- The response is a minimal User with `resourceType`, `id` and `email`.
- The route is rate limited to 5 requests per minute for each caller.

## Example [#example]

```bash
curl -X POST 'https://api.sandbox.ovok.com/v2/auth/reset-password/process' \
  -H 'Content-Type: application/json' \
  -d '{
    "id": "4d8f1a63-9b2e-4c70-8e15-a3b6d9c2f047",
    "secret": "<secret from the email>",
    "password": "<new password>"
  }'
```

## Successful response [#successful-response]

`201` — The password is changed.

```json
{
  "resourceType": "User",
  "id": "9a4e6c10-3b7d-4f28-8c15-2d0e7b9a6f43",
  "email": "alex@example.com"
}
```

| Field | Type | Description |
| --- | --- | --- |
| `resourceType` | `"User"` | Always `User`. |
| `id` | `string (uuid)` | User id. |
| `email` | `string` | Sign-in email address. |

## Errors [#errors]

| Status | Meaning |
| --- | --- |
| [`404`](/errors/not-found) | No reset request has this `id`. |
| [`409`](/errors/conflict) | The reset request was already used, or a newer reset email replaced it. |
| [`422`](/errors/validation-failed) | `id`, `secret` or `password` is missing or not a string, `password` breaks the [password policy](/authentication#password-policy), or `secret` does not match the request. |
| [`429`](/errors/too-many-requests) | More than 5 requests in a minute from the same caller. |
| [`410`](/errors/gone) | The invitation's set-password link expired. Ask for a new invite. |
