SDK reference · Python SDK

prov.mandate.runs.halt

prov.mandate.runs.halt in Python SDK. Every member stops on its next verify; the run's mandates are revoked.

Signature

prov.mandate.runs.halt(run_id: str, reason: str) -> Any

Parameters

run_idstrRequired
reasonstrRequired

Request fields

Idempotency-Keystringheader
Retry a create safely: the same key + request returns the stored response (24 h, per caller).
idstringpathRequired
The run's ID.
reasonstringRequired
Why you're halting it (on the ledger and the mandate.run.halted event).

Returns

Any The halted run, with how many mandates and sessions the halt stopped.

HTTP operation

POST /v1/mandate/runs/{id}/pause: Pause a run

Errors

Example

const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/runs`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "name": "Restock printer paper" }),
})).json();
const runId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/runs/${runId}/pause`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "reason": "The paper subagent kept trying a store it wasn't allowed to use"
  }),
})).json();

Was this page helpful? Send us feedback

LLM? Read llms.txt.