SDK reference · Python SDK

prov.mandate.revocations.create

prov.mandate.revocations.create in Python SDK.

Signature

prov.mandate.revocations.create(intent_token: Optional[str] = …, jti: Optional[str] = …, agent_session_id: Optional[str] = …, device_id: Optional[str] = …, reason: Optional[str] = …) -> Any

Parameters

intent_tokenOptional[str]
jtiOptional[str]
agent_session_idOptional[str]
device_idOptional[str]
reasonOptional[str]

Request fields

Idempotency-Keystringheader
Retry a create safely: the same key + request returns the stored response (24 h, per caller).
intent_tokenstring
The intent token from authorize.
jtistring
The intent token's ID.
agent_session_idstring
The agent session the token was minted for.
device_idstring
The capture or approving device's ID.
reasonstring
The reason given or recorded.

Returns

Any The existing revocation, when it was already revoked.

HTTP operation

POST /v1/mandate/revocations: Revoke tokens

Errors

Example

const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/intents`, {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.PROVENANCE_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({
    "action_description": "Pay invoice INV-2041",
    "agent_session_id": "sess_reference_revoke",
    "device_id": "dev_00000000000000000000000000000001"
  }),
})).json();
const intentToken = step1.intent_token;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/revocations`, {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.PROVENANCE_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({
    "intent_token": intentToken,
    "reason": "cancelled by the requester"
  }),
})).json();

Was this page helpful? Send us feedback

LLM? Read llms.txt.