SDK reference · Node SDK
prov.attest.captureRequests.create
prov.attest.captureRequests.create in Node SDK. Create a capture request and send its link (201).
Signature
prov.attest.captureRequests.create(params: CreateCaptureRequestParams): Promise<CaptureRequest>Parameters
paramsCreateCaptureRequestParamsRequired
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 ofid,claim. accepted_documentsarray of enumsidsessions: the document kinds you accept (defaultpassport,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.photosobjectclaimsessions: how many photos (default 1 to 20), oruntil_donefor 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.
videosobjectclaimsessions: 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_idandstatus; 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 enumsid_documentonly:["front"]or["front", "back"](the default).max_duration_sintegervideoonly: the longest recording in seconds (default 30).min_duration_sintegervideoonly: the shortest recording in seconds.until_donebooleanphotoonly: open-ended. The person adds photos until they tap Done; the link shows no count. The item takes at least one photo and at mostmax_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. Anamesent 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 onRequestContact.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
httpslink to how they agreed. Stored, never fetched.
deliveryenumsend: Provenance sends the request on the channelschannelsallows.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 (sendout of the box). With a default of link only, a request that gives a contact must saysend. One ofsend,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),emailandtext. 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 withtext, the email beside either only withemail). Each message is reported on its own indeliveries. A list that can reach none of the contacts is refused, as aresmsandapp_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_requiredon Free, nothing created or saved); in the sandbox it works on every plan. Refused besidedelivery: "self".Show child attributes
enabledbooleanfalsesends no follow-up text.whenenumnot_opened(the default) ornot_finished. One ofnot_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_invalidonfollow_up_text.after_minutes); a longer wait from your default is kept, and the text is skipped asexpiredif 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_requestfor a capture request,checkout_approvalfor a cart approval (and an assessment's challenge or a guest confirmation),approvalfor a routed approval. Keys left out take your account's saved values, as aPUTto Settings does:afteralone changes the timings of a schedule that is on, andenabled: trueturns 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 besidedelivery: "self".Show child attributes
enabledbooleantruetracks this request on the schedule (Pro and above on a live deployment:402 plan_requiredonreminders.enabledbelow Pro, nothing created; every plan in the sandbox);falsesends 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 onreminders.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_contactnames 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,
otherup to two, five in all), each as anaddressor as alocation, never both. A claim session with nolossreference 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[].geocodeon 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 (
OHorUS-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_termsbooleantruewhen your own screens ask the person to accept the terms: the capture calls then taketerms_accepted. Without itterms_acceptedis 400 and the person agrees on the release sheet.localestring- The capture release's language.
enonly for now; anything else is 400release_locale_unsupported. require_tierenumanyorhardware(default: your account's routing setting, elseany).hardwareturns 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) andvideoitems are refused. A phone that can't give hardware proof still captures, and the result says the requirement was unmet. One ofany,hardware.routingobject- Growth and up: where this request's link opens, over your account setting. On Free or Pro a body with
routingis 402plan_required(param: routing) and nothing is created.Show child attributes
orderarray of enums- The destinations that are on, first choice first. Leave
webout 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
Promise<CaptureRequest> The capture request.
HTTP operation
POST /v1/attest/capture_requests: Create a capture request
Errors
- attest_not_set_up
- authentication_required
- capture_contact_blocked
- capture_type_unavailable
- idempotency_key_reused
- insufficient_scope
- invalid_json
- parameter_invalid
- parameter_missing
- rate_limit_exceeded
- release_locale_unsupported
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();import os
import httpx
api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/attest/capture_requests", headers={"Authorization": "Bearer prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x"}, json={
"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()