SDK reference · Python SDK

prov.mandate.runs.create

prov.mandate.runs.create in Python SDK.

Signature

prov.mandate.runs.create(name: Optional[str] = …, root_grant_id: Optional[str] = …) -> Any

Parameters

nameOptional[str]
root_grant_idOptional[str]

Request fields

Idempotency-Keystringheader
Retry a create safely: the same key + request returns the stored response (24 h, per caller).
namestring
A name for the run.
root_grant_idstring
The person's mandate the team works under.

Returns

Any The run.

HTTP operation

POST /v1/mandate/runs: Start a run

Errors

Example

const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Restock printer paper for the office",
    "constraints": {
      "max_amount": 80,
      "budget_amount": 200,
      "budget_window": "month",
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }),
})).json();
const mandateId = step1.id;
const data = 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", "root_grant_id": mandateId }),
})).json();

Was this page helpful? Send us feedback

LLM? Read llms.txt.