View as Markdown

Attest · Quickstart

Capture, claim, verify

In this quickstart you send a person a capture link, read the claim their photo lands on, verify its attestation and explain a claim that failed. The phone signs each photo at the moment of capture, so a photo changed afterwards fails verification. You use a published sandbox key, so you don't need an account.

1. Set your sandbox key

The full-access sandbox key reads the seeded claims and verifies attestations. Every key is listed on Sandbox and keys.

export PROVENANCE_API=https://sandbox-api.provenanceauth.com
export PROVENANCE_KEY=prv_test_full_K7mN3xQp9RbT2vWm8sYd4cFjLhXn6gAe

2. Ask for a photo

POST /v1/attest/capture_requests creates a capture link for a claim. With delivery: "self" nothing is sent: the response carries capture_url for you to share. Capture requests need an account with its own Attest key; the published capture key is set up for it.

curl -s -X POST $PROVENANCE_API/v1/attest/capture_requests \
  -H "Authorization: Bearer prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x" \
  -H "Content-Type: application/json" \
  -d '{
    "case_id": "CLM-2077",
    "items": [{ "type": "photo", "label": "The damage", "instructions": "Step back so the whole dent is in frame." }],
    "delivery": "self"
  }'
{
  "object": "capture_request",
  "status": "pending",
  "case_id": "CLM-2077",
  "delivery": { "channel": "self", "delivered": false, "reason": "self_delivery" }
}

Open capture_url on a phone. The capture page signs each photo with a key on that device as it's taken, and the photo lands on claim CLM-2077.

3. Read the claim

GET /v1/attest/claims/{id}/provenance returns every asset on a claim with its verdict and risk score. Without a phone, continue on the seeded clean claim, which has two attested photos; with your own photo, read CLM-2077 with the capture key instead.

export CLAIM_ID=${CLAIM_ID:-CLM-SANDBOX-CLEAN}
curl -s $PROVENANCE_API/v1/attest/claims/$CLAIM_ID/provenance \
  -H "Authorization: Bearer $PROVENANCE_KEY" | tee claim.json

The response, trimmed to the first asset:

{
  "id": "CLM-SANDBOX-CLEAN",
  "object": "claim",
  "assets": [
    { "id": "att_00000000000000000000000000000001", "status": "verified", "risk_score": 0, "capture_type": "image" }
  ],
  "overall_status": "verified",
  "overall_risk_score": 0
}
export ATTESTATION_ID=$(jq -r .assets[0].id claim.json)

4. Verify the attestation

POST /v1/attest/verifications checks one attestation from scratch: the device's certificate, the signature over the capture record and the image bytes against the hash signed at capture.

curl -s -X POST $PROVENANCE_API/v1/attest/verifications \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "attestation_id": "'"$ATTESTATION_ID"'" }'
{
  "object": "verification_result",
  "status": "verified",
  "risk_score": 0,
  "risk_factors": [],
  "device_info": { "enrolled": true, "cert_valid": true }
}

verified with a risk score of 0: an enrolled device signed this photo and nothing changed it since.

5. Explain a claim that failed

The seeded fraud claim holds two photos changed after capture. GET /v1/attest/claims/{id}/explanation turns its factors into fixed, plain-language text you can show the policyholder, with what would resolve each one.

curl -s $PROVENANCE_API/v1/attest/claims/CLM-SANDBOX-FRAUD/explanation \
  -H "Authorization: Bearer $PROVENANCE_KEY"

The response, trimmed to the first two factors:

{
  "object": "claim_explanation",
  "claim_id": "CLM-SANDBOX-FRAUD",
  "overall_status": "failed",
  "factors": [
    {
      "code": "signature_invalid",
      "title": "Signature did not verify",
      "resolution_hint": "Submit the original, unedited file exactly as captured."
    },
    {
      "code": "sensor_hash_mismatch",
      "title": "Image doesn't match its record",
      "resolution_hint": "Submit the original photo without cropping, filtering, or re-saving it."
    }
  ]
}

Try it

The Attest explorer verifies an attestation in your browser. The sandbox seeds these fixtures:

ScenarioInputExpected
Clean photoattestation_id att_00000000000000000000000000000001status: "verified", risk_score: 0
Edited photoattestation_id att_00000000000000000000000000000003status: "failed", signature_invalid and sensor_hash_mismatch
Clean claimGET /v1/attest/claims/CLM-SANDBOX-CLEAN/provenanceoverall_status: "verified"
Edited videoGET /v1/attest/claims/CLM-SANDBOX-VIDEO/provenanceAsset …0005 is partial with frame_hash_mismatch at chunk 1
Unknown attestationAny other attestation_id404 resource_missing

Next steps

See Example apps for small working apps that use Attest end to end.