> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bludia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Password reset

> Let end users reset a forgotten password with POST /auth/{guard}/password/forgot and POST /auth/{guard}/password/reset. Reset tokens are single-use and expire after 60 minutes; resetting revokes all sessions.

Password reset is a two-step flow. Both endpoints need only your API key, and the guard must have **Allow password reset** on (the default).

```text theme={null}
1. POST /auth/users/password/forgot  { login }            → generic message; reset token issued
2. POST /auth/users/password/reset   { token, password }  → password changed, all sessions revoked
3. POST /auth/users/login            { login, password }  → new session
```

## Step 1: request a reset

`POST /auth/{guard}/password/forgot`

```bash theme={null}
curl -X POST "$BASE_URL/auth/users/password/forgot" \
  -H "Content-Type: application/json" \
  -H "X-BLUDIA-API-KEY: $BLUDIA_PUBLIC_KEY" \
  -d '{ "login": "sarah@example.com" }'
```

```json theme={null}
{ "message": "If an account exists, password reset instructions have been sent." }
```

The response is the same whether or not the account exists, so it can't be used to discover accounts.

> [!WARNING]
>
> Beta: reset tokens are not emailed automatically yet. Until delivery is enabled, contact [support](mailto:support@bludia.com) if you need password reset in production.

## Step 2: set a new password

`POST /auth/{guard}/password/reset`

| Body field | Required | Rules |
| :- | :- | :- |
| `token` | Yes | The reset token |
| `password` | Yes | At least 8 characters |

```bash theme={null}
curl -X POST "$BASE_URL/auth/users/password/reset" \
  -H "Content-Type: application/json" \
  -H "X-BLUDIA-API-KEY: $BLUDIA_PUBLIC_KEY" \
  -d '{ "token": "RESET_TOKEN", "password": "a new strong passphrase" }'
```

```json theme={null}
{ "message": "Password has been reset. Please log in again." }
```

## Rules

| Rule | Value |
| :- | :- |
| Token lifetime | 60 minutes |
| Token use | Single use |
| After reset | All the user's refresh tokens are revoked (signed out everywhere) |
| Rate limit | 10 requests per minute per IP |

| Error | Status | When |
| :- | :- | :- |
| `password_reset_disabled` | 403 | The guard has password reset off |
| `invalid_or_expired_token` | 401 | Token wrong, used, or older than 60 minutes |
| Validation error | 422 | Password missing or shorter than 8 characters |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.