# Devices

Enrolling and revoking capture devices, with their hardware tier.

Related guide: [Device registry](https://provenanceauth.com/docs/attest/concepts/device-registry.md)

## Endpoints

- `POST /v1/attest/devices`: [Enroll your device](#post-v1-attest-devices)
- `POST /v1/attest/devices/enrollment_challenge`: [Create an enrollment challenge for your device](#post-v1-attest-devices-enrollment-challenge)
- `GET /v1/attest/devices`: [List your devices](#get-v1-attest-devices)
- `POST /v1/attest/devices/{id}/revoke`: [Revoke your device](#post-v1-attest-devices-id-revoke)

## The device object

### Attributes

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | Unique identifier for the object. |
| `object` | enum | yes | The type of object. One of `device`. |
| `carrier_id` | string \| null | yes | The carrier the data belongs to. |
| `cert_pem` | string | yes | The device certificate, in PEM. |
| `environment` | string | yes | `sandbox` or `live`. |
| `enrolled_at` | string | yes | When the device was enrolled. |
| `revoked_at` | string \| null | yes | When it was revoked; null if it isn't. |
| `revoke_reason` | string \| null | yes | Why the device was revoked. |
| `hardware_tier` | string | yes | The verified hardware tier: `sep`, `strongbox`, `tee`, `software` or `simulated`. |
| `device_integrity_evidence` | object \| null | yes | The integrity evidence sent at enrollment, with `verification` (`method`, `tier_verified`, `cert_bound`): what the server verified. A verified, bound `sep`, `strongbox` or `tee` device's certificate counts as known in verifications. On Android with integrity checks on, `verification.status_list` records Google's attestation status list: `state` is `checked`, `unavailable` (enrolled unverified) or `revoked` (a later check found a listed certificate, with its `serial`, `status` and `reason`; `tier_verified` is then false). |
| `webauthn_credential` | any \| null | yes | The device's registered passkey, when it has one. |

### Example

```json
{
  "id": "dev_6YM8DF2RFX9ZM9BADA404Y04K4",
  "object": "device",
  "carrier_id": "car_000000000000000000000000000000c5",
  "cert_pem": "-----BEGIN CERTIFICATE-----\nMIIBoTCCAUagAwIBAgIUHRJwrnieSAJaG9lNeu4Rs+NAJ+IwCgYIKoZIzj0EAwIw\nNjE0MDIGA1UEAwwrZGV2aWNlLWRlYTIxYWYxLTYxZmQtNGZlOC05NWE5LWFhMjAw\nOWUwMTI2NDAeFw0yNjExMTgxNTI0NTdaFw0yODExMTcxNTI0NTdaMDYxNDAyBgNV\nBAMMK2RldmljZS1kZWEyMWFmMS02MWZkLTRmZTgtOTVhOS1hYTIwMDllMDEyNjQw\nWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQgFiH/dc+ZNH52+RXVxiO8akKOJPaP\nef5mF8zU0VfhJRYQWRwpa5qr68xnkEthndAn+wT97hC8sDAWEqpaUEPFozIwMDAd\nBgNVHQ4EFgQUvf4P7BtL1PHnQk8lUY9lVDnhakEwDwYDVR0TAQH/BAUwAwEB/zAK\nBggqhkjOPQQDAgNJADBGAiEAh8cuI1yuuS9+ckLN/d7YaQPZ/oQSASVHOpho8D7t\n2fwCIQDFCCz2LYuOYZzKFpAkmLBMXD+EfKnJD2br0HUFG4BrzQ==\n-----END CERTIFICATE-----\n",
  "environment": "sandbox",
  "enrolled_at": "2026-11-18T15:24:57.272Z",
  "revoked_at": null,
  "revoke_reason": null,
  "hardware_tier": "software",
  "device_integrity_evidence": {
    "platform": "ios",
    "verification": {
      "method": "app_attest",
      "tier_verified": false,
      "cert_bound": false
    }
  },
  "webauthn_credential": null
}
```

## Enroll your device

`POST /v1/attest/devices`

Enrolls a phone in your Attest key's own carrier, with the `attest` scope; a `carrier_id` that isn't your key's is refused. Provenance assigns the hardware tier from the phone's evidence, with the same checks as every enrollment. A `device_id` already enrolled is refused. Each enrollment is in your audit log, with the key as the actor.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | no | Retry a create safely: the same key + request returns the stored response (24 h, per caller). |
| `device_id` | body | string | no | The phone's device ID. Leave it out and Provenance makes one. |
| `carrier_id` | body | string | no | Optional. Your key's own carrier; any other is refused. |
| `platform` | body | enum | no | The phone's platform. The tier comes from the evidence, never from this field. One of `ios`, `android`. |
| `cert_pem` | body | string | no | The phone's certificate (PEM). An Android enrollment without it uses the attestation leaf. |
| `key_attestation_chain` | body | array of strings | no | Android. The key attestation chain, leaf first (PEM or base64 DER). |
| `app_attest_object` | body | string | no | iPhone. The App Attest attestation object (base64). |
| `play_integrity_token` | body | string | no | Android. A Play Integrity token, kept as a corroborating signal. |
| `enrollment_challenge` | body | string | no | The challenge from `POST /v1/attest/devices/enrollment_challenge` the evidence was made over. |
| `webauthn_registration` | body | object | no | A passkey registration made over an enrollment challenge. |
| `webauthn_registration.attestation_object` | body | string | yes | The registration's attestation object (base64url). |
| `webauthn_registration.client_data_json` | body | string | yes | The registration's client data JSON (base64url). |
| `webauthn_registration.challenge` | body | string | yes | The enrollment challenge the registration was made over. |

### Returns

The device, with its hardware tier. See [the device object](#object).

### Errors

- [`attest_not_set_up`](https://provenanceauth.com/docs/platform/errors.md#attest_not_set_up)
- [`attestation_key_revoked`](https://provenanceauth.com/docs/platform/errors.md#attestation_key_revoked)
- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`device_already_enrolled`](https://provenanceauth.com/docs/platform/errors.md#device_already_enrolled)
- [`insufficient_scope`](https://provenanceauth.com/docs/platform/errors.md#insufficient_scope)
- [`invalid_json`](https://provenanceauth.com/docs/platform/errors.md#invalid_json)
- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x
curl -X POST "$PROVENANCE_API/v1/attest/devices" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "platform": "ios" }'
```

**Node**

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

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/attest/devices", headers={"Authorization": "Bearer prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x"}, json={
    "platform": "ios"
}).json()
```

### Response 201

```json
{
  "id": "dev_0Q1867BZF99SGTS1PA79RQ6WGA",
  "object": "device",
  "carrier_id": "car_000000000000000000000000000000c5",
  "cert_pem": "-----BEGIN CERTIFICATE-----\nMIIBoDCCAUagAwIBAgIUFJiICPMv0+r0+TghJULb1aa2cDcwCgYIKoZIzj0EAwIw\nNjE0MDIGA1UEAwwrZGV2aWNlLTE3MGEwYzc1LWZkZTktNGU2MS1hYzg2LWNhM2E3\nMTczNzIwYTAeFw0yNjExMTgxMjQ0NTBaFw0yODExMTcxMjQ0NTBaMDYxNDAyBgNV\nBAMMK2RldmljZS0xNzBhMGM3NS1mZGU5LTRlNjEtYWM4Ni1jYTNhNzE3MzcyMGEw\nWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQBhAKC4BNndMCmvfnRqN1EqA4/EVDi\nECMHg5pz95/MTitgexH/L7i2epDCDUSi53rfLYQGhFlT/BRre3LcGlBVozIwMDAd\nBgNVHQ4EFgQUiU+c878k49ASS2/qaaxqHy32pHYwDwYDVR0TAQH/BAUwAwEB/zAK\nBggqhkjOPQQDAgNIADBFAiEA/cQ4s9TQ+ckOxphxeoWLcUwLcuMnRxobm3uZJkvJ\nXKwCIFpXN4Kl834c9++YKWG+NDyuha2WLcYulFxsVLs8xaB8\n-----END CERTIFICATE-----\n",
  "environment": "sandbox",
  "enrolled_at": "2026-11-18T12:44:50.355Z",
  "revoked_at": null,
  "revoke_reason": null,
  "hardware_tier": "software",
  "device_integrity_evidence": {
    "platform": "ios",
    "verification": {
      "method": "app_attest",
      "tier_verified": false,
      "cert_bound": false
    }
  },
  "webauthn_credential": null
}
```

## Create an enrollment challenge for your device

`POST /v1/attest/devices/enrollment_challenge`

Returns a single-use challenge for a phone's key attestation (Android) or App Attest (iPhone), before your backend enrolls the phone with your Attest key. Takes the `attest` scope. A key that isn't on an account with its own Attest carrier gets `attest_not_set_up`.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | no | Retry a create safely: the same key + request returns the stored response (24 h, per caller). |

### Returns

A single-use challenge and when it expires.

### Errors

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

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x
curl -X POST "$PROVENANCE_API/v1/attest/devices/enrollment_challenge" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/attest/devices/enrollment_challenge`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/attest/devices/enrollment_challenge", headers={"Authorization": "Bearer prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x"}).json()
```

### Response 200

```json
{
  "object": "enrollment_challenge",
  "challenge": "yx29t3LV8BwqrKfXMyr-ZxMQ6QnxBg9WZ3xlTthhh7Q",
  "expires_at": "2026-11-18T12:54:12.153Z"
}
```

## List your devices

`GET /v1/attest/devices`

Lists the devices enrolled in your Attest key's carrier, oldest first, with each hardware tier. Another company's devices are never listed. Takes the `attest` scope.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `revoked` | query | boolean | no | `true` for revoked devices only, `false` for active devices only. Leave it out for both. |
| `carrier_id` | query | string | no | Your key's own carrier. Any other carrier is refused with `parameter_invalid`. |
| `limit` | query | integer | no | Page size, 1–100 (default 20). Outside the range → 400 parameter_invalid. |
| `cursor` | query | string | no | Opaque; pass a response's `next_cursor` back to get the next page. |

### Returns

The devices enrolled in your carrier.

### Errors

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

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x
curl -s -X POST "$PROVENANCE_API/v1/attest/devices" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "platform": "ios" }' > /dev/null
curl "$PROVENANCE_API/v1/attest/devices" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
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 data = await (await fetch(`${process.env.PROVENANCE_API}/v1/attest/devices`, {
  headers: { Authorization: "Bearer prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/attest/devices", headers={"Authorization": "Bearer prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x"}, json={
    "platform": "ios"
}).json()
data = httpx.get(f"{api}/v1/attest/devices", headers={"Authorization": "Bearer prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x"}).json()
```

### Response 200

```json
{
  "object": "list",
  "data": [
    {
      "id": "dev_6YM8DF2RFX9ZM9BADA404Y04K4",
      "object": "device",
      "carrier_id": "car_000000000000000000000000000000c5",
      "cert_pem": "-----BEGIN CERTIFICATE-----\nMIIBoTCCAUagAwIBAgIUHRJwrnieSAJaG9lNeu4Rs+NAJ+IwCgYIKoZIzj0EAwIw\nNjE0MDIGA1UEAwwrZGV2aWNlLWRlYTIxYWYxLTYxZmQtNGZlOC05NWE5LWFhMjAw\nOWUwMTI2NDAeFw0yNjExMTgxNTI0NTdaFw0yODExMTcxNTI0NTdaMDYxNDAyBgNV\nBAMMK2RldmljZS1kZWEyMWFmMS02MWZkLTRmZTgtOTVhOS1hYTIwMDllMDEyNjQw\nWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQgFiH/dc+ZNH52+RXVxiO8akKOJPaP\nef5mF8zU0VfhJRYQWRwpa5qr68xnkEthndAn+wT97hC8sDAWEqpaUEPFozIwMDAd\nBgNVHQ4EFgQUvf4P7BtL1PHnQk8lUY9lVDnhakEwDwYDVR0TAQH/BAUwAwEB/zAK\nBggqhkjOPQQDAgNJADBGAiEAh8cuI1yuuS9+ckLN/d7YaQPZ/oQSASVHOpho8D7t\n2fwCIQDFCCz2LYuOYZzKFpAkmLBMXD+EfKnJD2br0HUFG4BrzQ==\n-----END CERTIFICATE-----\n",
      "environment": "sandbox",
      "enrolled_at": "2026-11-18T15:24:57.272Z",
      "revoked_at": null,
      "revoke_reason": null,
      "hardware_tier": "software",
      "device_integrity_evidence": {
        "platform": "ios",
        "verification": {
          "method": "app_attest",
          "tier_verified": false,
          "cert_bound": false
        }
      },
      "webauthn_credential": null
    }
  ],
  "has_more": false,
  "next_cursor": null
}
```

## Revoke your device

`POST /v1/attest/devices/{id}/revoke`

Revokes a device in your Attest key's carrier; its later captures score `device_revoked`. A device in another carrier is `resource_missing`, the same as an unknown ID. Recorded in your account's audit log with the key as the actor. Takes the `attest` scope.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | no | Retry a create safely: the same key + request returns the stored response (24 h, per caller). |
| `id` | path | string | yes | The device's ID. |
| `reason` | body | string | yes | Why the device is revoked. |

### Returns

The device, now revoked. See [the device object](#object).

### Errors

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

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x
curl -s -X POST "$PROVENANCE_API/v1/attest/devices" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "platform": "ios" }' > step.json
export DEVICE_ID=$(jq -r '.id' step.json)
curl -X POST "$PROVENANCE_API/v1/attest/devices/$DEVICE_ID/revoke" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "reason": "Phone reported lost" }'
```

**Node**

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

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/attest/devices", headers={"Authorization": "Bearer prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x"}, json={
    "platform": "ios"
}).json()
device_id = step1["id"]
data = httpx.post(f"{api}/v1/attest/devices/{device_id}/revoke", headers={"Authorization": "Bearer prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x"}, json={
    "reason": "Phone reported lost"
}).json()
```

### Response 200

```json
{
  "id": "dev_32JWMBCG19974825E06JG4Y0QA",
  "object": "device",
  "carrier_id": "car_000000000000000000000000000000c5",
  "cert_pem": "-----BEGIN CERTIFICATE-----\nMIIBoTCCAUagAwIBAgIUHB7xUc47KZo5FQmbKKNxyDKpMOMwCgYIKoZIzj0EAwIw\nNjE0MDIGA1UEAwwrZGV2aWNlLTYyOTcyOGI2LTQwMjktNDljOC04MTE1LWMwMzRh\nMDRmMDJlYTAeFw0yNjExMTgxMjQ1NDRaFw0yODExMTcxMjQ1NDRaMDYxNDAyBgNV\nBAMMK2RldmljZS02Mjk3MjhiNi00MDI5LTQ5YzgtODExNS1jMDM0YTA0ZjAyZWEw\nWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAATVAN8rt3l/lRZV4P1FxZRHsRmpRm6l\nu+YPGiNQkmYjFJrmnFACPnuBapXO5TXWEsUGPjlCFo7BZM1KaiQGTtqvozIwMDAd\nBgNVHQ4EFgQU0fvC8e0vAAfvi7zA3Iv0SeyTC/owDwYDVR0TAQH/BAUwAwEB/zAK\nBggqhkjOPQQDAgNJADBGAiEA+vntWdP2ft99lM/QqhIr/wgi+7esi7xIRdHWhb6D\nZE4CIQDbFicZztcHdeGrEv0y9qBSoHHYctk+MTa4FDcfU8+ymA==\n-----END CERTIFICATE-----\n",
  "environment": "sandbox",
  "enrolled_at": "2026-11-18T12:45:44.294Z",
  "revoked_at": "2026-11-18T12:45:44.309Z",
  "revoke_reason": "Phone reported lost",
  "hardware_tier": "software",
  "device_integrity_evidence": {
    "platform": "ios",
    "verification": {
      "method": "app_attest",
      "tier_verified": false,
      "cert_bound": false
    }
  },
  "webauthn_credential": null
}
```
