مرجع API · Settings
Download my data
post
/settings/export| احراز هویت | توکن مشتری (Bearer) |
|---|---|
| سطح دسترسی | کاربر رایگان · کاربر حرفهای Customer token (Bearer) — free and paid users |
| محدودیت نرخ | 5/60min |
The account's data as one JSON document, sent as a download (Content-Disposition: attachment; filename="rawi-data-YYYY-MM-DD.json"): the account (email, phone, plan, notification choices), the brand with its products, target customers, competitors and questions, a summary of every scan (answers, and answers naming the brand, per scan and per question; the answer texts stay in the reports), payments and consultation requests. Internal fields (AI costs and routing, admin notes, payer hashes) are left out. Personal data, so like email/phone changes and deletion it needs a fresh reauth_token (used up by the download). Throttle 5 per hour.
بدنه درخواست
| فیلد | نوع | توضیح |
|---|---|---|
reauth_token | string | from POST /settings/reauth/verify (10 minutes); without it: 422 {"code":"reauth_required"} |
نمونهjson
{
"reauth_token": "{{reauthToken}}"
}
پاسخها
200
| فیلد | نوع | توضیح |
|---|---|---|
format* | string | |
version* | integer | |
exported_at* | string | |
account* | object | |
account.id* | integer | Unique ID. |
account.email* | string | null | Email address. |
account.phone* | string | null | Mobile number. |
account.name* | string | null | |
account.locale* | string | Language: fa or en. |
account.plan* | string ("paid", "free") | Plan: free (Free) or paid (Pro). |
account.billing_period* | string | null | |
account.plan_expires_at* | string | null | |
account.created_at* | string | null | When it was created (ISO 8601). |
account.last_login_at* | string | null | |
account.email_notifications* | object | |
account.email_notifications.reminders* | boolean | |
account.email_notifications.report_ready* | boolean | |
account.email_notifications.renewal* | boolean | |
account.sms_notifications* | boolean | |
account.referral_code* | string | |
brands* | any[] | string[] | |
payments* | object[] | |
payments[].id* | integer | Unique ID. |
payments[].period* | string | |
payments[].status* | string | Current status. |
payments[].base_amount* | integer | |
payments[].period_discount* | integer | |
payments[].code_discount* | integer | |
payments[].vat* | integer | |
payments[].total* | integer | |
payments[].currency* | string | Currency code, e.g. USD, EUR or IRT. |
payments[].tracking_code* | string | null | |
payments[].gateway_message* | string | null | |
payments[].gateway_name* | string | null | |
payments[].period_start* | string | null | |
payments[].period_end* | string | null | |
payments[].paid_at* | string | null | |
payments[].created_at* | string | null | When it was created (ISO 8601). |
payments[].auto_renew* | boolean | |
payments[].renewal_amount* | integer | null | «Renew automatically» (Stripe subscription) |
payments[].amount_refunded* | integer | Refunds (status refunded / partially_refunded): total refunded so far and when the last one was made. |
payments[].refunded_at* | string | null | |
consultation_requests* | object[] | |
consultation_requests[].id* | integer | Unique ID. |
consultation_requests[].name* | string | |
consultation_requests[].phone* | string | Mobile number. |
consultation_requests[].method* | string | |
consultation_requests[].time_slot* | string | |
consultation_requests[].preferred_days* | array | null | |
consultation_requests[].note* | string | null | |
consultation_requests[].status* | string | Current status. |
consultation_requests[].created_at* | string | null | When it was created (ISO 8601). |
json
{
"format": "rawi-account-export",
"version": 1,
"exported_at": "2026-11-26T10:00:00Z",
"account": {
"id": 1,
"email": "demo@rawi.local",
"phone": null,
"plan": "free",
"locale": "en"
},
"brands": [
{
"name": "Acme Books",
"domain": "acmebooks.example",
"products": [],
"target_customers": [],
"competitors": [],
"questions": [
{
"id": 1,
"text": "…",
"stage": "selection",
"answers": 6,
"answers_naming_you": 2
}
],
"scans": [
{
"id": 3,
"status": "complete",
"answers": 60,
"answers_naming_you": 14
}
]
}
],
"payments": [],
"consultation_requests": []
}
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 — {"code":"reauth_required"}: no valid reauth_token
| فیلد | نوع |
|---|---|
message* | string |
errors* | object |
json
{
"message": "",
"errors": {
"email": [
"ایمیل معتبر نیست."
]
}
}
429 — More than 5 downloads in an hour
| فیلد | نوع | توضیح |
|---|---|---|
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/export' \
-H 'Accept: application/json' \
-H "Authorization: Bearer $RAWI_USER_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"reauth_token": "{{reauthToken}}"
}'