API reference · Settings
Confirm it's you: send a code to the current email or phone
post
/settings/reauth/request-code| Authentication | Customer token (Bearer) |
|---|---|
| Access | Free user · Pro user Customer token (Bearer) — free and paid users |
| Rate limit | 5/1min |
Sends a 6-digit code (guard reauth) to the account's CURRENT email, or its verified phone when it has no email. The
code proves the person at the keyboard still controls the account before POST /settings/email/verify,
POST /settings/phone/verify, DELETE /settings/phone or DELETE /settings/account (they all require
reauth_token). Same timers and limits as sign-in codes; settings codes are capped per account per day
(RAWI_SETTINGS_CODES_DAILY, default 10). Throttle 5/min.
Responses
200
| Field | Type |
|---|---|
sent* | boolean |
channel* | string ("email", "sms") |
to* | string |
expires_in* | integer |
resend_in* | integer |
dev_code* | string |
json
{
"sent": true,
"channel": "email",
"to": "d***@rawi.local",
"expires_in": 600,
"resend_in": 45
}
401 — Missing/invalid token
| Field | Type |
|---|---|
message* | string |
code | string |
json
{
"message": "Please sign in to continue; your session has ended or is not valid.",
"code": "unauthenticated"
}
429 — Resend timer, daily cap or sign-in lock: {"message","resend_in"}
| Field | Type | Description |
|---|---|---|
message* | string | |
resend_in | integer | Seconds until a new login code may be requested (login-code cooldown only). |
json
{
"message": "Too Many Attempts.",
"resend_in": 0
}
curl example
bash
curl -X POST 'http://127.0.0.1:8010/api/settings/reauth/request-code' \
-H 'Accept: application/json' \
-H "Authorization: Bearer $RAWI_USER_TOKEN"