مرجع API · Settings
Confirm it's you: send a code to the current email or phone
post
/settings/reauth/request-code| احراز هویت | توکن مشتری (Bearer) |
|---|---|
| سطح دسترسی | کاربر رایگان · کاربر حرفهای Customer token (Bearer) — free and paid users |
| محدودیت نرخ | 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.
پاسخها
200
| فیلد | نوع |
|---|---|
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
| فیلد | نوع |
|---|---|
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"}
| فیلد | نوع | توضیح |
|---|---|---|
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
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"