SDK reference · Python SDK

prov.mandate.network.withdraw_report

prov.mandate.network.withdraw_report in Python SDK.

Signature

prov.mandate.network.withdraw_report(report_id: str) -> Any

Parameters

report_idstrRequired

Request fields

idstringpathRequired
The report's ID (nrp_…).

Returns

Any The withdrawn report.

HTTP operation

DELETE /v1/authorize/agent_reports/{id}: Withdraw a report

Errors

Example

const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/agents`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "name": "Cartwise" }),
})).json();
const agentId = step1.id;
const step2 = 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": "Buy 2 linen notebooks: $38.00 at Larkspur Paper",
    "action_payload": {
      "amount": 38,
      "currency": "USD"
    },
    "agent_session_id": "sess_report_2",
    "device_id": "dev_00000000000000000000000000000001",
    "agent_id": agentId
  }),
})).json();
const step3 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/assessments?session=sess_report_2&limit=1`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
const decisionId = step3.data[0].id;
const step4 = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/agent_reports`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "decision_id": decisionId,
    "kind": "fraud",
    "occurred_at": "2026-10-26T19:00:00.000Z"
  }),
})).json();
const reportId = step4.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/agent_reports/${reportId}`, {
  method: "DELETE",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();

Was this page helpful? Send us feedback

LLM? Read llms.txt.