# prov.mandate.deviceEnrolments.revoke

prov.mandate.deviceEnrolments.revoke in Node SDK. `POST /v1/mandate/device_enrollments/:id/revoke`: the link stops working and the device it enrolled is revoked.

## Signature

```ts
prov.mandate.deviceEnrolments.revoke(id: string): Promise<DeviceEnrollment>
```

## Parameters

- `id` (string)

## Returns

`Promise<DeviceEnrollment>`

## HTTP operation

[`POST /v1/mandate/device_enrollments/{id}/revoke`](https://provenanceauth.com/docs/api/grants.md#post-v1-mandate-device-enrollments-id-revoke): Revoke a device enrolment

## Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)

## Example

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/device_enrollments`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "display_name": "Maya", "reference": "ds_session_revoke" }),
})).json();
const enrolmentId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/device_enrollments/${enrolmentId}/revoke`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/device_enrollments", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "display_name": "Maya",
    "reference": "ds_session_revoke"
}).json()
enrollment_id = step1["id"]
data = httpx.post(f"{api}/v1/mandate/device_enrollments/{enrollment_id}/revoke", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```
