API reference · Onboarding
Save target customers
put
/onboarding/customers| Authentication | Customer token (Bearer) |
|---|---|
| Access | Free user · Pro user Customer token (Bearer) — free and paid users |
B2B: industries, 1–2 adjacent company sizes, decision makers, location, main need. B2C: location only. The server builds name (e.g. «شرکتهای خرد و کوچک در ایران»). Free 1, paid up to 2.
Request body
| Field | Type | Description |
|---|---|---|
customers* | object[] | 1–2 items |
customers[].id | integer | null | Unique ID. |
customers[].kind* | string ("b2b", "b2c") | |
customers[].industries | string[] | |
customers[].sizes | string ("micro", "small", "medium", "large")[] | |
customers[].decision_makers | string[] | |
customers[].country* | string | |
customers[].province | string | null | |
customers[].city | string | null | |
customers[].main_need | string | null |
Examplejson
{
"customers": [
{
"id": {{customerId}},
"kind": "b2b",
"industries": [
"خدمات",
"بازرگانی"
],
"sizes": [
"micro",
"small"
],
"decision_makers": [
"مدیر مالی",
"مدیرعامل"
],
"country": "ایران",
"province": null,
"city": null,
"main_need": "حسابداری ساده و قانونی"
}
]
}
Responses
200 — OnboardingState
| Field | Type | Description |
|---|---|---|
step* | integer | |
brand* | object | |
brand.name* | string | null | |
brand.domain* | string | null | Site domain. |
brand.name_variants* | any[] | «Other forms of the name»: the name itself is always matched, so it is not listed as another form. |
brand.site_read_status* | string | |
industry* | object | null | |
industry.id* | integer | Unique ID. |
industry.name* | string | |
industry.group* | string | |
industry.default_sales_model* | string | |
industry_other* | string | null | |
sales_model* | string | null | |
primary_customer* | string | null | |
products* | object[] | |
products[].id* | integer | Unique ID. |
products[].name* | string | |
products[].generic_name* | string | |
products[].type* | string | |
products[].features* | any[] | |
products[].position* | integer | |
customers* | object[] | |
customers[].id* | integer | Unique ID. |
customers[].kind* | string | |
customers[].name* | string | |
customers[].industries* | any[] | |
customers[].sizes* | any[] | |
customers[].decision_makers* | any[] | |
customers[].country* | string | |
customers[].province* | string | null | |
customers[].city* | string | null | |
customers[].main_need* | string | null | |
customers[].position* | integer | |
competitors* | object[] | |
competitors[].id* | integer | Unique ID. |
competitors[].name* | string | |
competitors[].domain* | string | null | Site domain. |
competitors[].position* | integer | |
competitors[].source* | string | |
cells* | object[] | |
cells[].id* | integer | Unique ID. |
cells[].product_id* | integer | |
cells[].target_customer_id* | integer | |
cells[].label* | string | |
cells[].active* | boolean | |
cells[].position* | integer | |
question_language* | string ("en", "fa") | |
suggestions* | object | |
suggestions.industry_id* | string | null | |
suggestions.industry* | object | null | |
suggestions.industry.id* | integer | Unique ID. |
suggestions.industry.name* | string | |
suggestions.industry.group* | string | |
suggestions.industry.default_sales_model* | string | |
suggestions.industry_alternatives* | object[] | object | |
suggestions.name_variants* | any[] | |
suggestions.products* | any[] | |
suggestions.customers* | any[] | |
suggestions.competitors* | any[] | |
limits* | any[] | Limits of the account's plan. |
json
{
"step": 0,
"brand": {
"name": "",
"domain": "",
"name_variants": [
null
],
"site_read_status": ""
},
"industry": {
"id": 0,
"name": "",
"group": "",
"default_sales_model": ""
},
"industry_other": "",
"sales_model": "",
"primary_customer": "",
"products": [
{
"id": 0,
"name": "",
"generic_name": "",
"type": "",
"features": [
null
],
"position": 0
}
],
"customers": [
{
"id": 0,
"kind": "",
"name": "",
"industries": [
null
],
"sizes": [
null
],
"decision_makers": [
null
],
"country": "",
"province": "",
"city": "",
"main_need": "",
"position": 0
}
],
"competitors": [
{
"id": 0,
"name": "",
"domain": "",
"position": 0,
"source": ""
}
],
"cells": [
{
"id": 0,
"product_id": 0,
"target_customer_id": 0,
"label": "",
"active": false,
"position": 0
}
],
"question_language": "en",
"suggestions": {
"industry_id": "",
"industry": {
"id": 0,
"name": "",
"group": "",
"default_sales_model": ""
},
"industry_alternatives": [
{
"id": 0,
"name": "",
"group": "",
"default_sales_model": ""
}
],
"name_variants": [
null
],
"products": [
null
],
"customers": [
null
],
"competitors": [
null
]
},
"limits": [
null
],
"industries_count": 0,
"question_languages": [
{
"code": "",
"name": "",
"native_name": ""
}
],
"question_set": {
"exists": false,
"edited": false,
"approved": false
}
}
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"
}
403 — plan_limit — more customers than the plan allows
| Field | Type |
|---|---|
message* | string |
code* | string ("plan_limit", "forbidden") |
json
{
"message": "این امکان در طرح راوی حرفهای است.",
"code": "plan_limit"
}
422 — Validation failed (customers.N.sizes required / not adjacent, …)
| Field | Type |
|---|---|
message* | string |
errors* | object |
json
{
"message": "",
"errors": {
"email": [
"ایمیل معتبر نیست."
]
}
}
curl example
bash
curl -X PUT 'http://127.0.0.1:8010/api/onboarding/customers' \
-H 'Accept: application/json' \
-H "Authorization: Bearer $RAWI_USER_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"customers": [
{
"id": {{customerId}},
"kind": "b2b",
"industries": [
"خدمات",
"بازرگانی"
],
"sizes": [
"micro",
"small"
],
"decision_makers": [
"مدیر مالی",
"مدیرعامل"
],
"country": "ایران",
"province": null,
"city": null,
"main_need": "حسابداری ساده و قانونی"
}
]
}'