مرجع API · Settings
Confirm it's you: verify the code (get reauth_token)
post
/settings/reauth/verify| احراز هویت | توکن مشتری (Bearer) |
|---|---|
| سطح دسترسی | کاربر رایگان · کاربر حرفهای Customer token (Bearer) — free and paid users |
| محدودیت نرخ | 10/1min |
بدنه درخواست
| فیلد | نوع | توضیح |
|---|---|---|
code* | string | the 6-digit code |
نمونهjson
{
"code": "{{devCode}}"
}
پاسخها
200
| فیلد | نوع |
|---|---|
reauth_token* | string |
expires_in* | integer |
json
{
"reauth_token": "…",
"expires_in": 600
}
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"
}
422 — Wrong, expired or used-up code (errors.code)
| فیلد | نوع |
|---|---|
message* | string |
errors* | object |
json
{
"message": "",
"errors": {
"email": [
"ایمیل معتبر نیست."
]
}
}
429 — Rate limit or login-code resend cooldown. Headers: Retry-After, X-RateLimit-*.
| فیلد | نوع | توضیح |
|---|---|---|
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/verify' \
-H 'Accept: application/json' \
-H "Authorization: Bearer $RAWI_USER_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"code": "{{devCode}}"
}'