> ## 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.

# Detect exterior damage

> Submit ordered vehicle photos and inspect damage across adjacent frames.

`POST /v1/damage/detect` accepts 1 to 30 exterior photos of the same vehicle. Send photos in chronological order. CarHub preserves that order and charges one image unit for each processed photo.

The endpoint is in invite-only beta. Your organisation needs explicit access.

## Send files directly

Repeat the `images` multipart field in the required order.

```bash theme={null}
curl -sS "$CARHUB_API_URL/v1/damage/detect?wait=true" \
  -H "Authorization: Bearer $CARHUB_API_KEY" \
  -F "images=@front-left.jpg" \
  -F "images=@left-side.jpg" \
  -F "mask_format=polygon" \
  -F "attribute_parts=true" \
  -F "min_confidence=0.85"
```

## Use uploaded files

Upload large files first. Then submit their references in order.

```bash theme={null}
curl -sS "$CARHUB_API_URL/v1/damage/detect" \
  -H "Authorization: Bearer $CARHUB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input_refs": ["upl_first", "upl_second"],
    "mask_format": "polygon",
    "attribute_parts": true,
    "min_confidence": 0.85
  }'
```

The response is a job. A synchronous request returns `200` when inference completes within the wait budget. Otherwise it returns `202` and continues processing.

## Poll the job

Read the job URL from the `Location` response header, or use its `id`.

```bash theme={null}
curl -sS "$CARHUB_API_URL/v1/jobs/$JOB_ID" \
  -H "Authorization: Bearer $CARHUB_API_KEY"
```

Each item in `damages` represents one associated damage. Its geometry comes from the highest-confidence observation. Use `observations` for frame-specific geometry, masks, confidence and part attribution. Damage IDs remain stable only within that job.
