> For the complete documentation index, fetch https://nextauto.ai/llms.txt. Use it to find every page before exploring further.

# Create a report

`POST /v1/analyses` starts a Vehicle Asset Report from photos. (The path says analyses; each one is a report.)

## Request fields

- `images` (required): 1 to 32 photos, each `{ "url": "https://..." }` or `{ "data": "<base64>", "media_type": "image/jpeg" }`. The first 24 are analyzed, and the result warns when more were sent.
- `vehicle`: `vin`, `year`, `make`, `model`, `trim`, `market` (2 or 3 letters, such as `MX`) and `options` (a list of strings). All optional.
- `notes`: up to 2,000 characters of context, such as "rear bumper replaced last year".
- `reference`: your own id, up to 200 characters, echoed back in the result.
- `features`: result features you need, such as `["tires"]`. With no `pipeline`, the default runs when it has them, and otherwise a pipeline that does. See [Features](https://nextauto.ai/docs/features).
- `pipeline`: a pipeline id to pin, such as `X6`. Without it your account's default runs, else the platform's (`X6` today). Asking for a feature the pinned pipeline doesn't return answers `400`.
- `interiors`: `skip` or `detect`, for pipelines with `photo_types`. `skip` leaves photos clearly sorted as interior, document or not a vehicle out of damage detection; borderline photos are always checked.

```bash
curl -X POST "https://nextauto.ai/v1/analyses?wait=true" \
  -H "Authorization: Bearer $NEXTGRADE_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: your-own-id-123" \
  -d '{
    "images": [{ "url": "https://example.com/front.jpg" }, { "url": "https://example.com/left.jpg" }],
    "vehicle": { "vin": "5XYPG4A32JG427430", "trim": "LX", "market": "MX" },
    "notes": "Rear bumper replaced last year",
    "reference": "your-own-id-123",
    "features": ["tires"]
  }'
```

## Answers

- `202`: started. The body has the `analysis_id` and `status`; the `Location` and `x-analysis-id` headers point to it.
- With `?wait=true` the call waits for the report, up to about 4.5 minutes: `200` when completed, `422` when the report failed, and `202` if it is still running.
- `400`: the body is invalid (`issues` lists each problem), or the pinned pipeline lacks a requested feature.
- Limits: `429` and `402`, see [Usage and limits](https://nextauto.ai/docs/limits).

## Fetch a report

`GET /v1/analyses/{id}` returns the status (`queued`, `processing`, `completed`, `failed`), the current `stage` while it runs (`loading_photos`, `finding_damage` or `writing_report`), and the full result once completed. Only the account that created a report can read it; any other id answers `404`.

For many reports, register a [webhook](https://nextauto.ai/docs/webhooks) instead of polling. If you poll, wait about 10 seconds between calls.

## List reports

`GET /v1/analyses` lists your reports, newest first, with each one's `analysis_id`, `status`, `created_at`, `reference`, `vehicle` and `damage_count`. Use `limit` (1 to 100, default 20) and `status` to narrow it. When there are more, `next_before` is set: pass it as `before` for the next page.

## Safe retries

Send an `Idempotency-Key` header with any unique string. Repeating the request with the same key returns the same report instead of starting, and paying for, a new one.
