Rawi

مرجع 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
codestring
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_inintegerSeconds 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"

امتحان در کنسول