SDK reference · Node SDK

prov.embed.createLink

prov.embed.createLink in Node SDK. Mint a hosted page link (201): the same body and checks as createToken, Pro and up.

Signature

prov.embed.createLink(params: CreateEmbedLinkParams): Promise<EmbedLink>

Parameters

paramsCreateEmbedLinkParamsRequired

Request fields

Idempotency-Keystringheader
Retry a create safely: the same key + request returns the stored response (24 h, per caller).
widgetenumRequired
The page's element. capture_result and capture_request need a key with the attest scope; checkout_result needs authorize; run_result needs mandate; traffic_result needs identify; rules needs the scope of its kind's product (authorize for checkout, mandate for intent, attest for capture). Another widget is 400 parameter_invalid. One of capture_result, capture_request, checkout_result, run_result, rules, traffic_result.
object_idstringRequired
As for the token: a capture request (capr_…) for capture_result, a checkout assessment (cas_…) or cart approval (coap_…) for checkout_result, an agent run (run_…) for run_result, a traffic assessment (tas_…) for traffic_result, your case reference for capture_request, the kind of rules (checkout, intent, capture or mandate_limits) for rules.
modestring
view for a result view, send for the composer (the defaults); rules takes view (the default), edit or publish (with rules.saves: publish).
rulesobject
rules only, required: everything a rules session may show and touch, passed on every mint (nothing is saved between sessions). Strict: an unknown key is 400 parameter_invalid, so a typo never widens a session. At most 16 KB. The response echoes it as stored, every default written out.
Show child attributes
showarray of objectsRequired
The rules the session sees, by id. They show in the policy's own order; rules not listed stay hidden.
Show child attributes
rule_idstringRequired
A rule of the kind's live policy (else 400 rules_embed_rule_missing). For mandate_limits, a row: cap, budget, allowed_mcc, named_merchants, blocked_mcc, blocked_merchants, refuse_over_cap, refuse_over_share or ask_over_cap.
templatestring
A template id of the kind the row reads as.
fieldsarray of objects
The values that are blanks, each a path into the rule (when.0.value) with its bounds.
Show child attributes
pathstringRequired
A condition's value: when.N.value, when.items.N.value or when.items.N.conditions.M.value. For mandate_limits: amount on cap, allocation (shared, reserved) and at_limit (stop, ask, continue) on budget, value on a margin row (with advanced, its unit, a percentage or a fixed amount, is offered beside it; the bounds bound a percentage).
minnumber
A number blank's lowest value.
maxnumber
A number blank's highest value.
valuesarray of strings
The words a word blank may take (the field's own values).
can_turn_offboolean
Whether the session may turn the rule off (not by default).
lockedboolean
Shown read-only: no blanks, no turning off.
add_from_templatesarray of strings
Template ids of the kind the session may add (none by default).
advancedboolean
Whether an edit or publish session may open the Advanced view (not by default): whole rules from the kind's catalog (GET /v1/embed/rules/catalog), a shown rule replaced or a new one added. On mandate_limits, a margin row's unit: a fixed amount instead of a percentage. On every plan.
visibilityenum
Which rules the session shows besides those in show: every rule of the policy (all, the default with manage; with full control each can be changed like a listed rule, without it they're read-only) or only the rules the session itself added (session, the default without manage). Not on mandate_limits. One of all, session.
manageboolean
Full control (not by default): in an edit or publish session, every shown rule that isn't locked can be moved (order), turned off, deleted (remove), duplicated (copy_of) and have every value edited; with advanced, its conditions and outcome too, the default rows included. A listed rule missing from the policy is left out of the session rather than refused. Not on mandate_limits.
advanced_fieldsarray of strings
With advanced: the catalog fields the Advanced view's field picker offers, by key (order.amount, agent.bot_likelihood_score; the keys of GET /v1/embed/rules/catalog), each listed once. A new condition in the session reads one of them; a rule it edits keeps the fields it already reads (anything else is 400 rules_embed_out_of_scope). Absent: every field of the kind's catalog. Not on mandate_limits.
savesenum
draft (the default): a save waits to be published. publish needs mode publish. One of draft, publish.
draft_groupstring | null
Sandbox only (400 in live): an opaque label up to 64 characters that keeps one group's drafts from another's.
showarray of enums
capture_result only: also show the request's case_id or metadata.
authorobject
capture_request only, required: who will use the page, as you report it.
Show child attributes
idstringRequired
Your reference for the staff member.
display_namestringRequired
Their display name.
requestobject
capture_request only, required: the send options, as on POST /v1/embed/tokens. max_sends counts every send of the page session.
ttlinteger
Seconds the link may be opened in (≤ 900, default 900).
session_ttlinteger
Seconds the opened page works for (60 to 3600, default 3600).

Returns

Promise<EmbedLink> The link: open it on a phone, send it by email or text, or open it in an in-app browser.

HTTP operation

POST /v1/embed/links: Create a hosted page link

Errors

Example

const step1 = 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": "LMB-20418", "delivery": "self", "session_type": "id" }),
})).json();
const captureRequestId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/embed/links`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x", "Content-Type": "application/json" },
  body: JSON.stringify({
    "widget": "capture_result",
    "object_id": captureRequestId,
    "show": [
      "case_id"
    ]
  }),
})).json();

Was this page helpful? Send us feedback

LLM? Read llms.txt.