API reference · Talk to an expert
Submit expert request
post
/consultations| Authentication | Customer token (Bearer) |
|---|---|
| Access | Free user · Pro user Customer token (Bearer) — free and paid users |
| Rate limit | 10/1min |
Creates the request (status new, due_at = two Iranian working days later: Saturday–Wednesday, Tehran time), snapshots the account, sends email and fires consultation_submitted. The user gets the consultation SMS only when phone is the account's verified phone. Every active or invited super admin and consultant gets the admin email; admins with a mobile and «هشدار پیامکی» on also get the admin_new_consultation SMS.
Request body
Examplejson
{
"name": "نسرین کاظمی",
"phone": "09123456789",
"method": "phone",
"time_slot": "morning",
"note": "میخواهم بدانم چرا نیکحساب در پرسشهای مقایسه همیشه اول است و ما نیستیم.",
"source_page": "r2"
}
Responses
201 — ConsultationRequest
| Field | Type | Description |
|---|---|---|
id* | integer | Unique ID. |
name* | string | |
phone* | string | Mobile number. |
method* | string | |
time_slot* | string | |
preferred_days* | any[] | |
note* | string | null | |
source_page* | string | null | |
status* | string | Current status. |
due_at* | string | null | |
snapshot* | object | |
snapshot.brand* | string | null | |
snapshot.plan* | string | string ("free") | Plan: free (Free) or paid (Pro). |
snapshot.share* | string | null | |
snapshot.gaps* | string | null | Missed questions: AI named a competitor and not you. |
snapshot.last_run_at* | string | null | |
snapshot.source_page* | string | null | |
created_at* | string | null | When it was created (ISO 8601). |
json
{
"id": 23,
"name": "نسرین کاظمی",
"phone": "09123456789",
"method": "phone",
"time_slot": "morning",
"note": "میخواهم بدانم چرا نیکحساب در پرسشهای مقایسه همیشه اول است و ما نیستیم.",
"source_page": "r2",
"status": "new",
"due_at": "2026-11-29T16:20:00Z",
"snapshot": {
"brand": "آوند",
"plan": "free",
"share": null,
"gaps": null,
"last_run_at": null,
"source_page": "r2"
},
"created_at": "2026-11-24T16:20:00Z"
}
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)
| Field | Type |
|---|---|
message* | string |
code | string |
json
{
"message": "Please sign in to continue; your session has ended or is not valid.",
"code": "unauthenticated"
}
409 — The change needs confirmation (409).
| Field | Type |
|---|---|
message | string |
requires_confirmation* | boolean |
reason | string |
questions_count | integer |
changes | object[] |
changes[].field | string |
changes[].from | any |
changes[].to | any |
json
{
"message": "",
"requires_confirmation": true,
"reason": "",
"questions_count": 0,
"changes": [
{
"field": "",
"from": null,
"to": null
}
]
}
422 — Validation failed (phone format, method, time_slot)
| Field | Type |
|---|---|
message* | string |
errors* | object |
json
{
"message": "",
"errors": {
"email": [
"ایمیل معتبر نیست."
]
}
}
429 — Throttle 10 req/min
| Field | Type | Description |
|---|---|---|
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 example
bash
curl -X POST 'http://127.0.0.1:8010/api/consultations' \
-H 'Accept: application/json' \
-H "Authorization: Bearer $RAWI_USER_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"name": "نسرین کاظمی",
"phone": "09123456789",
"method": "phone",
"time_slot": "morning",
"note": "میخواهم بدانم چرا نیکحساب در پرسشهای مقایسه همیشه اول است و ما نیستیم.",
"source_page": "r2"
}'