Rawi

API reference · Settings

Update scan & language settings

put/settings/run
AuthenticationCustomer token (Bearer)
AccessFree user · Pro user

Customer token (Bearer) — free and paid users

Weekly runs are paid-only. Changing the question language rebuilds the whole set → 409 unless confirm: true.

Request body

FieldTypeDescription
run_frequencystring | null ("weekly", "monthly", null)weekly (paid) | monthly
panel_localestring | null ("fa", "en", null)fa | en (must be panel-enabled in A4)
question_languagestring | null ("fa", "en", null)fa | en (must be question-enabled in A4)
confirmboolean | nullaccept the rebuild
Examplejson
{
  "run_frequency": "monthly",
  "panel_locale": "fa",
  "question_language": "fa"
}

Responses

200 — RunSettings

FieldType
run_frequency*string ("weekly", "monthly")
panel_locale*string ("en", "fa")
question_language*string ("en", "fa")
next_run_at*string | null
allowed_frequencies*any[]
json
{
  "run_frequency": "weekly",
  "panel_locale": "en",
  "question_language": "en",
  "next_run_at": "",
  "allowed_frequencies": [
    null
  ]
}

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"
}

403 — plan_limit — weekly on the free plan

FieldType
message*string
code*string ("plan_limit", "forbidden")
json
{
  "message": "این امکان در طرح راوی حرفه‌ای است.",
  "code": "plan_limit"
}

409 — ConfirmRequired (question language change)

FieldType
messagestring
requires_confirmation*boolean
reasonstring
questions_countinteger
changesobject[]
changes[].fieldstring
changes[].fromany
changes[].toany
json
{
  "message": "",
  "requires_confirmation": true,
  "reason": "",
  "questions_count": 0,
  "changes": [
    {
      "field": "",
      "from": null,
      "to": null
    }
  ]
}

422 — Validation failed (language disabled in A4)

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

curl example

bash
curl -X PUT 'http://127.0.0.1:8010/api/settings/run' \
  -H 'Accept: application/json' \
  -H "Authorization: Bearer $RAWI_USER_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
  "run_frequency": "monthly",
  "panel_locale": "fa",
  "question_language": "fa"
}'

Try it in the console