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 / 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"
}'
import { Provenance } from "@provenanceauth/sdk";
const capture = new Provenance({ apiKey: "prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x", baseUrl: process.env.PROVENANCE_API });
const request = await capture.attest.captureRequests.create({
caseId: "CLM-2077",
items: [{ type: "photo", label: "The damage", instructions: "Step back so the whole dent is in frame." }],
delivery: "self",
});
console.log(request.captureUrl);
import os
from provenanceauth import Provenance
capture = Provenance("prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x", base_url=os.environ["PROVENANCE_API"])
request = capture.attest.capture_requests.create(
case_id="CLM-2077",
items=[{"type": "photo", "label": "The damage", "instructions": "Step back so the whole dent is in frame."}],
delivery="self",
)
print(request["capture_url"])
{
"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 / 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
const prov = new Provenance({ apiKey: process.env.PROVENANCE_KEY!, baseUrl: process.env.PROVENANCE_API });
const claim = await prov.attest.claims.getProvenance(process.env.CLAIM_ID ?? "CLM-SANDBOX-CLEAN");
prov = Provenance(os.environ["PROVENANCE_KEY"], base_url=os.environ["PROVENANCE_API"])
claim = prov.attest.claims.get_provenance(os.environ.get("CLAIM_ID", "CLM-SANDBOX-CLEAN"))
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 / 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"'" }'
const result = await prov.attest.verifications.create({ attestationId: claim.assets[0].id });
result = prov.attest.verifications.create(attestation_id=claim["assets"][0]["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 / 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"
const explanation = await prov.attest.claims.explanation("CLM-SANDBOX-FRAUD");
console.log(explanation.summary);
explanation = prov.attest.claims.explanation("CLM-SANDBOX-FRAUD")
print(explanation["summary"])
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:
| Scenario | Input | Expected |
|---|---|---|
| Clean photo | attestation_ att_ | status: "verified", risk_ |
| Edited photo | attestation_ att_ | status: "failed", signature_ and sensor_ |
| Clean claim | GET / | overall_ |
| Edited video | GET / | Asset …0005 is partial with frame_ at chunk 1 |
| Unknown attestation | Any other attestation_ | 404 resource_ |
Next steps
See Example apps for small working apps that use Attest end to end.