# Run a claim session

Ask a policyholder for photos and short videos of the damage, taken live on their phone, with checks on whether each photo is usable, and one signed result for the claim.

A claim session asks a policyholder for photos of the damage (up to 20) and short videos (up to 3), taken live on their phone: in your app with the native SDK, or on our branded capture page from a link.

They take as many as they need, the phone helps them frame each one, and our server checks each photo and offers a retake. When they send the session you get a webhook and one signed result for the claim.

**Before you begin:** set `PROVENANCE_API` as on [Sandbox and keys](https://provenanceauth.com/docs/get-started/sandbox.md). You need an `attest` key on an account with its own Attest key; in the sandbox, `prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x` is set up for you.

## 1. Create the session

Send [`POST /v1/attest/capture_requests`](https://provenanceauth.com/docs/api/capture-requests.md#post-v1-attest-capture-requests) with `session_type: "claim"`. `photos` and `videos` set how many the person takes (`min` and `max`; by default 1 to 20 photos and 0 to 3 videos, each up to `max_duration_s`, default 30 seconds). Send `"photos": { "until_done": true }` for open-ended photos: the person adds photos until they tap **Done**, the page shows no count, and the server caps them at 50 (or your `max`; see [Photos until they're done](https://provenanceauth.com/docs/attest/guides/capture-requests.md#photos-until-theyre-done)).

**curl**

```bash
export PROVENANCE_KEY=prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x
curl -X POST $PROVENANCE_API/v1/attest/capture_requests \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "case_id": "CLM-2026-10441",
    "session_type": "claim",
    "photos": { "min": 2, "max": 20 },
    "videos": { "max": 1, "max_duration_s": 45 },
    "contact": { "email": "pat@example.com" }
  }'
```

**Node**

```ts
import { Provenance } from "@provenanceauth/sdk";

const prov = new Provenance({ apiKey: process.env.PROVENANCE_KEY!, baseUrl: process.env.PROVENANCE_API });
const session = await prov.attest.captureRequests.create({
  caseId: "CLM-2026-10441",
  sessionType: "claim",
  photos: { min: 2, max: 20 },
  videos: { max: 1, maxDurationS: 45 },
  contact: { email: "pat@example.com" },
});
console.log(session.id, session.items.map((i) => [i.type, i.minCount, i.maxCount]));
```

**Python**

```python
import os
from provenanceauth import Provenance

prov = Provenance(os.environ["PROVENANCE_KEY"], base_url=os.environ["PROVENANCE_API"])
session = prov.attest.capture_requests.create(
    case_id="CLM-2026-10441",
    session_type="claim",
    photos={"min": 2, "max": 20},
    videos={"max": 1, "max_duration_s": 45},
    contact={"email": "pat@example.com"},
)
print(session["id"], [(i["type"], i.get("min_count"), i.get("max_count")) for i in session["items"]])
```

```json
{
  "id": "capr_01M6VR2B5C9QW3JX8T1KZAHYDE",
  "object": "capture_request",
  "status": "pending",
  "case_id": "CLM-2026-10441",
  "session_type": "claim",
  "items": [
    { "object": "capture_item", "index": 0, "type": "photo", "label": "Photos of the damage", "min_count": 2, "max_count": 20, "status": "waiting", "checks": [] },
    { "object": "capture_item", "index": 1, "type": "video", "label": "A short video", "max_duration_s": 45, "min_count": 0, "max_count": 1, "status": "waiting", "checks": [] }
  ],
  "delivery": { "channel": "email", "delivered": false, "reason": "channel_not_configured" },
  "result": null
}
```

The example is shortened. The sandbox sends no email, so `delivery` says `channel_not_configured`; in live the policyholder gets an email in your branding.

## 2. What the policyholder does

With the [capture release](https://provenanceauth.com/docs/attest/guides/capture-release.md) on, they first see "Before you continue" with the sentence for photos with no face step, and choose **I agree** before the camera opens.

On the capture page (or in your app with `<ProvenanceCaptureFlow>`, see [Capture on a phone](https://provenanceauth.com/docs/attest/guides/native-sdk.md)):

1. They take photos one after another. The viewfinder says what to fix as they frame ("Hold still", "Find more light"); after each photo the server's checks come back, with a retake offered when the photo looks blurry, dark or too far away.
2. They tap **Done with photos** once they have at least the minimum, or keep going to the maximum.
3. They record a video, or skip it when it's optional. Each video is recorded on the chunk chain: the server timestamps each 2-second chunk's hash as it arrives.
4. They review everything, retake anything, and tap **Send**.

Videos are taken on the capture page for now; the native SDK skips an optional video and refuses a required one, so create app sessions with `videos: { "max": 0 }`.

## 3. Read the checks and the result

Each photo carries the server's checks: the attestation (tier and how it is bound), usable or retake (sharpness, exposure, contrast, resolution), what it is (a damage photo, unless it is clearly a selfie) and synthetic-media screening when it is set up. A video carries its chunk-chain and timing checks on the attestation. When the person sends the session you get `attest.capture_request.completed` with `result.checks` (`checks_passed` or `needs_review` with the reasons), and the signed result with [`GET /v1/attest/capture_requests/{id}/result`](https://provenanceauth.com/docs/api/capture-requests.md#get-v1-attest-capture-requests-id-result):

**curl**

```bash norun
curl $PROVENANCE_API/v1/attest/capture_requests/capr_01M6VR2B5C9QW3JX8T1KZAHYDE/result \
  -H "Authorization: Bearer $PROVENANCE_KEY"
curl "$PROVENANCE_API/v1/attest/capture_requests/capr_01M6VR2B5C9QW3JX8T1KZAHYDE/files?expires_in=900" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const result = await prov.attest.captureRequests.result("capr_01M6VR2B5C9QW3JX8T1KZAHYDE");
const files = await prov.attest.captureRequests.files("capr_01M6VR2B5C9QW3JX8T1KZAHYDE");
console.log(result.checks, result.counts, files.data.map((f) => f.url));
```

**Python**

```python
result = prov.attest.capture_requests.result("capr_01M6VR2B5C9QW3JX8T1KZAHYDE")
files = prov.attest.capture_requests.files("capr_01M6VR2B5C9QW3JX8T1KZAHYDE")
print(result["checks"], result["counts"], [f["url"] for f in files["data"]])
```

```json
{
  "object": "capture_result",
  "capture_request_id": "capr_01M6VR2B5C9QW3JX8T1KZAHYDE",
  "session_type": "claim",
  "checks": "needs_review",
  "reasons": ["retake_suggested"],
  "counts": { "images": 6, "videos": 1, "usable": 5, "retake_suggested": 1 },
  "images": [
    {
      "attestation_id": "att_0TFGZ90TSF9MCABH0EKWNQTV0K",
      "item_type": "photo",
      "position": 3,
      "sha256": "9c41d2a0b7e35f6c8d1e2f3a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5ce07a",
      "tier": "software",
      "checks": {
        "kind": { "status": "done", "value": "damage_photo", "matches_request": true, "confidence": "low", "basis": ["requested_step"] },
        "quality": { "status": "retake", "reasons": ["blurry"] }
      }
    }
  ],
  "token": "eyJhbGciOiJFUzI1NiIsInR5cCI6InByb3ZlbmFuY2UtY2FwdHVyZS1yZXN1bHQrand0In0…"
}
```

The example is shortened. A person can send a photo the checks would retake ("Keep it"); the result then says `needs_review`, and your adjuster decides. The attestations are on the claim as with any capture, so the [claims workflow](https://provenanceauth.com/docs/attest/guides/review-claims.md) and the console show them.

## 4. Count and keep

A completed session counts as one verified capture, however many photos and videos it holds; a session that expires or is cancelled before it is sent is free, and so are retakes. Images are encrypted and kept for your retention window (30 days by default, 1 to 365), then deleted; the attestations and checks stay on the claim. Delete them sooner with [`DELETE /v1/attest/capture_requests/{id}/media`](https://provenanceauth.com/docs/api/capture-requests.md#delete-v1-attest-capture-requests-id-media).

## Errors you might see

| Symptom | Cause | Fix |
| --- | --- | --- |
| `400` [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid) on `photos.min` | `min` is above `max` | Send a range that fits. |
| `400` [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid) on `index` | **Done** before the minimum | Take more photos first. |
| `409` [`capture_session_incomplete`](https://provenanceauth.com/docs/platform/errors.md#capture_session_incomplete) | Sent with a step short of its minimum | Take the steps in `details.items`, then send again. |
| `400` [`capture_type_unavailable`](https://provenanceauth.com/docs/platform/errors.md#capture_type_unavailable) | A `require_tier: "hardware"` claim session that allows videos | Set `videos.max` to 0, or allow the browser. |

## See also

- [ID capture sessions](https://provenanceauth.com/docs/attest/guides/id-capture-sessions.md)
- [Request photos by link](https://provenanceauth.com/docs/attest/guides/capture-requests.md)
- [Video attestation](https://provenanceauth.com/docs/attest/concepts/video-attestation.md)
- [Claims capture](https://provenanceauth.com/docs/attest/guides/review-claims.md)
