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
paramsListDecisionsParamsopts{ 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.
automaticenumquerytrue: only decisions anauto_approveclause approved;false: only the others. One oftrue,false.run_idstringquery- Only one run's rows (
run_…): its agents' authorize, delegate and verify decisions and its halts. cursorstringquery- The
next_cursorfrom 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();import os
import httpx
api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/intents", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
"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()
intent_token = step1["intent_token"]
step2 = httpx.post(f"{api}/v1/mandate/assessments", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
"intent_token": intent_token,
"action_description": "Pay invoice INV-2041: $1,850.00 to Brindlecote Supplies",
"action_payload": {
"amount": 18500,
"payee": "acct_attacker"
}
}).json()
step3 = httpx.get(f"{api}/v1/mandate/assessments?session=sess_ledger_1&limit=1", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
decision_id = step3["data"][0]["id"]
data = httpx.get(f"{api}/v1/mandate/assessments?session=sess_ledger_1&limit=1", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()