SDK reference · Python SDK
prov.mandate.grants.list_proposals
prov.mandate.grants.list_proposals in Python SDK. This account's proposals, newest first.
Signature
prov.mandate.grants.list_proposals(status: Optional[str] = …, parent_grant_id: Optional[str] = …, limit: Optional[int] = …, cursor: Optional[str] = …) -> AnyParameters
statusOptional[str]parent_grant_idOptional[str]limitOptional[int]cursorOptional[str]
Request fields
statusenumquery- Only proposals in this state. One of
pending,approved,declined,expired,stale,superseded. parent_grant_idstringquery- Only proposals for this mandate.
limitintegerquery- Page size, 1–100 (default 20). Outside the range → 400 parameter_invalid.
cursorstringquery- Opaque; pass a response's
next_cursorback to get the next page.
Returns
Any The proposals.
HTTP operation
GET /v1/mandate/delegation_proposals: List delegation proposals
Errors
Example
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/agents`, {
method: "POST",
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
body: JSON.stringify({ "name": "Scout Flights", "category": "shopping_agent" }),
})).json();
const flightsId = step1.id;
const step2 = 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": "Book Maya's Lisbon trip",
"constraints": {
"budget_amount": 2400,
"budget_window": "month",
"currency": "USD",
"expires_at": "2027-12-31T23:59:59Z"
}
}),
})).json();
const mandateId = step2.id;
const step3 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants/${mandateId}/delegation_proposals`, {
method: "POST",
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
body: JSON.stringify({
"notify": false,
"children": [
{
"agent_id": flightsId,
"purpose": "Book the flights",
"constraints": {
"budget_amount": 900
}
}
]
}),
})).json();
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/delegation_proposals?status=pending&limit=1`, {
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();import os
import httpx
api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/agents", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
"name": "Scout Flights",
"category": "shopping_agent"
}).json()
flights_id = step1["id"]
step2 = httpx.post(f"{api}/v1/mandate/grants", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
"device_id": "dev_00000000000000000000000000000001",
"purpose": "Book Maya's Lisbon trip",
"constraints": {
"budget_amount": 2400,
"budget_window": "month",
"currency": "USD",
"expires_at": "2027-12-31T23:59:59Z"
}
}).json()
mandate_id = step2["id"]
step3 = httpx.post(f"{api}/v1/mandate/grants/{mandate_id}/delegation_proposals", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
"notify": False,
"children": [
{
"agent_id": flights_id,
"purpose": "Book the flights",
"constraints": {
"budget_amount": 900
}
}
]
}).json()
data = httpx.get(f"{api}/v1/mandate/delegation_proposals?status=pending&limit=1", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()