SDK reference · Python SDK

prov.attest.capture_requests.create

prov.attest.capture_requests.create in Python SDK.

Signature

prov.attest.capture_requests.create(**body: Any = …) -> Any

Parameters

**bodyAny

Request fields

Idempotency-Keystringheader
Retry a create safely: the same key + request returns the stored response (24 h, per caller).
case_idstringRequired
The case or claim the captures attach to.
session_typeenum
A guided session instead of items. id: an ID card (front and back) or a passport page, then a selfie with a head-turn check. claim: photos and videos of damage. A session completes when the person sends it from the review step. One of id, claim.
accepted_documentsarray of enums
id sessions: the document kinds you accept (default passport, driving_license, national_id_card, residence_permit). With one (a car rental's ["driving_license"]), the person isn't asked to choose; with several, they pick one of them.
photosobject
claim sessions: how many photos (default 1 to 20), or until_done for open-ended photos.
Show child attributes
mininteger
The fewest (default 1).
maxinteger
The most (default 20; at most 20 unless until_done, then up to 50, default 50).
until_doneboolean
Open-ended photos: the person adds photos until they tap Done, and the link shows no count. max (default 50) is the server's cap.
videosobject
claim sessions: how many videos (default 0 to 3) and how long each may run.
Show child attributes
mininteger
The fewest (default 0).
maxinteger
The most (default 3; 0 for none).
max_duration_sinteger
The longest recording in seconds (default 30).
redirect_urlstring
Where the capture page sends the person when they finish (https). We append capture_request_id and status; fetch the result with your key.
displayobject
What the page's first sentence says.
Show child attributes
purposestring
What the request is for, read after "<Your name> is asking you": to verify your ID, for 3 photos of the damage. Without it the sentence names the items ("for a photo of your ID and a selfie").
itemsarray of objects
Your own items, in order (1–10). Leave out with session_type.
Show child attributes
typeenumRequired
The item type. One of photo, selfie, id_document, video.
labelstring
A short name shown above the viewfinder.
instructionsstring
Plain-text guidance shown with the item.
sidesarray of enums
id_document only: ["front"] or ["front", "back"] (the default).
max_duration_sinteger
video only: the longest recording in seconds (default 30).
min_duration_sinteger
video only: the shortest recording in seconds.
until_doneboolean
photo only: open-ended. The person adds photos until they tap Done; the link shows no count. The item takes at least one photo and at most max_count.
max_countinteger
With until_done: the server's cap on photos (default 50). Never shown to the person.
contactobject
Who a capture request goes to, and the name you hold for them: a phone, an email or both, from your own records, and an optional name. A name sent alone is no contact to send to (the request is link only). The name is display only: it shows in full on your own reads of the request and the list, and never on the person's capture page, in a webhook or to another account.
Show child attributes
phonestring
An E.164 phone number (+14155550132). Spaces are removed; nothing else is guessed.
emailstring
An email address, compared in lower case.
namestring
The person's name as you hold it (Maya Chen). One line; spaces collapsed. Sealed at rest, opened in your account export, cleared with the contact 30 days after the request ends.
text_consentobject
With phone: your statement that the person at this phone agreed to your texts, as on RequestContact.
Show child attributes
methodenumRequired
How the person agreed. One of sign_up_form, in_app, in_person, customer_list.
obtained_attimestampRequired
When they agreed; not in the future.
evidence_urlstring
An https link to how they agreed. Stored, never fetched.
deliveryenum
send: Provenance sends the request on the channels channels allows. self: link only. Nothing is sent and the response returns the link for you to pass on. Left out, a request with no contact is link only and any other takes your account's default (send out of the box). With a default of link only, a request that gives a contact must say send. One of send, self.
channelsarray of enums
Which of Provenance's messages may go, in any order: app_notification (the person's Provenance app, when the contact matches one person there), email and text. Left out, your account's default (all three out of the box). With all three, the person gets the app notification and the email when their contact matches, and the text and the email otherwise; a narrower list sends only what it names (the text goes in the notification's place only with text, the email beside either only with email). Each message is reported on its own in deliveries. A list that can reach none of the contacts is refused, as are sms and app_push.
follow_up_textobject
The follow-up text for this request (or, on PUT /v1/account/reminders, the default). Each key left out takes your account's saved default; the whole object left out takes all three (on, not_opened, 5 minutes out of the box). On a live deployment it is Pro and above (402 plan_required on Free, nothing created or saved); in the sandbox it works on every plan. Refused beside delivery: "self".
Show child attributes
enabledboolean
false sends no follow-up text.
whenenum
not_opened (the default) or not_finished. One of not_opened, not_finished.
after_minutesinteger
A whole number of minutes from 1 to 1440, counted from the notification. On a create it must be shorter than the request's expires_in (400 parameter_invalid on follow_up_text.after_minutes); a longer wait from your default is kept, and the text is skipped as expired if the request ends first.
remindersobject
This request's automatic reminders, in the shape of one product's schedule in Settings (schedules.<kind> on /v1/account/reminders): capture_request for a capture request, checkout_approval for a cart approval (and an assessment's challenge or a guest confirmation), approval for a routed approval. Keys left out take your account's saved values, as a PUT to Settings does: after alone changes the timings of a schedule that is on, and enabled: true turns it on. The cap, the minimum gap and quiet hours apply as built; an offset at or past the request's expiry is left out. Fixed at create: a later change in Settings leaves the request as it was. Refused beside delivery: "self".
Show child attributes
enabledboolean
true tracks this request on the schedule (Pro and above on a live deployment: 402 plan_required on reminders.enabled below Pro, nothing created; every plan in the sandbox); false sends it no automatic reminder (one by hand or by API is still allowed).
afterarray of strings
Up to three offsets from the request's creation (10m, 24h, 3d), increasing, each at least the minimum gap after the one before, at most 7 days. Errors use the Settings messages on reminders.after.
expires_ininteger
Seconds the request stays open (default 172800, 48 hours).
link_expires_ininteger
Seconds each link works (default: the whole request). The person can ask for a new link when it expires.
metadataobject
Up to 20 of your own key-value pairs, returned on the request and its webhooks. On a live demo account, allowed_contact names the session's allowed contact: the API sets it from the contact, and a request with no contact (the QR code) may name an open one, so the session's end deletes the photos.
reference_addressesarray of objects
Every plan: addresses to compare each shot with (one of each kind, other up to two, five in all), each as an address or as a location, never both. A claim session with no loss reference takes the claim's stored loss location. The text and the points are sealed and deleted with the images. An address is geocoded from its postal code, city, region and country (never the street line) where the server has a geocoder; reference_addresses[].geocode on the request says whether it has a point.
Show child attributes
kindenumRequired
What the address is. One of loss, person, business, shipping, other.
labelstring | null
Your label for it.
addressobject
A postal address.
Show child attributes
line1stringRequired
The street line.
line2string | null
A second line.
citystringRequired
The city.
regionstring | null
The ISO 3166-2 subdivision code (OH or US-OH).
postal_codestring | null
The postal code.
countrystringRequired
ISO 3166-1 alpha-2.
locationobject
Coordinates (no geocoder needed).
Show child attributes
latnumberRequired
Latitude.
lngnumberRequired
Longitude.
customer_termsboolean
true when your own screens ask the person to accept the terms: the capture calls then take terms_accepted. Without it terms_accepted is 400 and the person agrees on the release sheet.
localestring
The capture release's language. en only for now; anything else is 400 release_locale_unsupported.
require_tierenum
any or hardware (default: your account's routing setting, else any). hardware turns the browser off: the capture runs in an app (your app, the Provenance app or its App Clip), so a destination in the order must be ready (400 with each destination's availability otherwise) and video items are refused. A phone that can't give hardware proof still captures, and the result says the requirement was unmet. One of any, hardware.
routingobject
Growth and up: where this request's link opens, over your account setting. On Free or Pro a body with routing is 402 plan_required (param: routing) and nothing is created.
Show child attributes
orderarray of enums
The destinations that are on, first choice first. Leave web out to turn the browser off.
store_listingobject
Whose store listing each platform opens.
Show child attributes
iosenum
The App Store listing. One of provenance, company.
androidenum
The Google Play listing. One of provenance, company.

Returns

Any The capture request.

HTTP operation

POST /v1/attest/capture_requests: Create a capture request

Errors

Example

const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/attest/capture_requests`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x", "Content-Type": "application/json" },
  body: JSON.stringify({
    "case_id": "CLM-DOCS-CAPTURE",
    "items": [
      {
        "type": "selfie",
        "label": "Your face"
      },
      {
        "type": "id_document",
        "label": "Driver's license",
        "instructions": "Lay it flat on a dark surface."
      },
      {
        "type": "video",
        "label": "Walk around the car",
        "max_duration_s": 30,
        "min_duration_s": 5
      },
      {
        "type": "photo",
        "label": "Capture images of the damage for your claim",
        "until_done": true
      }
    ],
    "contact": {
      "name": "Pat Rivera",
      "phone": "+14155550123",
      "email": "pat@example.com"
    },
    "channels": [
      "app_notification",
      "email",
      "text"
    ],
    "reminders": {
      "enabled": true,
      "after": [
        "24h",
        "36h"
      ]
    },
    "metadata": {
      "policy": "HB-4471"
    }
  }),
})).json();

Was this page helpful? Send us feedback

LLM? Read llms.txt.