SDK reference · Node SDK

prov.mandate.runs.halt

prov.mandate.runs.halt in Node SDK. Halt the run: every member stops on its next verify, and its mandates are revoked.

Signature

prov.mandate.runs.halt(runId: string, params: { reason: string }): Promise<Run & Record<string, unknown>>

Parameters

runIdstringRequired
params{ reason: string }Required

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

Promise<Run & Record<string, unknown>> 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.