Rawi

مرجع API · Auth & profile

Update profile

patch/me
احراز هویتتوکن مشتری (Bearer)
سطح دسترسیکاربر رایگان · کاربر حرفه‌ای

Customer token (Bearer) — free and paid users

Changes the panel language or the display name.

بدنه درخواست

فیلدنوعتوضیح
localestring ("fa", "en")fa | en
namestring | null
نمونهjson
{
  "locale": "fa",
  "name": "عرفان"
}

پاسخ‌ها

200 — Me

فیلدنوعتوضیح
id*integerUnique ID.
email*string | nullEmail address.
phone*string | nullMobile number.
phone_verified*boolean
sms_notifications*boolean
name*string | null
locale*string ("en", "fa")Language: fa or en.
plan*string ("paid", "free")Plan: free (Free) or paid (Pro).
billing_period*string | null
plan_expires_at*string | null
onboarding_step*integer
onboarding_completed*boolean
referral_code*string
limits*any[]Limits of the account's plan.
brand*object | null
brand.id*integerUnique ID.
brand.name*string | null
brand.domain*string | nullSite domain.
brand.initial*string
gaps_count*integer | null
last_run*object | null
last_run.id*integerUnique ID.
last_run.kind*string
last_run.status*stringCurrent status.
last_run.engines*any[]AI assistants included.
last_run.started_at*string | nullWhen it started (ISO 8601).
last_run.finished_at*string | nullWhen it finished (ISO 8601).
last_run.done*integer
last_run.total*integer
next_run_at*string | null
run_frequency*string | null ("weekly", "monthly", null)R1 plan widget: the schedule the user chose in S4 (the plan's allowed value, as RunService schedules it).
queue*array | null
notify_requested*booleanSidebar plan widget «On the Pro list»: «Notify me» pressed (C2 or /signup?notify=pro) and not answered yet.
run_issue*object | nullThe latest run failed: automatic retry state for the app shell banner (RunService::issue; null otherwise).
run_issue.state*string ("retrying", "stopped")
run_issue.attempts*integer
run_issue.max_retries*integer
run_issue.has_report*boolean
run_issue.next_retry_at*string | null
run_issue.next_run_at*string | null
run_issue.message*stringHuman-readable message in the request language.
json
{
  "id": 0,
  "email": "",
  "phone": "",
  "phone_verified": false,
  "sms_notifications": false,
  "name": "",
  "locale": "en",
  "plan": "paid",
  "billing_period": "",
  "plan_expires_at": "",
  "onboarding_step": 0,
  "onboarding_completed": false,
  "referral_code": "",
  "limits": [
    null
  ],
  "brand": {
    "id": 0,
    "name": "",
    "domain": "",
    "initial": ""
  },
  "gaps_count": 0,
  "last_run": {
    "id": 0,
    "kind": "",
    "status": "",
    "engines": [
      null
    ],
    "started_at": "",
    "finished_at": "",
    "done": 0,
    "total": 0
  },
  "next_run_at": "",
  "run_frequency": "weekly",
  "queue": [
    null
  ],
  "notify_requested": false,
  "run_issue": {
    "state": "retrying",
    "attempts": 0,
    "max_retries": 3,
    "has_report": false,
    "next_retry_at": "",
    "next_run_at": "",
    "message": ""
  }
}

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)

فیلدنوع
message*string
codestring
json
{
  "message": "Please sign in to continue; your session has ended or is not valid.",
  "code": "unauthenticated"
}

422 — Validation failed (locale, name)

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

نمونهٔ curl

bash
curl -X PATCH 'http://127.0.0.1:8010/api/me' \
  -H 'Accept: application/json' \
  -H "Authorization: Bearer $RAWI_USER_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
  "locale": "fa",
  "name": "عرفان"
}'

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