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) -> AnyParameters
run_idstrRequiredreasonstrRequired
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.haltedevent).
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
- authentication_required
- insufficient_scope
- insufficient_role
- invalid_json
- parameter_invalid
- parameter_missing
- rate_limit_exceeded
- resource_missing
- run_state_invalid
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();import os
import httpx
api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/runs", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
"name": "Restock printer paper"
}).json()
run_id = step1["id"]
data = httpx.post(f"{api}/v1/mandate/runs/{run_id}/pause", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
"reason": "The paper subagent kept trying a store it wasn't allowed to use"
}).json()