Rawi

API reference · Settings

Request email verification code

post/settings/email/request-code
AuthenticationCustomer token (Bearer)
AccessFree user · Pro user

Customer token (Bearer) — free and paid users

Rate limit10/1min

Phone-only accounts add an email: sends a code to the new address.

Request body

Examplejson
{
  "email": "erfan@avand.example"
}

Responses

200 — VerifyCodeResponse

FieldType
sent*boolean
expires_in*integer
resend_in*integer
dev_code*string
json
{
  "sent": false,
  "expires_in": 600,
  "resend_in": 0,
  "dev_code": ""
}

401 — Missing/invalid token, or a token of the wrong owner (admin token on a user route or vice versa): {"message":"…","code":"unauthenticated"} (message in the request language)

FieldType
message*string
codestring
json
{
  "message": "Please sign in to continue; your session has ended or is not valid.",
  "code": "unauthenticated"
}

422 — Validation failed (email invalid / taken)

FieldType
message*string
errors*object
json
{
  "message": "",
  "errors": {
    "email": [
      "ایمیل معتبر نیست."
    ]
  }
}

429 — Resend cooldown (45 s), or route throttle 10 req/min

FieldTypeDescription
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 example

bash
curl -X POST 'http://127.0.0.1:8010/api/settings/email/request-code' \
  -H 'Accept: application/json' \
  -H "Authorization: Bearer $RAWI_USER_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
  "email": "erfan@avand.example"
}'

Try it in the console