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

# API conventions

> Shared request and result conventions.

`GET /v1/openapi.json` returns the current contract, revision 2. Each endpoint defines its accepted fields and result shape.

## Requests

* **REST JSON:** send an `inputs` array of objects containing an [uploaded media reference](https://docs.trycarhub.com/guides/uploads.md) as `ref`. Put endpoint options in `params`.
* **Multipart:** send `inputs` as a JSON array. Each input's `file` names one attached file part. Send `params` as a JSON object.
* **MCP:** send an `inputs` array with `ref` or `url` in each object, and put endpoint options in `params`. Remote URLs require upload permission.

Use exactly one media source per input. An optional `client_id` must be unique within the request. Include `role` when the endpoint requires a named view or document side. Structured-data endpoints can omit media where allowed and carry their data in `params`.

Unknown fields, invalid parameters, and conflicting sources are rejected before a job is created.

Preserve the endpoint's required input order. Reuse `Idempotency-Key` and the same REST payload for retries. Honor `Retry-After` and retain `X-Request-Id` for support. See [jobs and retries](https://docs.trycarhub.com/guides/jobs.md).

## Results

* New jobs carry `result_schema_version: 2`. Parse `result` using the endpoint's schema.
* Check quality, coverage, warnings, and errors before interpreting an empty or null result. Scores are indicative and specific to their field or detection.
* Independent image batches return ordered `result.items`, with `image_count`, `succeeded_count`, and `failed_count`. Each item identifies its input with `input_index` and, when supplied, `client_id`. Check `status`: a successful item contains `result`, and a failed item contains `error`. Retain successful outputs from partial jobs.

Read `analysis.status` and `analysis.reason_codes` before interpreting a negative or empty result. `not_found`, `unreadable`, `ambiguous`, and `unassessable` describe different outcomes. A processing failure appears in the job or item error.

Download generated files before their URL's `expires_at`. Reading the job again does not renew links.

> [accordion] Geometry and masks
>
> Boxes use pixel coordinates `x`, `y`, `width`, and `height` from the top-left of the source after EXIF orientation. Use the returned `input_index` and source dimensions to associate geometry with its image.
>
> Polygons are simplified and may omit holes or disconnected regions. `rle_coco` represents the complete raster mask, with `size` ordered `[height, width]`.

> [accordion] Document readings
>
> Retain raw text alongside normalized dates and amounts. Document line items and service operations are limited to 50 entries. Missing or uncertain values do not confirm absence.
>
> For driver license inputs, specify each image's `role` as `front`, `back`, or `unknown`. Read the result's `document_standard` to identify the recognized document standard. Use `input_index` to associate field evidence and portrait geometry with the correct source image.

> [accordion] IDs and pagination
>
> Keep returned IDs unchanged. While `has_more` is true, pass `next_cursor` as `cursor` to fetch the next page.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.