{
    "info": {
        "name": "Rawi API (customer)",
        "_postman_id": "197ce387-75bd-46d2-aa37-371c6cab051d",
        "description": "Rawi (راوی) — customer API (public copy: admin endpoints are internal and not included).\n\nQuick start (local):\n1. 01 Auth → «Request login code» (saves devCode) → «Verify code» (saves userToken).\n   Or sign in by mobile in the «SMS» folder (userPhone; locally codes go to the log driver and come back as dev_code).\n2. Call anything else. List requests save the first id into the matching variable.\n\nHeaders on every request: Accept: application/json, Accept-Language: {{lang}}. Auth: Bearer {{userToken}}.\n\nRequests marked Destructive in their description change or delete data (for example deleting the account).",
        "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
    },
    "item": [
        {
            "name": "01 Auth & profile (user)",
            "description": "Passwordless sign-in (O1) with an **email** (code by E1) or an **Iranian mobile** (code by SMS, or a voice call as fallback; see docs/SMS.md). 6-digit code, 10 min, 5 attempts → Sanctum bearer token. Same flow for new and existing accounts (spec §9 «ایمیل تکراری»): the account is created on the first successful verify; a phone sign-up creates a phone-only account (`email: null`). The phone variants are also in the Postman folder «SMS».\n\nAccess: User token (`auth:sanctum` + `user`) — free and paid users",
            "item": [
                {
                    "name": "Sign-in options",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/auth/options",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "auth",
                                "options"
                            ]
                        },
                        "description": "Which sign-in methods O1 shows. `phone_login` = setting `sms.login_enabled` on and codes can be delivered (IPPanel configured, or the log driver outside production); `voice_fallback` = `sms.otp_voice_fallback` on and voice available.\n\nScreen: O1\nAccess: Public — no token\nResponse: 200 AuthOptions\nAlso: market, default_locale, calendar (period boundaries only), timezone (display zone).",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                },
                {
                    "name": "Request login code",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/auth/request-code",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "auth",
                                "request-code"
                            ]
                        },
                        "description": "Sends the 6-digit login code. With `email`: by email (E1). With `phone` (and no `email`): by SMS (`otp` type) or, with `channel: \"voice\"`, by a voice call. Remembers `locale` and `ref` for the verify step (30 min). Fires `signup_started` for new accounts.\n\nScreen: O1\nAccess: Public — no token\nResponse: 200 RequestCodeResponse\nErrors: 422, 429, 503",
                        "auth": {
                            "type": "noauth"
                        },
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"email\": \"{{userEmail}}\",\n  \"locale\": \"{{lang}}\",\n  \"ref\": null\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "const j = pm.response.json();",
                                    "if (j.dev_code) pm.collectionVariables.set(\"devCode\", j.dev_code);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Verify code (get user token)",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/auth/verify",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "auth",
                                "verify"
                            ]
                        },
                        "description": "Checks the code and returns a user token. Email: signs in or creates the user. Phone: signs in the user whose **verified** phone matches, or creates a phone-only user (`email: null`, `signup_method: phone`). New users start on plan `free`, `onboarding_step` 2; `ref` records the referral. Fires `signup_completed` or `login`.\n\nScreen: O1\nAccess: Public — no token\nResponse: 200 VerifyResponse\nErrors: 422, 429",
                        "auth": {
                            "type": "noauth"
                        },
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"email\": \"{{userEmail}}\",\n  \"code\": \"{{devCode}}\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "const j = pm.response.json();",
                                    "if (j.token) pm.collectionVariables.set(\"userToken\", j.token);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Log out",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/auth/logout",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "auth",
                                "logout"
                            ]
                        },
                        "description": "Revokes the current token.\n\nScreen: shell\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 204\nErrors: 401"
                    }
                },
                {
                    "name": "Log out other devices",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/auth/logout-others",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "auth",
                                "logout-others"
                            ]
                        },
                        "description": "Revokes every token of the account except the one making the request (S5 «خروج از همهٔ دستگاه‌های دیگر»). Throttle 10/min.\n\nScreen: S5\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 {signed_out}\nErrors: 401, 429"
                    }
                },
                {
                    "name": "List signed-in devices",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/auth/sessions",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "auth",
                                "sessions"
                            ]
                        },
                        "description": "The account's live sign-ins, the current one first, then by last use (S5 «Signed-in devices»). `user_agent` and `ip` are recorded at sign-in; the app shows browser and OS parsed from `user_agent`. Support sessions are not listed.\n\nScreen: S5\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 [{id, current, user_agent, ip, created_at, last_used_at}]\nErrors: 401"
                    }
                },
                {
                    "name": "Sign one device out",
                    "request": {
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/auth/sessions/:id",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "auth",
                                "sessions",
                                ":id"
                            ],
                            "variable": [
                                {
                                    "key": "id",
                                    "value": "1"
                                }
                            ]
                        },
                        "description": "Revokes one of the account's own sessions (an id from «List signed-in devices»); the current one too. Throttle 20/min.\n\nScreen: S5\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 204\nErrors: 401, 404, 429"
                    }
                },
                {
                    "name": "Get current user",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/me",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "me"
                            ]
                        },
                        "description": "Account (`email` may be null for phone-only accounts; `phone` = verified mobile in E.164 or null, `phone_verified`, `sms_notifications`), plan, limits, brand, last run, next run and free-queue position. The frontend routes users by `onboarding_step` (2..8 = next O-step, 9 = finished).\n\nScreen: shell, all /app pages\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 Me\nErrors: 401"
                    }
                },
                {
                    "name": "Update profile",
                    "request": {
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/me",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "me"
                            ]
                        },
                        "description": "Changes the panel language or the display name.\n\nScreen: language switcher\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 Me\nErrors: 401, 422",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"locale\": \"fa\",\n  \"name\": \"عرفان\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                }
            ],
            "auth": {
                "type": "bearer",
                "bearer": [
                    {
                        "key": "token",
                        "value": "{{userToken}}",
                        "type": "string"
                    }
                ]
            }
        },
        {
            "name": "02 Public",
            "description": "No authentication.\n\nAccess: Public — no token",
            "item": [
                {
                    "name": "Public plans & prices",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/public/plans",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "public",
                                "plans"
                            ]
                        },
                        "description": "Monthly price, VAT and the active billing periods with their discounts, for the landing and pricing pages.\n\nScreen: P1, P2\nAccess: Public — no token\nResponse: 200 PlansResponse",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                },
                {
                    "name": "Public site options (legal entity)",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/public/options",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "public",
                                "options"
                            ]
                        },
                        "description": "The legal entity quoted by /terms, /privacy and /refunds: company name, address, support email, governing law, reviewed flag and «Last updated» date (saved in the admin panel, else .env). Never placeholders.\n\nScreen: /terms, /privacy, /refunds\nAccess: Public — no token\nResponse: 200 PublicOptions",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                },
                {
                    "name": "Service status",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/status",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "status"
                            ]
                        },
                        "description": "Whether the service is `live`, in planned `maintenance` or `updating`, with `message`, `until` and `retry_after`. Excluded from maintenance mode: answers while every other route returns 503. Never cached.\n\nScreen: maintenance / updating pages\nAccess: Public — no token, reachable while the API is down\nResponse: 200 ServiceStatus {state, message, until, retry_after}",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                },
                {
                    "name": "OpenAPI document (public)",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/openapi.json",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "openapi.json"
                            ]
                        },
                        "description": "The public OpenAPI 3.1 document (customer and public routes; admin routes are filtered out). Built by `php artisan docs:openapi` into resources/openapi/openapi.json; 404 until it has been generated.\n\nScreen: /docs (API reference)\nAccess: Public — no token\nResponse: 200 OpenAPI JSON\nErrors: 404",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                }
            ],
            "auth": {
                "type": "noauth"
            }
        },
        {
            "name": "03 Onboarding (O2–O8)",
            "description": "Every step saves immediately and returns the full `OnboardingState`; the user can leave and resume (spec §2). Steps advance `onboarding_step` and fire `onboarding_step_completed` / `suggestion_accepted` / `suggestion_modified` events.\n\nAccess: User token (`auth:sanctum` + `user`) — free and paid users",
            "item": [
                {
                    "name": "Search industries",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/industries",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "industries"
                            ],
                            "query": [
                                {
                                    "key": "q",
                                    "value": "",
                                    "disabled": true,
                                    "description": "search text (fa or en)"
                                }
                            ]
                        },
                        "description": "Industry picker (group → industry). Empty `q` returns the most used industries first; otherwise name matches rank above group/keyword matches. Max 20.\n\nScreen: O3\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 Industry[]\nErrors: 401"
                    }
                },
                {
                    "name": "Industry groups",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/industries/groups",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "industries",
                                "groups"
                            ]
                        },
                        "description": "Localized industry group names for the B2B customer card («به چه شرکت‌هایی می‌فروشید؟»).\n\nScreen: O5\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 {name: string}[]\nErrors: 401"
                    }
                },
                {
                    "name": "Get onboarding state",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/onboarding",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "onboarding"
                            ]
                        },
                        "description": "Current answers for every step plus the site-reader suggestions and plan limits.\n\nScreen: O2–O8\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 OnboardingState\nErrors: 401"
                    }
                },
                {
                    "name": "O2 Save brand (reads the site)",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/onboarding/brand",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "onboarding",
                                "brand"
                            ]
                        },
                        "description": "Saves name/domain/name variants and reads the site (8 s timeout) to fill `suggestions` for O3–O6. `site_read_status` = `ok` | `failed` (spec §9 «سایت خوانده نشد»: the user continues with manual forms). Domains ending in `.example` use the built-in accounting fixture.\n\nScreen: O2\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 OnboardingState\nErrors: 401, 422",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"name\": \"آوند\",\n  \"domain\": \"avand.example\",\n  \"name_variants\": [\n    \"Avand\",\n    \"آوند حساب\",\n    \"اوند\"\n  ]\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "O2 Re-read site",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/onboarding/brand/reread",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "onboarding",
                                "brand",
                                "reread"
                            ]
                        },
                        "description": "Reads the saved domain again («دوباره بخوان»).\n\nScreen: O2\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 OnboardingState\nErrors: 401"
                    }
                },
                {
                    "name": "O3 Save industry & sales model",
                    "request": {
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/onboarding/industry",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "onboarding",
                                "industry"
                            ]
                        },
                        "description": "Industry from the reference taxonomy (or free text) and who the brand sells to. `both` requires the primary customer kind, which picks the buying-journey template.\n\nScreen: O3\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 OnboardingState\nErrors: 401, 422",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"industry_id\": 1,\n  \"sales_model\": \"b2b\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "O4 Save products",
                    "request": {
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/onboarding/products",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "onboarding",
                                "products"
                            ]
                        },
                        "description": "Replaces the product list (rows without `id` are created, missing ones deleted) and syncs the matrix. Free: 1 product, paid: up to 3.\n\nScreen: O4\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 OnboardingState\nErrors: 401, 403, 422",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"products\": [\n    {\n      \"id\": {{productId}},\n      \"name\": \"آوند ابری\",\n      \"generic_name\": \"نرم‌افزار حسابداری ابری\",\n      \"type\": \"software\",\n      \"features\": [\n        \"صدور فاکتور رسمی\",\n        \"اتصال به سامانه مودیان\",\n        \"دسترسی چندکاربره\"\n      ]\n    }\n  ]\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "O5 Save target customers",
                    "request": {
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/onboarding/customers",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "onboarding",
                                "customers"
                            ]
                        },
                        "description": "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.\n\nScreen: O5\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 OnboardingState\nErrors: 401, 403, 422",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"customers\": [\n    {\n      \"id\": {{customerId}},\n      \"kind\": \"b2b\",\n      \"industries\": [\n        \"خدمات\",\n        \"بازرگانی\"\n      ],\n      \"sizes\": [\n        \"micro\",\n        \"small\"\n      ],\n      \"decision_makers\": [\n        \"مدیر مالی\",\n        \"مدیرعامل\"\n      ],\n      \"country\": \"ایران\",\n      \"province\": null,\n      \"city\": null,\n      \"main_need\": \"حسابداری ساده و قانونی\"\n    }\n  ]\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "O6 Save competitors",
                    "request": {
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/onboarding/competitors",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "onboarding",
                                "competitors"
                            ]
                        },
                        "description": "Ordered list of 1–5 competitors. Order matters: competitor and comparison questions start from competitor #1.\n\nScreen: O6\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 OnboardingState\nErrors: 401, 422",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"competitors\": [\n    {\n      \"name\": \"نیک‌حساب\",\n      \"domain\": \"nikhesab.example\"\n    },\n    {\n      \"name\": \"ترازنو\",\n      \"domain\": \"taraznoo.example\"\n    },\n    {\n      \"name\": \"دفتریار\",\n      \"domain\": \"daftaryar.example\"\n    },\n    {\n      \"name\": \"رایان‌دفتر\",\n      \"domain\": \"rayandaftar.example\"\n    },\n    {\n      \"name\": \"مهرگان‌سیستم\",\n      \"domain\": \"mehregan.example\"\n    }\n  ]\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "O7 Save matrix & question language",
                    "request": {
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/onboarding/matrix",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "onboarding",
                                "matrix"
                            ]
                        },
                        "description": "Active product × customer cells and their order (paid, max 4 active) and the question language. Free accounts send only `question_language`.\n\nScreen: O7\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 OnboardingState\nErrors: 401, 403, 422",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"cells\": [\n    {\n      \"product_id\": {{productId}},\n      \"target_customer_id\": {{customerId}},\n      \"active\": true,\n      \"position\": 1\n    }\n  ],\n  \"question_language\": \"fa\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "O8 Generate question set",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/onboarding/questions",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "onboarding",
                                "questions"
                            ]
                        },
                        "description": "(Re)builds the question set from templates: per-stage counts from the plan (free 1/2/2/4/1, paid 3/4/4/10/4) split across active cells. Old questions are deactivated, never deleted. The new set waits for approval.\n\nScreen: O8\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 QuestionsResponse\nErrors: 401, 422"
                    }
                },
                {
                    "name": "O8 Approve & start first run",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/onboarding/approve",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "onboarding",
                                "approve"
                            ]
                        },
                        "description": "«تأیید و شروع»: finishes onboarding (step 9) and starts the first run — or puts a free account in the queue when the monthly free cap is full (spec §9). Also used after payment (C3 → O7/O8) and from S3 to approve a rebuilt set.\n\nScreen: O8 → O9\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 ApproveResponse\nErrors: 401, 422"
                    }
                }
            ],
            "auth": {
                "type": "bearer",
                "bearer": [
                    {
                        "key": "token",
                        "value": "{{userToken}}",
                        "type": "string"
                    }
                ]
            }
        },
        {
            "name": "04 Questions (O8, S3)",
            "description": "The active question set. Edits before the first approval are free; after approval each edit/replace counts as one change of the monthly allowance (free 2, paid 5; spec S3).\n\nAccess: User token (`auth:sanctum` + `user`) — free and paid users",
            "item": [
                {
                    "name": "List questions",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/questions",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "questions"
                            ]
                        },
                        "description": "Active questions with stage counts, the monthly change counter and the engine label.\n\nScreen: O8, S3\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 QuestionsResponse\nErrors: 401"
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "const j = pm.response.json();",
                                    "if (j.questions && j.questions.length) pm.collectionVariables.set(\"questionId\", j.questions[0].id);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Edit question text",
                    "request": {
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/questions/{{questionId}}",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "questions",
                                "{{questionId}}"
                            ]
                        },
                        "description": "Inline edit. The text is re-checked: 10–300 chars and unbranded/competitor questions may not contain the user's own brand name.\n\nScreen: O8, S3\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 Question\nErrors: 401, 403, 404, 422",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"text\": \"نشانه‌های اینکه یک شرکت کوچک به نرم‌افزار حسابداری ابری نیاز دارد چیست؟\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Replace question («پرسش دیگر»)",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/questions/{{questionId}}/replace",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "questions",
                                "{{questionId}}",
                                "replace"
                            ]
                        },
                        "description": "Swaps the question for the next unused template of the same stage/type/cell.\n\nScreen: O8, S3\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 Question\nErrors: 401, 403, 404, 422"
                    }
                }
            ],
            "auth": {
                "type": "bearer",
                "bearer": [
                    {
                        "key": "token",
                        "value": "{{userToken}}",
                        "type": "string"
                    }
                ]
            }
        },
        {
            "name": "05 Runs & reports (O9, R1–R5)",
            "description": "Shared filters on every `/reports/*` endpoint: `run_id` (0/absent = latest finished run, or the running first run), `engine` = `all|chatgpt|gemini|claude`, `cell_id` (0/absent = all cells). Every report carries a `context: ReportContext` (selected run, previous run, selectable runs, engine availability/locks, cells, effective filters, `building`, `small_sample`). Free plan: a `run_id` other than the default run, or an engine outside the plan → 403 `plan_limit`. No brand yet → 404.\n\nAccess: User token (`auth:sanctum` + `user`) — free and paid users",
            "item": [
                {
                    "name": "List runs",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/runs",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "runs"
                            ]
                        },
                        "description": "All runs of the brand, newest first.\n\nScreen: R* run picker\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 RunSummary[]\nErrors: 401, 404"
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "const j = pm.response.json();",
                                    "if (Array.isArray(j) && j.length) pm.collectionVariables.set(\"runId\", j[0].id);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Current run + progress",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/runs/current",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "runs",
                                "current"
                            ]
                        },
                        "description": "Newest run with the O9 progress block (steps, per-engine status, retry attempt, brands mentioned so far). Poll while `status` is `queued`/`running`.\n\nScreen: O9\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 RunSummary & {progress}\nErrors: 401, 404"
                    }
                },
                {
                    "name": "R1 Overview (market)",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/reports/overview",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "reports",
                                "overview"
                            ],
                            "query": [
                                {
                                    "key": "run_id",
                                    "value": "{{runId}}",
                                    "disabled": true,
                                    "description": "run to show; 0/absent = default run. Free: only the default run"
                                },
                                {
                                    "key": "engine",
                                    "value": "all",
                                    "disabled": true,
                                    "description": "`all` (default) | `chatgpt` | `gemini` | `claude` (must be in the plan)"
                                },
                                {
                                    "key": "cell_id",
                                    "value": "0",
                                    "disabled": true,
                                    "description": "matrix cell; 0/absent = all cells"
                                }
                            ]
                        },
                        "description": "Share of voice table (brand + competitors, per engine, delta vs previous run), own rank/visibility/sources, leader, discovered brands, stage coverage. `state`: `building` (first run in progress, partial numbers «در حال کامل شدن»), `queued` (free queue), `ready`, `empty_market` (nobody named — `cited_sources_when_empty` filled), `no_brand` (own SoV 0 → suggest R2), `failed`. Fires `first_report_viewed` once.\n\nScreen: R1 (+ O9 building state)\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 OverviewReport\nErrors: 401, 403, 404, 422"
                    }
                },
                {
                    "name": "R2 Gaps",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/reports/gaps",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "reports",
                                "gaps"
                            ],
                            "query": [
                                {
                                    "key": "run_id",
                                    "value": "{{runId}}",
                                    "disabled": true,
                                    "description": "run to show; 0/absent = default run. Free: only the default run"
                                },
                                {
                                    "key": "engine",
                                    "value": "all",
                                    "disabled": true,
                                    "description": "`all` (default) | `chatgpt` | `gemini` | `claude` (must be in the plan)"
                                },
                                {
                                    "key": "cell_id",
                                    "value": "0",
                                    "disabled": true,
                                    "description": "matrix cell; 0/absent = all cells"
                                }
                            ]
                        },
                        "description": "Unbranded `selection` questions where ≥1 competitor is named and the brand is not (`gaps`), where the brand is named (`present`), and where nobody from the list is named (`neither`), with per-engine status and the competitor with most gaps.\n\nScreen: R2\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 GapsReport\nErrors: 401, 403, 404"
                    }
                },
                {
                    "name": "R2 AI suggestion for a gap",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/reports/gaps/{{questionId}}/suggestion?run_id={{runId}}&engine=chatgpt",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "reports",
                                "gaps",
                                "{{questionId}}",
                                "suggestion"
                            ],
                            "query": [
                                {
                                    "key": "run_id",
                                    "value": "{{runId}}"
                                },
                                {
                                    "key": "engine",
                                    "value": "chatgpt"
                                }
                            ]
                        },
                        "description": "«پیشنهاد هوش مصنوعی» for one gap (question × engine × run): summary, 3–5 steps and the cited sources to get into, in the panel language (Accept-Language). Built from the gap answer, the brands named, the cited sources with their types and the brand/product/customer context, through the `advisor` task route (mock connection: deterministic). No body.\n\nCached per (brand, run, question, engine, locale): 201 when made, 200 with `cached: true` on repeat (not counted). Limit: free 3, paid 30 new suggestions per calendar month (failed ones do not count). One Idempotency-Key per request is sent to Jarvis. Model output is untrusted: render as text only.\n\nScreen: R2\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 201/200 AiSuggestionResponse\nErrors: 401, 403 `plan_limit` {remaining, used, limit} (or older run / locked engine), 404 `not_a_gap`, 409 `in_progress`, 502 `ai_unavailable`, 429 (20/min)"
                    },
                    "response": [
                        {
                            "name": "201 created (mock)",
                            "originalRequest": {
                                "method": "POST",
                                "header": [
                                    {
                                        "key": "Accept",
                                        "value": "application/json"
                                    },
                                    {
                                        "key": "Accept-Language",
                                        "value": "{{lang}}"
                                    }
                                ],
                                "url": {
                                    "raw": "{{baseUrl}}/reports/gaps/{{questionId}}/suggestion?run_id={{runId}}&engine=chatgpt",
                                    "host": [
                                        "{{baseUrl}}"
                                    ],
                                    "path": [
                                        "reports",
                                        "gaps",
                                        "{{questionId}}",
                                        "suggestion"
                                    ],
                                    "query": [
                                        {
                                            "key": "run_id",
                                            "value": "{{runId}}"
                                        },
                                        {
                                            "key": "engine",
                                            "value": "chatgpt"
                                        }
                                    ]
                                },
                                "description": "«پیشنهاد هوش مصنوعی» for one gap (question × engine × run): summary, 3–5 steps and the cited sources to get into, in the panel language (Accept-Language). Built from the gap answer, the brands named, the cited sources with their types and the brand/product/customer context, through the `advisor` task route (mock connection: deterministic). No body.\n\nCached per (brand, run, question, engine, locale): 201 when made, 200 with `cached: true` on repeat (not counted). Limit: free 3, paid 30 new suggestions per calendar month (failed ones do not count). One Idempotency-Key per request is sent to Jarvis. Model output is untrusted: render as text only.\n\nScreen: R2\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 201/200 AiSuggestionResponse\nErrors: 401, 403 `plan_limit` {remaining, used, limit} (or older run / locked engine), 404 `not_a_gap`, 409 `in_progress`, 502 `ai_unavailable`, 429 (20/min)"
                            },
                            "status": "Created",
                            "code": 201,
                            "_postman_previewlanguage": "json",
                            "header": [
                                {
                                    "key": "Content-Type",
                                    "value": "application/json"
                                }
                            ],
                            "body": "{\n    \"suggestion\": {\n        \"id\": 1,\n        \"question_id\": 350,\n        \"run_id\": 38,\n        \"engine\": \"chatgpt\",\n        \"locale\": \"fa\",\n        \"summary\": \"ChatGPT در پاسخ به این پرسش از نیک‌حساب، ترازنو و دفتریار نام برد و از آوند نه. …\",\n        \"steps\": [\n            {\n                \"title\": \"در hesab-review.example دیده شوید\",\n                \"detail\": \"ChatGPT برای این پرسش از hesab-review.example (سایت نقد و مقایسه) نقل کرد. …\",\n                \"source_domain\": \"hesab-review.example\"\n            },\n            {\n                \"title\": \"صفحه‌ای که مستقیم به این پرسش جواب بدهد\",\n                \"detail\": \"در avand.example صفحه‌ای با عنوانی نزدیک به «…» بسازید …\",\n                \"source_domain\": \"avand.example\"\n            },\n            {\n                \"title\": \"نظر مشتریان را در سایت‌های نقد جمع کنید\",\n                \"detail\": \"از مشتریان راضی بخواهید …\",\n                \"source_domain\": null\n            }\n        ],\n        \"sources_to_target\": [\n            \"hesab-review.example\",\n            \"fanavari-news.example\"\n        ],\n        \"generated_by\": \"mock\",\n        \"created_at\": \"2026-11-25T11:16:30+00:00\"\n    },\n    \"cached\": false,\n    \"usage\": {\n        \"used\": 1,\n        \"limit\": 3,\n        \"remaining\": 2\n    }\n}"
                        },
                        {
                            "name": "403 plan_limit",
                            "originalRequest": {
                                "method": "POST",
                                "header": [
                                    {
                                        "key": "Accept",
                                        "value": "application/json"
                                    },
                                    {
                                        "key": "Accept-Language",
                                        "value": "{{lang}}"
                                    }
                                ],
                                "url": {
                                    "raw": "{{baseUrl}}/reports/gaps/{{questionId}}/suggestion?run_id={{runId}}&engine=chatgpt",
                                    "host": [
                                        "{{baseUrl}}"
                                    ],
                                    "path": [
                                        "reports",
                                        "gaps",
                                        "{{questionId}}",
                                        "suggestion"
                                    ],
                                    "query": [
                                        {
                                            "key": "run_id",
                                            "value": "{{runId}}"
                                        },
                                        {
                                            "key": "engine",
                                            "value": "chatgpt"
                                        }
                                    ]
                                },
                                "description": "«پیشنهاد هوش مصنوعی» for one gap (question × engine × run): summary, 3–5 steps and the cited sources to get into, in the panel language (Accept-Language). Built from the gap answer, the brands named, the cited sources with their types and the brand/product/customer context, through the `advisor` task route (mock connection: deterministic). No body.\n\nCached per (brand, run, question, engine, locale): 201 when made, 200 with `cached: true` on repeat (not counted). Limit: free 3, paid 30 new suggestions per calendar month (failed ones do not count). One Idempotency-Key per request is sent to Jarvis. Model output is untrusted: render as text only.\n\nScreen: R2\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 201/200 AiSuggestionResponse\nErrors: 401, 403 `plan_limit` {remaining, used, limit} (or older run / locked engine), 404 `not_a_gap`, 409 `in_progress`, 502 `ai_unavailable`, 429 (20/min)"
                            },
                            "status": "Forbidden",
                            "code": 403,
                            "_postman_previewlanguage": "json",
                            "header": [
                                {
                                    "key": "Content-Type",
                                    "value": "application/json"
                                }
                            ],
                            "body": "{\n    \"message\": \"سهم پیشنهاد هوش مصنوعی این ماه تمام شده است (3 از 3). در طرح پولی هر ماه 30 پیشنهاد دارید.\",\n    \"code\": \"plan_limit\",\n    \"remaining\": 0,\n    \"used\": 3,\n    \"limit\": 3\n}"
                        }
                    ]
                },
                {
                    "name": "R3 Citations",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/reports/citations",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "reports",
                                "citations"
                            ],
                            "query": [
                                {
                                    "key": "run_id",
                                    "value": "{{runId}}",
                                    "disabled": true,
                                    "description": "run to show; 0/absent = default run. Free: only the default run"
                                },
                                {
                                    "key": "engine",
                                    "value": "all",
                                    "disabled": true,
                                    "description": "`all` (default) | `chatgpt` | `gemini` | `claude` (must be in the plan)"
                                },
                                {
                                    "key": "cell_id",
                                    "value": "0",
                                    "disabled": true,
                                    "description": "matrix cell; 0/absent = all cells"
                                }
                            ]
                        },
                        "description": "Cited domains classified into 7 source types (own, competitor, media, review, forum, reference, other) and citation opportunities (a source whose answer names a competitor but not the brand). Free: counts by type + 3 sample sources without page URLs (`locked: true`). Paid: every source with page URLs.\n\nScreen: R3\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 CitationsReport\nErrors: 401, 403, 404"
                    }
                },
                {
                    "name": "R4 Questions & answers (list)",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/reports/questions",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "reports",
                                "questions"
                            ],
                            "query": [
                                {
                                    "key": "run_id",
                                    "value": "{{runId}}",
                                    "disabled": true,
                                    "description": "run to show; 0/absent = default run. Free: only the default run"
                                },
                                {
                                    "key": "engine",
                                    "value": "all",
                                    "disabled": true,
                                    "description": "`all` (default) | `chatgpt` | `gemini` | `claude` (must be in the plan)"
                                },
                                {
                                    "key": "cell_id",
                                    "value": "0",
                                    "disabled": true,
                                    "description": "matrix cell; 0/absent = all cells"
                                }
                            ]
                        },
                        "description": "Questions grouped by stage plus the separate groups `alternative` (competitor/comparison: «حضور به‌عنوان جایگزین») and `branded` («وقتی نام شما را می‌پرسند»), each with whether the brand was named per engine.\n\nScreen: R4\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 QuestionsReport\nErrors: 401, 403, 404"
                    }
                },
                {
                    "name": "R4 Question detail",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/reports/questions/{{questionId}}",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "reports",
                                "questions",
                                "{{questionId}}"
                            ],
                            "query": [
                                {
                                    "key": "run_id",
                                    "value": "{{runId}}",
                                    "disabled": true,
                                    "description": "run to show; 0/absent = default run. Free: only the default run"
                                },
                                {
                                    "key": "engine",
                                    "value": "all",
                                    "disabled": true,
                                    "description": "`all` (default) | `chatgpt` | `gemini` | `claude` (must be in the plan)"
                                },
                                {
                                    "key": "cell_id",
                                    "value": "0",
                                    "disabled": true,
                                    "description": "matrix cell; 0/absent = all cells"
                                }
                            ]
                        },
                        "description": "Full answer text of each engine, named brands and cited sources, with prev/next navigation. Free: answers of the selected (latest) run only; paid: every run.\n\nScreen: R4 detail\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 QuestionDetail\nErrors: 401, 403, 404"
                    }
                },
                {
                    "name": "R5 Trend",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/reports/trend",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "reports",
                                "trend"
                            ],
                            "query": [
                                {
                                    "key": "run_id",
                                    "value": "{{runId}}",
                                    "disabled": true,
                                    "description": "run to show; 0/absent = default run. Free: only the default run"
                                },
                                {
                                    "key": "engine",
                                    "value": "all",
                                    "disabled": true,
                                    "description": "`all` (default) | `chatgpt` | `gemini` | `claude` (must be in the plan)"
                                },
                                {
                                    "key": "cell_id",
                                    "value": "0",
                                    "disabled": true,
                                    "description": "matrix cell; 0/absent = all cells"
                                },
                                {
                                    "key": "metric",
                                    "value": "",
                                    "disabled": true,
                                    "description": "sov (default) | visibility"
                                }
                            ]
                        },
                        "description": "SoV or visibility per run for the brand and the top 3 competitors, question-set change markers, first-run baseline, from→to summary and per-engine change. Before the second run the UI shows «بعد از اجرای بعدی، روند اینجا دیده می‌شود» with `next_run_at`.\n\nScreen: R5\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 TrendReport\nErrors: 401, 403, 404, 422"
                    }
                },
                {
                    "name": "R1 Share card",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/reports/share-card",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "reports",
                                "share-card"
                            ],
                            "query": [
                                {
                                    "key": "run_id",
                                    "value": "{{runId}}",
                                    "disabled": true,
                                    "description": "run to show; 0/absent = default run. Free: only the default run"
                                },
                                {
                                    "key": "engine",
                                    "value": "all",
                                    "disabled": true,
                                    "description": "`all` (default) | `chatgpt` | `gemini` | `claude` (must be in the plan)"
                                },
                                {
                                    "key": "cell_id",
                                    "value": "0",
                                    "disabled": true,
                                    "description": "matrix cell; 0/absent = all cells"
                                },
                                {
                                    "key": "masked",
                                    "value": "",
                                    "disabled": true,
                                    "description": "1 (default) or 0/false for real names"
                                }
                            ]
                        },
                        "description": "Data for the shareable SoV card. Competitor names are masked as «رقیب ۱…» unless `masked=0`. Fires `share_card_created`.\n\nScreen: R1 «ساخت کارت قابل اشتراک»\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 ShareCard\nErrors: 401, 403, 404"
                    }
                },
                {
                    "name": "R1 Add discovered brand to competitors",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/competitors/discovered",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "competitors",
                                "discovered"
                            ]
                        },
                        "description": "Turns a discovered brand into a tracked competitor (source `discovered`); its past mentions are re-labelled as competitor mentions.\n\nScreen: R1 «افزودن به رقبا»\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 201 Competitor\nErrors: 401, 404, 422",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"name\": \"حساب‌یار\",\n  \"domain\": \"hesabyar.example\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                }
            ],
            "auth": {
                "type": "bearer",
                "bearer": [
                    {
                        "key": "token",
                        "value": "{{userToken}}",
                        "type": "string"
                    }
                ]
            }
        },
        {
            "name": "06 Consultation (C1)",
            "description": "The consultation button is on every report page. A request goes to admin A2 and triggers E7.\n\nAccess: User token (`auth:sanctum` + `user`) — free and paid users",
            "item": [
                {
                    "name": "Prefill consultation form",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/consultations/prefill?source_page=r2",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "consultations",
                                "prefill"
                            ],
                            "query": [
                                {
                                    "key": "source_page",
                                    "value": "r2",
                                    "disabled": false,
                                    "description": "r1 r2 r3 r4 r5 o2 settings other"
                                }
                            ]
                        },
                        "description": "Name, last used phone and the account snapshot that is attached automatically. Fires `consultation_form_opened`.\n\nScreen: C1\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 {name, phone, snapshot: ConsultationSnapshot}\nErrors: 401\nAlso: working_days (ISO weekdays, 1 = Monday) and timezone for the form helper line."
                    }
                },
                {
                    "name": "Submit consultation request",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/consultations",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "consultations"
                            ]
                        },
                        "description": "Creates the request (status `new`), snapshots the account, sends E7 and fires `consultation_submitted`.\n\nScreen: C1\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 201 ConsultationRequest\nErrors: 401, 422, 429",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"name\": \"نسرین کاظمی\",\n  \"phone\": \"09123456789\",\n  \"method\": \"phone\",\n  \"time_slot\": \"morning\",\n  \"note\": \"می‌خواهم بدانم چرا نیک‌حساب در پرسش‌های مقایسه همیشه اول است و ما نیستیم.\",\n  \"source_page\": \"r2\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "const j = pm.response.json();",
                                    "if (j.id) pm.collectionVariables.set(\"consultationId\", j.id);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "List own consultation requests",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/consultations",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "consultations"
                            ]
                        },
                        "description": "The caller's own requests, newest first (up to 50), with `status` and `due_at`. View only; a request can still be changed with PATCH while it is `new`.\n\nScreen: C1 «درخواست‌های من»\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 ConsultationRequest[]\nErrors: 401"
                    }
                },
                {
                    "name": "Get own consultation request",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/consultations/{{consultationId}}",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "consultations",
                                "{{consultationId}}"
                            ]
                        },
                        "description": "One of the caller's own requests.\n\nScreen: C1 confirmation\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 ConsultationRequest\nErrors: 401, 404"
                    }
                },
                {
                    "name": "Edit consultation request",
                    "request": {
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/consultations/{{consultationId}}",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "consultations",
                                "{{consultationId}}"
                            ]
                        },
                        "description": "Same body as create. Only while the request is still `new`.\n\nScreen: C1 «ویرایش درخواست»\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 ConsultationRequest\nErrors: 401, 403, 404, 422",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"name\": \"نسرین کاظمی\",\n  \"phone\": \"09123456789\",\n  \"method\": \"meet\",\n  \"time_slot\": \"evening\",\n  \"note\": \"ترجیح می‌دهم جلسه آنلاین باشد.\",\n  \"source_page\": \"r2\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                }
            ],
            "auth": {
                "type": "bearer",
                "bearer": [
                    {
                        "key": "token",
                        "value": "{{userToken}}",
                        "type": "string"
                    }
                ]
            }
        },
        {
            "name": "07 Billing & payment gateway (C2, C3)",
            "description": "Prices are integers in the gateway currency (Toman for IRT). Order of discounts: period discount → discount code (or the referral first-payment discount) → never below the monthly floor × months → VAT. Successful payment: plan `paid`, E6, referral purchase recorded, user returns to O7 to pick cells and build the extra questions.\n\nAccess: User token (`auth:sanctum` + `user`) — free and paid users",
            "item": [
                {
                    "name": "Plans & periods",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/billing/plans",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "billing",
                                "plans"
                            ]
                        },
                        "description": "Same data as `/public/plans` for signed-in users.\n\nScreen: C2\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 PlansResponse\nErrors: 401"
                    }
                },
                {
                    "name": "Quote (period + code)",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/billing/quote",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "billing",
                                "quote"
                            ]
                        },
                        "description": "Price breakdown for a period and optional discount code. An invalid code is not an error: `code_valid:false` + `code_message`.\n\nScreen: C2, C3\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 Quote\nErrors: 401, 422, 429",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"period\": \"quarterly\",\n  \"code\": \"FOUNDERS30\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Enabled gateways",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/billing/gateways",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "billing",
                                "gateways"
                            ]
                        },
                        "description": "Gateways switched on in admin A3.\n\nScreen: C3\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 Gateway[]\nErrors: 401"
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "const j = pm.response.json();",
                                    "if (Array.isArray(j) && j.length) pm.collectionVariables.set(\"gatewayId\", j[0].id);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Checkout (start payment)",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/billing/checkout",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "billing",
                                "checkout"
                            ]
                        },
                        "description": "Creates a `pending` payment from the quote and returns the gateway URL. With the mock gateway the URL is a signed page on the API host (`/pay/mock/{payment}`) whose buttons hit `/pay/callback/{payment}` and redirect to `{FRONTEND_URL}/app/checkout/result?payment={id}`. Fires `checkout_started`.\n\nScreen: C3\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 201 {payment_id, redirect_url}\nErrors: 401, 422, 429",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"period\": \"quarterly\",\n  \"code\": \"FOUNDERS30\",\n  \"gateway_id\": {{gatewayId}}\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "const j = pm.response.json();",
                                    "if (j.payment_id) pm.collectionVariables.set(\"paymentId\", j.payment_id);",
                                    "if (j.redirect_url) pm.collectionVariables.set(\"redirectUrl\", j.redirect_url);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "List own payments",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/billing/payments",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "billing",
                                "payments"
                            ]
                        },
                        "description": "All payments of the caller (any status), newest first.\n\nScreen: C3, S5\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 Payment[]\nErrors: 401"
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "const j = pm.response.json();",
                                    "if (Array.isArray(j) && j.length) pm.collectionVariables.set(\"paymentId\", j[0].id);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Get payment (result page)",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/billing/payments/{{paymentId}}",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "billing",
                                "payments",
                                "{{paymentId}}"
                            ]
                        },
                        "description": "Status of one own payment for `/app/checkout/result?payment=` (success → receipt; failed → «پرداخت ناموفق», retry, account stays free). In Postman run «Checkout» or «List own payments» first so `{{paymentId}}` is set (the demo account has no payments; an empty id would hit the list route).\n\nScreen: C3 result\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 Payment\nErrors: 401, 404"
                    }
                },
                {
                    "name": "Notify me when online payment is available",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/billing/notify-me",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "billing",
                                "notify-me"
                            ]
                        },
                        "description": "Records interest (`payment_notify_requested`) when no gateway is enabled. When an online gateway the user can pay with is enabled, the user gets E9 once (SMS for phone-only accounts).\n\nScreen: C2\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 204\nErrors: 401"
                    }
                },
                {
                    "name": "Cancel automatic renewal",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/billing/subscription/cancel",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "billing",
                                "subscription",
                                "cancel"
                            ]
                        },
                        "description": "Sets `cancel_at_period_end` on the Stripe subscription: nothing more is charged and the paid period runs to its end (`renewal.ends_at`). Throttle 10/min.\n\nScreen: S5\nAccess: User token (`auth:sanctum` + `user`) — free and paid users with a Stripe subscription\nResponse: 200 AccountSettings (`renewal.status: cancel_at_period_end`)\nErrors: 401, 409 no_subscription, 422 gateway_error, 429"
                    }
                },
                {
                    "name": "Resume automatic renewal",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/billing/subscription/resume",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "billing",
                                "subscription",
                                "resume"
                            ]
                        },
                        "description": "Undoes a cancel before the period ends (`cancel_at_period_end=false`). Throttle 10/min.\n\nScreen: S5\nAccess: User token (`auth:sanctum` + `user`) — free and paid users with a cancelled-at-period-end subscription\nResponse: 200 AccountSettings (`renewal.status: active`)\nErrors: 401, 409 no_subscription, 422 gateway_error, 429"
                    }
                },
                {
                    "name": "Open mock bank page (web route, from checkout)",
                    "request": {
                        "method": "GET",
                        "auth": {
                            "type": "noauth"
                        },
                        "header": [
                            {
                                "key": "Accept",
                                "value": "text/html"
                            }
                        ],
                        "url": {
                            "raw": "{{redirectUrl}}"
                        },
                        "description": "Web route GET /pay/mock/{payment} (signed). Opens the HTML mock bank page returned as redirect_url by «Checkout». Not an /api route; run «Checkout» first. Its buttons call /pay/callback/{payment} and redirect to the frontend result page."
                    }
                },
                {
                    "name": "Stripe webhook (public, signed by Stripe)",
                    "request": {
                        "method": "POST",
                        "auth": {
                            "type": "noauth"
                        },
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            },
                            {
                                "key": "Stripe-Signature",
                                "value": "t={{stripeTimestamp}},v1={{stripeSignature}}"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"id\": \"evt_test_1\",\n    \"type\": \"checkout.session.completed\",\n    \"data\": {\n        \"object\": {\n            \"id\": \"cs_test_a1\",\n            \"payment_status\": \"paid\",\n            \"amount_total\": 16200,\n            \"currency\": \"usd\",\n            \"client_reference_id\": \"{{paymentId}}\",\n            \"metadata\": {\n                \"payment_id\": \"{{paymentId}}\"\n            },\n            \"payment_intent\": \"pi_test_1\"\n        }\n    }\n}"
                        },
                        "url": {
                            "raw": "{{baseUrl}}/billing/webhooks/stripe",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "billing",
                                "webhooks",
                                "stripe"
                            ]
                        },
                        "description": "Called by Stripe, not by the app. Public (no token, no CSRF), throttle 120/min.\n\nThe raw body must match the Stripe-Signature header: v1 = HMAC-SHA256(\"{t}.{body}\", webhook signing secret), t within 5 minutes. Handles checkout.session.completed / async_payment_succeeded (completes the payment, idempotent) and checkout.session.expired / async_payment_failed (marks a pending payment failed); other events are acknowledged.\n\nTo try it locally use the Stripe CLI (`stripe listen --forward-to {{baseUrl}}/billing/webhooks/stripe`); a hand-made request needs a signature computed with the gateway's whsec_ secret.\nResponse: 200 {\"received\": true}\nErrors: 400 invalid_signature, 429"
                    }
                }
            ],
            "auth": {
                "type": "bearer",
                "bearer": [
                    {
                        "key": "token",
                        "value": "{{userToken}}",
                        "type": "string"
                    }
                ]
            }
        },
        {
            "name": "08 Settings (S1, S2, S4, S5)",
            "description": "S5 also manages the mobile number, the email of phone-only accounts and SMS notifications (`/settings/phone/*`, `/settings/email/*`, `/settings/notifications`; see docs/SMS.md). S3 (questions) uses the `/questions` endpoints; S6 uses `/referrals`. Changes that rebuild the question set answer **409 `ConfirmRequired`** first; resend the same body with `\"confirm\": true`.\n\nAccess: User token (`auth:sanctum` + `user`) — free and paid users",
            "item": [
                {
                    "name": "S1 Get brand & competitors",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/settings/brand",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "settings",
                                "brand"
                            ]
                        },
                        "description": "Brand name/domain, name variants, extra domains and the ordered competitor list.\n\nScreen: S1\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 {name, domain, name_variants[], extra_domains[], competitors: Competitor[]}\nErrors: 401"
                    }
                },
                {
                    "name": "S1 Update brand & competitors",
                    "request": {
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/settings/brand",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "settings",
                                "brand"
                            ]
                        },
                        "description": "Saves name variants, extra domains and competitors (order = importance). A competitor change rebuilds only competitor/comparison questions.\n\nScreen: S1\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 same as GET\nErrors: 401, 422",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"name_variants\": [\n    \"Avand\",\n    \"آوند حساب\",\n    \"اوند\"\n  ],\n  \"extra_domains\": [\n    \"blog.avand.example\"\n  ],\n  \"competitors\": [\n    {\n      \"id\": 163,\n      \"name\": \"نیک‌حساب\",\n      \"domain\": \"nikhesab.example\"\n    },\n    {\n      \"id\": 164,\n      \"name\": \"ترازنو\",\n      \"domain\": \"taraznoo.example\"\n    },\n    {\n      \"id\": 165,\n      \"name\": \"دفتریار\",\n      \"domain\": \"daftaryar.example\"\n    },\n    {\n      \"id\": 166,\n      \"name\": \"رایان‌دفتر\",\n      \"domain\": \"rayandaftar.example\"\n    },\n    {\n      \"id\": 167,\n      \"name\": \"مهرگان‌سیستم\",\n      \"domain\": \"mehregan.example\"\n    }\n  ]\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "S2 Get products, customers & cells",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/settings/products",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "settings",
                                "products"
                            ]
                        },
                        "description": "Products, target customers, matrix cells, plan limits and the number of questions per cell.\n\nScreen: S2\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 {products, customers, cells, limits, question_counts}\nErrors: 401"
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "const j = pm.response.json();",
                                    "if (j.products && j.products.length) pm.collectionVariables.set(\"productId\", j.products[0].id);",
                                    "if (j.customers && j.customers.length) pm.collectionVariables.set(\"customerId\", j.customers[0].id);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "S2 Update products, customers & cells",
                    "request": {
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/settings/products",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "settings",
                                "products"
                            ]
                        },
                        "description": "Saves everything at once. Changing a generic name, product type, customer core fields or active cells rebuilds the questions and breaks the trend → 409 unless `confirm: true`.\n\nScreen: S2\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 same as GET\nErrors: 401, 409, 422",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"products\": [\n    {\n      \"id\": {{productId}},\n      \"name\": \"آوند ابری\",\n      \"generic_name\": \"نرم‌افزار حسابداری ابری\",\n      \"type\": \"software\",\n      \"features\": [\n        \"صدور فاکتور رسمی\",\n        \"اتصال به سامانه مودیان\",\n        \"دسترسی چندکاربره\"\n      ]\n    }\n  ],\n  \"customers\": [\n    {\n      \"id\": {{customerId}},\n      \"kind\": \"b2b\",\n      \"industries\": [\n        \"خدمات\",\n        \"بازرگانی\"\n      ],\n      \"sizes\": [\n        \"micro\",\n        \"small\"\n      ],\n      \"decision_makers\": [\n        \"مدیر مالی\",\n        \"مدیرعامل\"\n      ],\n      \"country\": \"ایران\",\n      \"province\": null,\n      \"city\": null,\n      \"main_need\": \"حسابداری ساده و قانونی\"\n    }\n  ],\n  \"cells\": [\n    {\n      \"product_id\": {{productId}},\n      \"target_customer_id\": {{customerId}},\n      \"active\": true,\n      \"position\": 1\n    }\n  ],\n  \"confirm\": false\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "S4 Get run & language settings",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/settings/run",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "settings",
                                "run"
                            ]
                        },
                        "description": "Run frequency, panel language, question language, next run and the frequencies the plan allows.\n\nScreen: S4\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 RunSettings\nErrors: 401"
                    }
                },
                {
                    "name": "S4 Update run & language settings",
                    "request": {
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/settings/run",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "settings",
                                "run"
                            ]
                        },
                        "description": "Weekly runs are paid-only. Changing the question language rebuilds the whole set → 409 unless `confirm: true`.\n\nScreen: S4\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 RunSettings\nErrors: 401, 403, 409, 422",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"run_frequency\": \"monthly\",\n  \"panel_locale\": \"fa\",\n  \"question_language\": \"fa\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "S5 Get account & receipts",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/settings/account",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "settings",
                                "account"
                            ]
                        },
                        "description": "Email (null for phone-only accounts), verified phone, SMS-notification switch, plan, period, renewal date and receipts (successful/refunded payments).\n\nScreen: S5\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 AccountSettings\nErrors: 401"
                    }
                },
                {
                    "name": "S5 Confirm it's you: request code",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/settings/reauth/request-code",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "settings",
                                "reauth",
                                "request-code"
                            ]
                        },
                        "description": "Sends a 6-digit code to the account's CURRENT email (or its verified phone when it has no email). Needed before «Verify email», «Verify phone», «Remove phone» and «Delete account» (they all require `reauth_token`). Locally the answer carries `dev_code` (saved to `{{devCode}}`). Throttle 5/min; settings codes are capped per account per day.\n\nScreen: S5\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 {sent, channel, to, expires_in, resend_in, dev_code?}\nErrors: 401, 429"
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "const j = pm.response.json();",
                                    "if (j.dev_code) pm.collectionVariables.set(\"devCode\", j.dev_code);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "S5 Confirm it's you: verify code (get reauth_token)",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/settings/reauth/verify",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "settings",
                                "reauth",
                                "verify"
                            ]
                        },
                        "description": "Checks the code and returns `reauth_token` (valid 10 minutes, used up by the first protected change); saved to `{{reauthToken}}`.\n\nScreen: S5\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 {reauth_token, expires_in}\nErrors: 401, 422, 429",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"code\": \"{{devCode}}\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "const j = pm.response.json();",
                                    "if (j.reauth_token) pm.collectionVariables.set(\"reauthToken\", j.reauth_token);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "S5 Delete account",
                    "request": {
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/settings/account",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "settings",
                                "account"
                            ]
                        },
                        "description": "**Destructive.** Soft-deletes the account after re-typing the email, the brand name or — for phone-only accounts — the mobile number; all tokens are revoked, history is kept and the email and phone are freed for a new sign-up. Needs `reauth_token` from «S5 Confirm it's you» (SEC-12).\n\nScreen: S5\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 204\nErrors: 401, 422",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"confirm_email\": \"{{userEmail}}\",\n  \"reauth_token\": \"{{reauthToken}}\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "S5 Download my data",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/settings/export",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "settings",
                                "export"
                            ]
                        },
                        "description": "The account's data as one JSON download (account, brand with products, target customers, competitors and questions, a per-scan and per-question answer summary, payments, consultation requests). Needs `reauth_token` from «S5 Confirm it's you» (SEC-12; used up). Throttle 5 per hour.\n\nScreen: S5\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 (Content-Disposition: attachment)\nErrors: 401, 422 reauth_required, 429",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"reauth_token\": \"{{reauthToken}}\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "S5 Request phone verification code",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/settings/phone/request-code",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "settings",
                                "phone",
                                "request-code"
                            ]
                        },
                        "description": "Sends an SMS code (code guard `verify`) to add or change the account mobile.\n\nScreen: S5 «شماره موبایل»\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 VerifyCodeResponse\nErrors: 401, 422, 429, 503",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"phone\": \"{{userPhone}}\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "const j = pm.response.json();",
                                    "if (j.dev_code) pm.collectionVariables.set(\"devCode\", j.dev_code);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "S5 Verify phone",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/settings/phone/verify",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "settings",
                                "phone",
                                "verify"
                            ]
                        },
                        "description": "Checks the code and saves the phone as verified (fires `phone_verified`). A verified phone receives SMS notifications and can be used to sign in. Needs `reauth_token` from «S5 Confirm it's you» (SEC-12).\n\nScreen: S5\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 AccountSettings\nErrors: 401, 422, 429",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"phone\": \"{{userPhone}}\",\n  \"code\": \"{{devCode}}\",\n  \"reauth_token\": \"{{reauthToken}}\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "S5 Remove phone",
                    "request": {
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/settings/phone",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "settings",
                                "phone"
                            ]
                        },
                        "description": "**Destructive.** Removes the mobile. Not allowed for a phone-only account (it would have no way to sign in). Needs `reauth_token` from «S5 Confirm it's you» (SEC-12).\n\nScreen: S5\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 AccountSettings\nErrors: 401, 422",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"reauth_token\": \"{{reauthToken}}\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "S5 SMS notifications on/off",
                    "request": {
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/settings/notifications",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "settings",
                                "notifications"
                            ]
                        },
                        "description": "Turns SMS notifications (sent next to E3–E8) on or off. Only a verified phone receives them.\n\nScreen: S5 «اطلاع‌رسانی با پیامک»\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 AccountSettings\nErrors: 401, 422",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"sms_notifications\": true\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "S5 Request email verification code",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/settings/email/request-code",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "settings",
                                "email",
                                "request-code"
                            ]
                        },
                        "description": "Phone-only accounts add an email: sends a code to the new address.\n\nScreen: S5 «ایمیل»\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 VerifyCodeResponse\nErrors: 401, 422, 429",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"email\": \"erfan@avand.example\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "const j = pm.response.json();",
                                    "if (j.dev_code) pm.collectionVariables.set(\"devCode\", j.dev_code);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "S5 Verify email",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/settings/email/verify",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "settings",
                                "email",
                                "verify"
                            ]
                        },
                        "description": "Checks the code and saves the email on the account (fires `email_added`). Needs `reauth_token` from «S5 Confirm it's you» (SEC-12).\n\nScreen: S5\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 AccountSettings\nErrors: 401, 422, 429",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"email\": \"erfan@avand.example\",\n  \"code\": \"{{devCode}}\",\n  \"reauth_token\": \"{{reauthToken}}\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                }
            ],
            "auth": {
                "type": "bearer",
                "bearer": [
                    {
                        "key": "token",
                        "value": "{{userToken}}",
                        "type": "string"
                    }
                ]
            }
        },
        {
            "name": "09 Referrals (S6)",
            "description": "Referrals (S6)\n\nAccess: User token (`auth:sanctum` + `user`) — free and paid users",
            "item": [
                {
                    "name": "Referral summary",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/referrals",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "referrals"
                            ]
                        },
                        "description": "Personal invite link, signups and purchases, free months earned/pending. A reward (+1 free month, E8) is granted `reward_delay_days` (14) after the referred user pays.\n\nScreen: S6\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 200 ReferralSummary\nErrors: 401"
                    }
                }
            ],
            "auth": {
                "type": "bearer",
                "bearer": [
                    {
                        "key": "token",
                        "value": "{{userToken}}",
                        "type": "string"
                    }
                ]
            }
        },
        {
            "name": "10 Analytics events (spec §10)",
            "description": "Analytics events (spec §10)\n\nAccess: User token (`auth:sanctum` + `user`) — free and paid users",
            "item": [
                {
                    "name": "Track client event",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/events",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "events"
                            ]
                        },
                        "description": "Stores a client-side analytics event. The frontend sends `report_viewed` (props.page = overview|gaps|citations|questions|trend) and `upgrade_page_opened` (props.from). The first `report_viewed` also records `first_report_viewed`.\n\nScreen: AppShell, C2\nAccess: User token (`auth:sanctum` + `user`) — free and paid users\nResponse: 204\nErrors: 401, 422",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"name\": \"report_viewed\",\n  \"props\": {\n    \"page\": \"overview\"\n  }\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                }
            ],
            "auth": {
                "type": "bearer",
                "bearer": [
                    {
                        "key": "token",
                        "value": "{{userToken}}",
                        "type": "string"
                    }
                ]
            }
        },
        {
            "name": "11 SMS: phone sign-in (IPPanel Edge)",
            "description": "Phone variants of the sign-in endpoints (same routes as 3.1 and the admin auth section). Locally no IPPanel key is set, so the **log driver** is used: nothing is sent, the message goes to `storage/logs/laravel.log` and `sms_logs`, and `dev_code` is returned. Demo mobiles: customer `09120000077` (demo@rawi.local), super admin `09120000900`.\n\nAccess: Public — no token",
            "item": [
                {
                    "name": "Phone login: request SMS code",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/auth/request-code",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "auth",
                                "request-code"
                            ]
                        },
                        "description": "Sends the sign-in code by SMS (type `otp`) to the mobile.\n\nScreen: O1 «موبایل»\nAccess: Public — no token\nResponse: 200 RequestCodeResponse (phone)\nErrors: 422, 429, 503",
                        "auth": {
                            "type": "noauth"
                        },
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"phone\": \"{{userPhone}}\",\n  \"channel\": \"sms\",\n  \"locale\": \"{{lang}}\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "const j = pm.response.json();",
                                    "if (j.dev_code) pm.collectionVariables.set(\"devCode\", j.dev_code);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Phone login: request voice code",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/auth/request-code",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "auth",
                                "request-code"
                            ]
                        },
                        "description": "Voice-call fallback. Only when `voice_fallback` is on (GET /auth/options) and an SMS code was requested for this number at least 45 s earlier; the voice code replaces the SMS code.\n\nScreen: O1 «دریافت کد با تماس صوتی»\nAccess: Public — no token\nResponse: 200 RequestCodeResponse (phone)\nErrors: 422, 429",
                        "auth": {
                            "type": "noauth"
                        },
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"phone\": \"{{userPhone}}\",\n  \"channel\": \"voice\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "const j = pm.response.json();",
                                    "if (j.dev_code) pm.collectionVariables.set(\"devCode\", j.dev_code);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Phone login: verify (get user token)",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{lang}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{baseUrl}}/auth/verify",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "auth",
                                "verify"
                            ]
                        },
                        "description": "Signs in the user with this verified phone, or creates a phone-only account (`email: null`).\n\nScreen: O1\nAccess: Public — no token\nResponse: 200 VerifyResponse\nErrors: 422",
                        "auth": {
                            "type": "noauth"
                        },
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"phone\": \"{{userPhone}}\",\n  \"code\": \"{{devCode}}\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "const j = pm.response.json();",
                                    "if (j.token) pm.collectionVariables.set(\"userToken\", j.token);"
                                ]
                            }
                        }
                    ]
                }
            ],
            "auth": {
                "type": "noauth"
            }
        }
    ],
    "variable": [
        {
            "key": "baseUrl",
            "value": "http://127.0.0.1:8010/api",
            "type": "string",
            "description": "API base URL"
        },
        {
            "key": "lang",
            "value": "fa",
            "type": "string",
            "description": "Accept-Language: fa | en"
        },
        {
            "key": "userEmail",
            "value": "demo@rawi.local",
            "type": "string",
            "description": "demo customer (free plan, brand آوند)"
        },
        {
            "key": "userPhone",
            "value": "09120000077",
            "type": "string",
            "description": "verified mobile of demo@rawi.local (SMS sign-in, S5)"
        },
        {
            "key": "userToken",
            "value": "",
            "type": "string",
            "description": "set by «Verify code» or «Phone login: verify»"
        },
        {
            "key": "devCode",
            "value": "",
            "type": "string",
            "description": "set by «Request login code» (dev_code, local only)"
        },
        {
            "key": "questionId",
            "value": "345",
            "type": "string",
            "description": "own active question (set by GET /questions)"
        },
        {
            "key": "runId",
            "value": "38",
            "type": "string",
            "description": "own run (set by GET /runs)"
        },
        {
            "key": "productId",
            "value": "39",
            "type": "string",
            "description": "own product (set by GET /settings/products)"
        },
        {
            "key": "customerId",
            "value": "41",
            "type": "string",
            "description": "own target customer (set by GET /settings/products)"
        },
        {
            "key": "paymentId",
            "value": "",
            "type": "string",
            "description": "own payment (set by checkout or GET /billing/payments); the demo account has none"
        },
        {
            "key": "redirectUrl",
            "value": "",
            "type": "string",
            "description": "mock gateway page (set by checkout)"
        },
        {
            "key": "consultationId",
            "value": "23",
            "type": "string",
            "description": "own consultation request (set by POST /consultations)"
        },
        {
            "key": "gatewayId",
            "value": "1",
            "type": "string",
            "description": "A3 gateway (set by gateway lists / create)"
        },
        {
            "key": "reauthToken",
            "value": "",
            "type": "string",
            "description": "S5 reauth_token (set by «Confirm it's you: verify code»; 10 minutes, one protected change)"
        },
        {
            "key": "stripeTimestamp",
            "value": ""
        },
        {
            "key": "stripeSignature",
            "value": ""
        }
    ]
}
