SDK reference · Node SDK

prov.mandate.assessments.list

prov.mandate.assessments.list in Node SDK.

Signature

prov.mandate.assessments.list(params?: ListDecisionsParams, opts?: { raw?: boolean }): Promise<ListResponse<DecisionRecord> | Record<string, unknown>>

Parameters

paramsListDecisionsParams
opts{ raw?: boolean }

Request fields

created_gtetimestampquery
The start of the time window, as an ISO 8601 time.
created_ltetimestampquery
The end of the time window, as an ISO 8601 time.
resultarray of enumsquery
Only decisions with these results. One value, or several separated by commas.
qstringquery
Search text. Matches when the decision's ID, the reason, the intent token's ID, the agent session or the agent's ID contains it, ignoring case. At most 200 characters.
agent_idstringquery
Only decisions made for this registered agent.
reasonstringquery
The reason given or recorded.
jtistringquery
The intent token's ID.
sessionstringquery
Only decisions for this agent session.
automaticenumquery
true: only decisions an auto_approve clause approved; false: only the others. One of true, false.
run_idstringquery
Only one run's rows (run_…): its agents' authorize, delegate and verify decisions and its halts.
cursorstringquery
The next_cursor from the previous page.
limitintegerquery
The most items to return, from 1 to 100. The default is 20.

Returns

Promise<ListResponse<DecisionRecord> | Record<string, unknown>> The decisions, newest first.

HTTP operation

GET /v1/mandate/assessments: List mandate assessments

Errors

Example

const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/intents`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "action_description": "Pay invoice INV-2041: $1,850.00 to Brindlecote Supplies",
    "action_payload": {
      "amount": 1850,
      "payee": "acct_brindlecote_supplies"
    },
    "agent_session_id": "sess_ledger_1",
    "device_id": "dev_00000000000000000000000000000001"
  }),
})).json();
const intentToken = step1.intent_token;
const step2 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/assessments`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "intent_token": intentToken,
    "action_description": "Pay invoice INV-2041: $1,850.00 to Brindlecote Supplies",
    "action_payload": {
      "amount": 18500,
      "payee": "acct_attacker"
    }
  }),
})).json();
const step3 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/assessments?session=sess_ledger_1&limit=1`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
const decisionId = step3.data[0].id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/assessments?session=sess_ledger_1&limit=1`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();

Was this page helpful? Send us feedback

LLM? Read llms.txt.