# prov.mandate.revocations.create

prov.mandate.revocations.create in Node SDK.

## Signature

```ts
prov.mandate.revocations.create(params: RevokeParams): Promise<IntentRevocation>
```

## Parameters

- `params` (RevokeParams)

## Returns

`Promise<IntentRevocation>`

## HTTP operation

[`POST /v1/mandate/revocations`](https://provenanceauth.com/docs/api/intent-tokens.md#post-v1-mandate-revocations): Revoke tokens

## Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`invalid_json`](https://provenanceauth.com/docs/platform/errors.md#invalid_json)
- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`parameter_missing`](https://provenanceauth.com/docs/platform/errors.md#parameter_missing)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)
- [`revoke_forbidden`](https://provenanceauth.com/docs/platform/errors.md#revoke_forbidden)

## Example

**Node**

```ts
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();
```

**Python**

```python
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()
```
