SDK reference · Node SDK

prov.attest.devices.revoke

prov.attest.devices.revoke in Node SDK. Revokes a device in your key's carrier.

Signature

prov.attest.devices.revoke(deviceId: string, params: RevokeParams): Promise<DeviceRecord>

Parameters

deviceIdstringRequired
paramsRevokeParamsRequired

Request fields

Idempotency-Keystringheader
Retry a create safely: the same key + request returns the stored response (24 h, per caller).
idstringpathRequired
The device's ID.
reasonstringRequired
Why the device is revoked.

Returns

Promise<DeviceRecord> The device, now revoked.

HTTP operation

POST /v1/attest/devices/{id}/revoke: Revoke your device

Errors

Example

const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/attest/devices`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x", "Content-Type": "application/json" },
  body: JSON.stringify({ "platform": "ios" }),
})).json();
const deviceId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/attest/devices/${deviceId}/revoke`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x", "Content-Type": "application/json" },
  body: JSON.stringify({ "reason": "Phone reported lost" }),
})).json();

Was this page helpful? Send us feedback

LLM? Read llms.txt.