SDK reference · Node SDK

prov.mandate.grants.list

prov.mandate.grants.list in Node SDK. List this account's mandates (each with current remainingBudget).

Signature

prov.mandate.grants.list(params?: { sort?: "created" | "-created" | "spent" | "-spent" | "ends" | "-ends" }): Promise<Grant[]>

Parameters

params{ sort?: "created" | "-created" | "spent" | "-spent" | "ends" | "-ends" }

Request fields

qstringquery
Search text. Matches when the grant's ID, its agent's ID, its agent session, its purpose or its run's ID contains it, ignoring case. At most 200 characters.
statusarray of enumsquery
Only grants in these statuses. One value, or several separated by commas.
agent_idstringquery
Only grants this registered agent holds.
sortenumquery
The order of the list: created, spent (this budget window) or ends (when the grant expires), with - in front for descending. Newest first when omitted. A grant with no budget sorts last by spent. A next_cursor carries its order; pass it back with the same sort. One of created, -created, spent, -spent, ends, -ends.

Returns

Promise<Grant[]> The account's mandates, each with its remaining budget.

HTTP operation

GET /v1/mandate/grants: List mandates

Errors

Example

const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();

Was this page helpful? Send us feedback

LLM? Read llms.txt.