View as Markdown

Embeds · Guide

Show results, send requests

Your staff can see what a capture request or an agent checkout came back with, and send a new capture request, without leaving the tools they work in. Each view comes four ways: an element in your web admin, a page Provenance hosts, the console, or your own screens on the API. This guide puts them side by side and shows the server call behind each one, with the SDKs.

Before you begin: a secret key with the view's scope: attest for a capture result or the request composer, authorize for a checkout result. The embed and the hosted page need Pro or the Free trial; the console has the same views on every plan.

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

1. Pick a way for each screen

EmbedHosted pageThe consoleYour own UI on the API
WhereYour web adminA phone, an email to a manager, a reviewer without an admin seatEvery account's own pagesAnywhere
PlanPro, or the Free trialPro, or the Free trialEvery planEach API's own plan
Your server callsembed.createTokenembed.createLinkNothingThe reads in step 5
Your page doesDrops a tag and gives it getToken()Opens a URLNothingDraws the rows, checks the signed result, fetches file links

The views are the same on every surface: one line per row, a dot and a word for status, and the same outcome words.

ViewElementObjectScope
Capture result<provenance-capture-result>A capture request (capr_…)attest
Request composer<provenance-capture-request>Your case referenceattest
Checkout result<provenance-checkout-result>A checkout assessment (cas_…) or cart approval (coap_…)authorize
Run result<provenance-run-result>An agent run (run_…)mandate
Proposals<provenance-counter-offers>An agent run's proposals from outside agents (run_…), read onlymandate
Capture list<provenance-capture-list>Your capture requests, filteredattest
Checkout list<provenance-checkout-list>Your store's checkouts, filteredauthorize
Chargeback protection<provenance-chargeback-protection>Your store's Chargeback protection view, read onlyauthorize
Run list<provenance-run-list>Your agent runs, filteredmandate
Traffic list<provenance-traffic-list>The visits Identify assessed, filteredidentify
Traffic result<provenance-traffic-result>A traffic assessment (tas_…)identify

2. Install the SDK on your server

The mint calls run on your server, with your secret key. It never reaches the browser.

This package isn't on npm yet. This package isn't on PyPI yet. Until then, every request in these docs runs over HTTP against the sandbox.

With access to the private Provenance repository, which your Provenance contact grants, install from it:

git clone https://github.com/michaelnbane-jpg/provenance.git provenance
cd provenance && pnpm install && pnpm build
node scripts/check-publishable.mjs --out ../provenance-packs
cd ../your-project
npm install ../provenance-packs/provenanceauth-sdk-1.0.0.tgz
git clone https://github.com/michaelnbane-jpg/provenance.git provenance
pip install ./provenance/python/sdk

For Go, the embed calls are in go.provenanceauth.com/verify (Embed.CreateToken and Embed.CreateLink), with only the standard library.

3. Mint a session for an embed

POST /v1/embed/tokens mints a session of up to 15 minutes for one element and one object. This capture request is the one the next steps show:

curl -s -X POST $PROVENANCE_API/v1/attest/capture_requests \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "case_id": "LMB-20418", "delivery": "self", "session_type": "id" }' > request.json
export CAPTURE_REQUEST_ID=$(jq -r '.id' request.json)
curl -s -X POST $PROVENANCE_API/v1/embed/tokens \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d "{ \"widget\": \"capture_result\", \"object_id\": \"$CAPTURE_REQUEST_ID\", \"show\": [\"case_id\"] }"
{
  "object": "embed_token",
  "embed_token": "emb_…",
  "widget": "capture_result",
  "mode": "view",
  "show": ["case_id"],
  "expires_at": "2026-11-16T20:15:00.000Z"
}

Each widget's body is typed in the SDKs, so a composer session without its author or options doesn't compile in TypeScript:

WidgetobjectIdAlso takes
capture_resultA capture request (capr_…)show: case_id, metadata
checkout_resultA checkout assessment (cas_…) or cart approval (coap_…)Nothing else
run_resultAn agent run (run_…)Nothing else
traffic_resultA traffic assessment (tas_…)Nothing else
capture_requestYour case reference (1 to 200 characters)author and request, both required (the composer)

In the Node SDK a composer session's options are camelCase, as everywhere else in it (maxSends for max_sends), and reach the API in its own shape.

4. Give the element its session

Drop the element in your admin page and give it a getToken() that calls your route. It calls it on load, and again a minute before each session ends, so a page left open keeps working:

npm install @provenance/embed
<provenance-capture-result base-url="https://sandbox-api.provenanceauth.com" publishable-key="prv_pub_…">
  <div slot="actions"><!-- your own next step --></div>
</provenance-capture-result>
<script type="module">
  import "@provenance/embed";
  const el = document.querySelector("provenance-capture-result");
  el.getToken = async () => (await (await fetch(`/admin/provenance/session?request=${requestId}`)).json()).token;
</script>

The actions slot holds your own next step: your card, your labels, your handlers. Decide what it suggests from the element's pv:result event, and confirm on your server from the webhook. Each element's page has the full recipe: capture result, request composer, checkout result, run result, traffic result. A list opens a selected row in its own panel, or, with detail="none", drives a result element whose for is the list's id (capture list, checkout list, run list, traffic list).

When there's no web admin to drop a tag into, mint a link instead. POST /v1/embed/links takes the same body, plus session_ttl, and returns a URL that opens once:

curl -s -X POST $PROVENANCE_API/v1/embed/links \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d "{ \"widget\": \"capture_result\", \"object_id\": \"$CAPTURE_REQUEST_ID\", \"session_ttl\": 600 }"
{
  "object": "embed_link",
  "url": "…/r?t=embl_…",
  "widget": "capture_result",
  "mode": "view",
  "session_ttl": 600
}

Send the url by email or text, open it on a phone, or open it in your app's in-app browser with openHostedPage from @provenanceauth/react-native. See the hosted page.

6. Build your own on the API

Your own screens read the same facts from your server. Each element's page names the field behind every row it draws:

ViewReadRows
Capture resultGET /v1/attest/capture_requests/{id}The capture result's rows
Capture result, the signed proofGET /v1/attest/capture_requests/{id}/resultVerify token against jwks_url on your server
Capture result, the photosGET /v1/attest/capture_requests/{id}/filesShort-lived file links
Capture result, the contextGET /v1/attest/capture_requests/{id}/contextThe Context rows
Checkout resultGET /v1/authorize/checkout_assessments/{id} and GET /v1/authorize/checkout_approvals/{id}The checkout result's rows
Run resultGET /v1/mandate/runs/{id} and GET /v1/mandate/assessments with run_idThe run result's rows
Capture listGET /v1/attest/capture_requests with its filters and created_gte / created_lteThe capture list's rows
Checkout listGET /v1/authorize/checkout_assessments with outcome, approval_status, order_id and the created rangeThe checkout list's rows
Run listGET /v1/mandate/runs with status, q and the created rangeThe run list's rows
Traffic listGET /v1/identify/assessments with outcome, class, signed, bot_likelihood and the created rangeThe traffic list's rows
Traffic resultGET /v1/identify/assessments/{id}The traffic result's rows
Request composerPOST /v1/attest/capture_requestsYour own form, with the consent wording your account's mode needs

With your own UI you map the fields, check the signed result, fetch file links and track deliveries yourself. The elements do that for you.

Errors you might see

ErrorWhyWhat to do
403 insufficient_scopeThe key lacks the view's scopeUse a key with attest (capture), authorize (checkout) or mandate (run). The SDKs raise it as a permission error.
400 embed_object_kind_mismatchThe ID is another kind of objectPass a capr_… ID for a capture result, a cas_… or coap_… ID for a checkout result, a run_… ID for a run result.
402 plan_requiredEmbeds and hosted pages are Pro and upUpgrade, or use the console's views on any plan.
401 embed_token_invalidThe session endedGive the element getToken(), or mint a new link.

See also