View as Markdown

Attest · Guide

Run an ID session

An ID session asks a person for the document kinds you accept (a driver's license, ID card or residence permit front and back, or a passport photo page), then a selfie with a short head turn. They take each photo live: in your app with the native SDK, or on our branded capture page from a link.

As they frame each shot the phone says what to fix ("Hold still", "Too much glare"). After each shot our server checks the photo again and offers a retake. When they send it, you get a webhook, a redirect back into your flow, and a signed result that says what each image is and whether it passed.

Checking that the document is genuine, reading it and matching the face to it stay with your identity provider. An ID session gets them clean, live images with proof of how they were taken.

Before you begin: set PROVENANCE_API as on Sandbox and keys. 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. Read Request photos by link for how links are sent.

1. Create the session

Send POST /v1/attest/capture_requests with session_type: "id" instead of an item list:

FieldWhat it sets
accepted_documentsThe kinds you accept: passport, passport_card, driving_license, national_id_card, residence_permit. Default: passport, driving_license, national_id_card and residence_permit. With one kind (a car rental's ["driving_license"]) the person isn't asked which document they have; with several, they pick one of them
redirect_urlThe page in your flow the person returns to when they finish
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": "ONB-48213",
    "session_type": "id",
    "accepted_documents": ["passport", "driving_license"],
    "redirect_url": "https://app.pellowmarsh.example/onboarding/done",
    "delivery": "self"
  }'
{
  "id": "capr_01M6VQBD873JECJ1PKTECEGXNH",
  "object": "capture_request",
  "status": "pending",
  "case_id": "ONB-48213",
  "session_type": "id",
  "accepted_documents": ["passport", "driving_license"],
  "redirect_url": "https://app.pellowmarsh.example/onboarding/done",
  "items": [
    { "object": "capture_item", "index": 0, "type": "id_document", "label": "Your passport or driver’s license", "document_kind": null, "status": "waiting", "checks": [] },
    { "object": "capture_item", "index": 1, "type": "selfie", "label": "A selfie", "status": "waiting", "checks": [] }
  ],
  "result": null,
  "capture_url": "https://console.provenanceauth.com/capture/4WxUVWSppSynhTy7LDwew3hLatIIz3tzBLmG5jNq7aI"
}

The example is shortened. With delivery: "self" you show the link yourself (or open it in your app); send contact instead to have us text or email it with your branding.

2. Run it in your app or on the capture page

With the capture release on, the person first sees "Before you continue" and chooses I agree before the camera opens. If your app draws its own screens, send terms_accepted: true on the call that starts each item, or the face and ID photos are refused.

In your app (the strongest proof: each photo is signed by the device, StrongBox or the TEE on Android, the Secure Enclave on iPhone once App Attest is on), take the token from capture_url and render the SDK's default screens:

import { ProvenanceCaptureFlow } from "@provenanceauth/react-native";
import * as FileSystem from "expo-file-system";

<ProvenanceCaptureFlow
  token={captureToken}
  baseUrl={process.env.PROVENANCE_API!}
  readFileBase64={(uri) => FileSystem.readAsStringAsync(uri, { encoding: "base64" })}
  onComplete={({ requestId, redirectUrl }) => navigation.navigate("Onboarding", { requestId })}
/>

The screens use your branding (name, logo and colours, from Settings → Branding). To build your own screens, the same steps are separate SDK calls, listed in the native SDK guide.

On the capture page, the person opens the link on their phone. Every capture there is the software tier: a browser can't prove the camera hardware. The page takes live camera frames only.

Either way, the person:

  1. picks their document from the kinds you accept, one row each (skipped when you accept one);
  2. takes the card's front and back, or the passport's photo page, with a card guide on the viewfinder;
  3. follows a two-step head turn ("Turn your head to your left", then right), then takes the selfie;
  4. reviews every photo with what the checks found, retakes any, and taps Send.

3. Read the checks

The phone checks each photo first, for guidance while framing and a verdict before it's sent. Our server runs the decisive checks again on the uploaded image, and its answer is the one you receive:

CheckWhat it looks atIts limits
AttestationThe tier the server assigned and how the photo is bound: a device signature from your app, or a single-use shutter nonce on the capture pageA browser capture is always software
What it isThe step it was taken in, moved by evidence: a selfie-sized face, a small ID portrait, no face where one was expected; on iPhone also a passport's machine-readable zone, an ID barcode and the card's shape. Says how sure it is (high, medium, low) and whyIt doesn't read or authenticate the document
Usable or retakeSharpness, exposure, contrast, resolution, and on documents glare and how much of the frame the content fillsFixed thresholds on image statistics, not a model; framing is a rough measure
Face presentOne clear face, big enough, eyes visibleNeeds the face detector on the server; without it the check reports not_run
Head turn (basic)The frames the person took while turning: timing on our clock, that the frames change, and with the face detector that one face turns the asked wayIt catches a still photo or a frozen replay. A mask or a replayed video of a head turn needs a stronger check, such as your identity provider's
ScreeningSynthetic-media screening, when it is set up and within budgetAdvisory; it never changes the risk score
Document typeOn each ID shot, what kind of document it is (passport, driving_license, national_id_card, ...), the country when read, a confidence, and whether it's one of your accepted_documents. See document typeNot an authenticity check. Pro and up, and only where the classifier is set up

A check that couldn't run says not_run with the reason, never a pass. The session's result.checks is checks_passed only when every decisive check passed; otherwise needs_review, with the reasons. On a server without the face detector, an ID session always reads needs_review (face_check_not_run, liveness_limited).

No face template is ever made or stored. The head-turn frames are checked and dropped; the request keeps the outcome only.

4. Get the result back

When the person sends the session, you get attest.capture_request.completed with the result summary, and the capture page returns them to your redirect_url with capture_request_id and status appended. Fetch the signed result with GET /v1/attest/capture_requests/{id}/result:

curl $PROVENANCE_API/v1/attest/capture_requests/capr_01M6VQBD873JECJ1PKTECEGXNH/result \
  -H "Authorization: Bearer $PROVENANCE_KEY"
{
  "object": "capture_result",
  "capture_request_id": "capr_01M6VQBD873JECJ1PKTECEGXNH",
  "session_type": "id",
  "status": "completed",
  "checks": "checks_passed",
  "reasons": [],
  "images": [
    {
      "attestation_id": "att_3F3MNRWF2A9XF9PZ9A3G79Z3BV",
      "item_type": "id_document",
      "side": "front",
      "document_kind": "driving_license",
      "sha256": "3b1f8c0e5a6d47e29f0c1b2a3d4e5f60718293a4b5c6d7e8f9a0b1c2d3e4f506",
      "tier": "strongbox",
      "checks": {
        "kind": { "status": "done", "value": "id_card_front", "matches_request": true, "confidence": "medium", "basis": ["requested_step", "face_size"] },
        "quality": { "status": "usable", "reasons": [] }
      }
    }
  ],
  "token": "eyJhbGciOiJFUzI1NiIsInR5cCI6InByb3ZlbmFuY2UtY2FwdHVyZS1yZXN1bHQrand0Iiwia2lkIjoiOWYyYjFjNGQ2ZThhMGIyYyJ9…",
  "jwks_url": "https://api.provenanceauth.com/.well-known/jwks.json"
}

The example is shortened. token is an ES256 JWS (typ: provenance-capture-result+jwt) over the same claims; verify it against the JWKS before you pass the images on. Then fetch the images with GET /v1/attest/capture_requests/{id}/files: each link works without a key for 15 minutes (expires_in up to an hour). Send the images and the token to your identity provider together.

5. Keep images only as long as you need them

Images are encrypted at rest and kept for your retention window: 30 days unless you change it in the console (Attest → Capture requests) or with PUT /v1/attest/settings/capture_retention (1 to 365 days; a change applies to the images you already hold). Delete a session's images sooner with DELETE /v1/attest/capture_requests/{id}/media. The attestations, their hashes and the checks stay on the case after the images go, and the result records when they went.

Sign the photos in your own camera screen

When your app draws its own onboarding screens, skip the session and sign each photo with <ProvenanceCamera> from the native capture SDK. Provenance proves the capture: which enrolled device took the photo, when, and that the bytes are untouched. Your identity provider still runs the document and face checks, on the same image.

Enroll the phone

Enrollment sends the device's attestation evidence to the server, which assigns the hardware tier. Do it once per install, before the first capture.

import { enrollDevice } from "@provenanceauth/react-native";

const { deviceId, tier } = await enrollDevice({
  baseUrl: process.env.PROVENANCE_API!,
  apiKey: process.env.PROVENANCE_KEY!,
});

The app never reports its own tier. A device that can't prove hardware backing enrolls as software.

Capture the selfie and the ID front

Render <ProvenanceCamera> twice: once with facing="front" for the selfie, then with the default back lens for the ID. Use your onboarding case id as claimId so both photos land on one case.

import { ProvenanceCamera } from "@provenanceauth/react-native";

// Step 1: the selfie, front lens.
<ProvenanceCamera
  claimId="ONB-48213"
  facing="front"
  biometricPrompt
  onAttest={(r) => upload("selfie", r.bundleJson, r.fileUri)}
  onError={(e) => showRetry(e.code)}
/>

// Step 2: the ID front, back lens (the default).
<ProvenanceCamera
  claimId="ONB-48213"
  onAttest={(r) => upload("id_front", r.bundleJson, r.fileUri)}
/>

The lens is the only difference. Both photos are hashed, signed in the phone's secure hardware, and returned as the same signed bundle. The tier the server assigns depends on the platform; see the table under Read the hardware tier. Your JavaScript receives a file URI and the bundle, never the pixels. An unknown facing value fails with invalid_facing before the camera opens.

Keep the original bytes

Upload the file at fileUri unchanged. Cropping, compressing or re-encoding it changes the hash, and the asset then scores sensor_hash_mismatch.

Attest both photos

Your backend sends each signed bundle with its image to POST /v1/attest/attestations. Set case_type to presence so explanations use the word "verification" instead of "claim". Save the request body your app uploaded as selfie.json, then send it.

curl $PROVENANCE_API/v1/attest/attestations \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d @selfie.json
{
  "id": "8c4e17a2-5b1d-4f0e-9a63-2d7c1e0b4f19",
  "object": "attestation",
  "risk_score": 0,
  "status": "verified"
}

Repeat for the ID front. The response id is the attestation id you keep with the onboarding record.

Verify the case

Read both assets at once with GET /v1/attest/claims/{id}/provenance. Each asset carries its device, certificate check, capture chain and risk factors.

curl $PROVENANCE_API/v1/attest/claims/ONB-48213/provenance \
  -H "Authorization: Bearer $PROVENANCE_KEY"
{
  "id": "ONB-48213",
  "object": "claim",
  "assets": [
    {
      "id": "8c4e17a2-5b1d-4f0e-9a63-2d7c1e0b4f19",
      "object": "verification_result",
      "claim_id": "ONB-48213",
      "status": "verified",
      "risk_score": 0,
      "risk_factors": [],
      "device_info": {
        "device_id": "5f0d2c1a-7e44-4b8b-a1f2-9c3e6d7a8b01",
        "enrolled": true,
        "cert_valid": true,
        "cert_expires": "2028-10-23T16:49:34.000Z"
      },
      "capture_type": "image",
      "sensor_hash": "96354a9303b1e5737ea85acbba0022b2dedd17da20e1991b00176c1a6a6c8875"
    },
    {
      "id": "1b9d03f6-2a7e-4c55-8f10-6e2b9d4c7a33",
      "object": "verification_result",
      "claim_id": "ONB-48213",
      "status": "partial",
      "risk_score": 50,
      "risk_factors": [
        { "factor": "sensor_hash_mismatch", "points": 50, "description": "Image bytes hash does not match bundle sensor_hash" }
      ],
      "capture_type": "image"
    }
  ],
  "overall_status": "partial",
  "overall_risk_score": 50
}

The example is shortened. Here the selfie is untouched, and the ID front was edited after capture: its hash stops matching the signed bundle, so it scores sensor_hash_mismatch and the case lands in partial for review. The case score is the highest asset score.

StatusScoreWhat to do
verified0–30Pass the images to your identity provider.
partial31–80Send the case to manual review, or ask for a new capture.
failed81–100Reject the capture and ask the customer to take it again.

See risk scoring for every factor.

Read the hardware tier

The tier lives on the device record. List your enrolled devices with GET /v1/attest/devices (your Attest key) and find the device_id from the asset.

curl "$PROVENANCE_API/v1/attest/devices?limit=20" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
{
  "object": "list",
  "data": [
    {
      "id": "5f0d2c1a-7e44-4b8b-a1f2-9c3e6d7a8b01",
      "object": "device",
      "hardware_tier": "strongbox",
      "enrolled_at": "2026-10-24T16:49:34.956Z",
      "revoked_at": null
    }
  ],
  "has_more": false,
  "next_cursor": null
}
TierWhere the key lives
sepAn iPhone proven by App Attest, when the server verifies it. Otherwise an iPhone reports software
strongboxA dedicated secure chip on Android
teeThe Android trusted execution environment
softwareNo hardware backing; captures score hardware_backing_absent

Sandbox devices report simulated. If a phone is lost or compromised, revoke it with POST /v1/attest/devices/{id}/revoke; its later captures score device_revoked.

Export the evidence

Availability: Enterprise plan.

For an audit or a dispute, export the case with POST /v1/attest/claims/{id}/export. The bundle holds each signed attestation, its verification and a manifest hash, plus a verifier script that runs offline. When the deployment has a timestamp authority, the manifest hash also gets an RFC 3161 timestamp.

curl -X POST $PROVENANCE_API/v1/attest/claims/ONB-48213/export \
  -H "Authorization: Bearer $PROVENANCE_KEY"
{
  "id": "exp_01M5QD2NNCYXTSE0ZNG4GP4B5P",
  "object": "export",
  "claim_id": "ONB-48213",
  "status": "ready",
  "manifest_hash": "f1faf70cbf7fb440a3ec2188b9ccc96713a391157bc6e6f2a64acc8b68452630",
  "timestamp": { "status": "not_configured" },
  "file_count": 9,
  "download_url": "/v1/exports/exp_01M5QD2NNCYXTSE0ZNG4GP4B5P/download",
  "expires_at": "2026-10-25T16:49:35.404Z"
}

The export holds content hashes, never the photos themselves, so the images stay in your systems. See chain of custody for the bundle's layout.

Limitations

  • A completed session counts as one verified capture, whatever it holds; abandoned and expired sessions and retakes are free.
  • The head turn is a basic check. It catches a still photo or a frozen replay; stronger presentation-attack detection stays with your identity provider.
  • On Android the SDK's face detector finds faces but not their turn, so the head-turn direction is checked on the server.

Errors you might see

SymptomCauseFix
409 capture_document_requiredA photo of the ID before the person picked a document, in a session that accepts several kindsCall the document step first (the SDK and the page do).
409 capture_liveness_invalidThe head-turn challenge expired (2 minutes), was used, or belongs to another itemStart a new challenge and send the selfie with its frames.
409 capture_session_incompleteSent before every step had its photoTake the steps in details.items, then send again.
409 capture_result_not_readyThe result was fetched before the person sent the sessionWait for attest.capture_request.completed.
409 capture_session_needs_linkA guided session opened in <provenance-capture>Use the capture link or your app.
invalid_facingfacing is a value other than back or front in your own camera screenPass "front" for the selfie, or omit it for the back lens.
sensor_hash_mismatchThe uploaded image differs from the signed bytesUpload the file at fileUri unchanged.
hardware_backing_absentThe device enrolled as software, such as an emulatorCapture on a physical phone with a secure element.
device_revokedThe capturing device was revokedEnroll the customer's new device and capture again.
plan_requiredEvidence export needs the Enterprise planUpgrade the account, or keep the attestation ids and verify on demand.

See also