> ## Documentation Index
> Fetch the complete documentation index at: https://docs.braintest.ir/llms.txt
> Use this file to discover all available pages before exploring further.

# Request AI Roadmap Analysis

> Queue AI-powered combined analysis for a completed cognitive roadmap. Processing takes 5 to 10 minutes; poll the status endpoint until finished.

Use this endpoint to request AI-powered combined analysis after all test records in a cognitive roadmap are completed. The Braintest platform queues the roadmap for multi-instrument analysis, which typically takes 5 to 10 minutes. Poll the generation status endpoint until the analysis is ready.

## Prerequisites

Before calling this endpoint, ensure that:

* All test records in the roadmap are completed (`is_finished: true`)
* All participant profiles are authenticated (`auth_required: false` for every record)
* Billing and VIP prerequisites are satisfied

## Endpoint

```http theme={"dark"}
POST https://braintest.ir/api/v2/roadmap/{token}/generate/
```

## Path Parameters

<ParamField path="token" type="string" required>
  The unique cognitive roadmap instance UUID.
</ParamField>

## Response

<ResponseField name="data.status" type="string">
  Always `processing` when the request is accepted.
</ResponseField>

<ResponseField name="data.estimated_wait_minutes" type="string">
  Human-readable estimate of processing time (for example, `"5-10"`).
</ResponseField>

## Example Request

```bash theme={"dark"}
curl -X POST "https://braintest.ir/api/v2/roadmap/b2c3d4e5-f6a7-8901-bcde-f12345678901/generate/" \
  -H "API-KEY: YOUR_API_KEY"
```

## Example Response

```json theme={"dark"}
{
  "data": {
    "status": "processing",
    "estimated_wait_minutes": "5-10"
  },
  "successful": true,
  "messages": []
}
```

## Idempotent Behavior

If AI generation is already queued or in progress, the endpoint returns **200 OK** with `status: processing` instead of creating a duplicate job.

## Next Steps

After receiving a `processing` response, poll `GET /roadmap/{token}/generate/status/` until the status changes to `completed` or `failed`. When completed, retrieve the final results from `/roadmap/{token}/result/json/` or `/roadmap/{token}/result/html/`.

## Error Responses

| HTTP | Cause                                                                 |
| ---- | --------------------------------------------------------------------- |
| 403  | Billing or VIP prerequisite not met                                   |
| 404  | Roadmap not found                                                     |
| 409  | Not all test records are completed, or profiles are not authenticated |
