SDK reference · Node SDK
prov.mandate.revocations.create
prov.mandate.revocations.create in Node SDK.
Signature
prov.mandate.revocations.create(params: RevokeParams): Promise<IntentRevocation>Parameters
paramsRevokeParamsRequired
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
Promise<IntentRevocation> The existing revocation, when it was already revoked.
HTTP operation
POST /v1/mandate/revocations: Revoke tokens
Errors
- authentication_required
- invalid_json
- parameter_invalid
- parameter_missing
- rate_limit_exceeded
- revoke_forbidden
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();import os
import httpx
api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/intents", headers={"Authorization": f"Bearer {os.environ['PROVENANCE_KEY']}"}, json={
"action_description": "Pay invoice INV-2041",
"agent_session_id": "sess_reference_revoke",
"device_id": "dev_00000000000000000000000000000001"
}).json()
intent_token = step1["intent_token"]
data = httpx.post(f"{api}/v1/mandate/revocations", headers={"Authorization": f"Bearer {os.environ['PROVENANCE_KEY']}"}, json={
"intent_token": intent_token,
"reason": "cancelled by the requester"
}).json()