# Identify settings

The route map, origins, fail mode, retention, starter traffic policies and the response templates rules serve.

Related guide: [Write a traffic policy](https://provenanceauth.com/docs/identify/guides/traffic-policy.md)

## Endpoints

- `POST /v1/identify/response_templates`: [Create a response template](#post-v1-identify-response-templates)
- `POST /v1/identify/alternates`: [Create an alternate](#post-v1-identify-alternates)
- `GET /v1/identify/settings/site`: [Retrieve the Identify settings](#get-v1-identify-settings-site)
- `GET /v1/identify/settings/scraping`: [Retrieve the scraping settings](#get-v1-identify-settings-scraping)
- `GET /v1/identify/response_templates/{id}`: [Retrieve a response template](#get-v1-identify-response-templates-id)
- `GET /v1/identify/scraping_preview`: [Retrieve the scraping preview](#get-v1-identify-scraping-preview)
- `GET /v1/identify/alternates/{id}`: [Retrieve an alternate](#get-v1-identify-alternates-id)
- `PUT /v1/identify/settings/site`: [Update the Identify settings](#put-v1-identify-settings-site)
- `PUT /v1/identify/settings/scraping`: [Update the scraping settings](#put-v1-identify-settings-scraping)
- `PATCH /v1/identify/response_templates/{id}`: [Update a response template](#patch-v1-identify-response-templates-id)
- `PATCH /v1/identify/alternates/{id}`: [Update an alternate](#patch-v1-identify-alternates-id)
- `GET /v1/identify/list_sources`: [List the published ranges' sources](#get-v1-identify-list-sources)
- `GET /v1/identify/response_templates`: [List response templates](#get-v1-identify-response-templates)
- `GET /v1/identify/alternates`: [List alternates](#get-v1-identify-alternates)
- `GET /v1/identify/policy_templates`: [List traffic policy templates](#get-v1-identify-policy-templates)
- `DELETE /v1/identify/response_templates/{id}`: [Delete a response template](#delete-v1-identify-response-templates-id)
- `DELETE /v1/identify/alternates/{id}`: [Delete an alternate](#delete-v1-identify-alternates-id)
- `DELETE /v1/identify/vendors/{vendor}`: [Remove a vendor key](#delete-v1-identify-vendors-vendor)
- `PATCH /v1/identify/vendors/{vendor}`: [Store a vendor key](#patch-v1-identify-vendors-vendor)
- `POST /v1/identify/vendors/{vendor}/test`: [Test a vendor key](#post-v1-identify-vendors-vendor-test)

## The identify config object

### Attributes

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | enum | no | The type of object. One of `identify_config`. |
| `route_map` | array of objects | no | The route map. |
| `route_map.method` | string | no | The HTTP method, or any. |
| `route_map.path` | string | yes | An anchored glob over the path. |
| `route_map.action` | string | yes | The action name your policy reads. |
| `origins` | array of strings | no | Your origins. |
| `display_name` | string \| null | no | The display name. |
| `fail_mode` | enum | no | The fail mode. One of `open`, `closed`. |
| `decisions_ttl_days` | integer | no | Decision retention. |
| `pseudonyms` | enum | no | Pseudonyms in verdicts. One of `on`, `off`. |
| `protocols` | object | no | The hosted check's payment-protocol settings. The AP2 verifier's secret is never returned. |
| `protocols.routes` | array of strings | no | Path globs whose `request.body` is read. |
| `protocols.ap2` | object | no | Your own AP2 verifier. |
| `protocols.ap2.header` | string \| null | no | The header that carries the SD-JWT. |
| `protocols.ap2.verify_url` | string \| null | no | Your AP2 verifier (HTTPS). |
| `protocols.ap2.secret_last4` | string \| null | no | The last four characters of its secret. |
| `protocols.ap2.verifier_configured` | boolean | no | Both the URL and the secret are set. |
| `protocols.x402` | object | no | x402 settings. |
| `protocols.x402.legacy` | boolean | no | Always false: Identify reads x402 payments from `PAYMENT-SIGNATURE` only. |
| `vendors` | object | no | The vendor keys you stored, by vendor: region and the key's last four characters, never the key. |
| `storefront` | object | no | The storefront check on your own site (the script under a publishable key). |
| `storefront.field_timing` | boolean | no | Field timing on your cart and checkout pages. Default `false`; runs only for visitors who allow analytics. |
| `keep_full_ip` | boolean | no | Keep whole request addresses on decisions (Pro). Default `false`: only the /24 (IPv4) or /48 (IPv6) prefix is kept, after the network is classified on the whole address. |
| `is_default` | boolean | no | No settings saved yet. |
| `updated_at` | string \| null | no | When they last changed. |

### Example

```json
{
  "object": "identify_config",
  "route_map": [
    {
      "path": "/checkout*",
      "action": "checkout"
    },
    {
      "path": "/login*",
      "action": "login"
    },
    {
      "path": "/account*",
      "action": "account_change"
    },
    "… 3 more"
  ],
  "origins": [],
  "display_name": null,
  "fail_mode": "closed",
  "decisions_ttl_days": 30,
  "pseudonyms": "on",
  "protocols": {
    "routes": [],
    "ap2": {
      "header": null,
      "verify_url": null,
      "secret_last4": null,
      "verifier_configured": false
    },
    "x402": {
      "legacy": false
    }
  },
  "vendors": {},
  "storefront": {
    "field_timing": false
  },
  "keep_full_ip": false,
  "is_default": true,
  "updated_at": null
}
```

## Create a response template

`POST /v1/identify/response_templates`

Stores a page your traffic rules can serve. A rejection page (`purpose: block`) is what a rule with `respond: { kind: page }` sends. Alternate content (`purpose: alternate`) is refused if it holds a price, a discount, a delivery or return promise or a form that posts, and needs your confirmation that it has no prices, offers or terms.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `name` | body | string | yes | The template's name. |
| `purpose` | body | enum | yes | `block` (at most 32 KB) or `alternate` (at most 64 KB). One of `block`, `alternate`. |
| `content_type` | body | string | yes | `text/html`, `application/json` or `text/plain`; text types are served with `charset=utf-8`. |
| `body` | body | string | yes | The exact bytes to serve. |
| `confirm_no_offers` | body | boolean | no | Alternate content only: you confirm it has no prices, offers or terms. Required. |

### Returns

The template.

### Errors

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

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -X POST "$PROVENANCE_API/v1/identify/response_templates" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Not available",
    "purpose": "block",
    "content_type": "text/html",
    "body": "<!doctype html><title>Not available</title><p>This page isn'\''t available.</p>"
  }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/response_templates`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "name": "Not available",
    "purpose": "block",
    "content_type": "text/html",
    "body": "<!doctype html><title>Not available</title><p>This page isn't available.</p>"
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/identify/response_templates", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "name": "Not available",
    "purpose": "block",
    "content_type": "text/html",
    "body": "<!doctype html><title>Not available</title><p>This page isn't available.</p>"
}).json()
```

### Response 201

```json
{
  "id": "irt_01M8CE5T56K72ZX8EG1PSTY707",
  "object": "identify_response_template",
  "name": "Not available",
  "purpose": "block",
  "content_type": "text/html; charset=utf-8",
  "body": "<!doctype html><title>Not available</title><p>This page isn't available.</p>",
  "confirmation": null,
  "created_at": "2026-11-26T17:24:13.606Z",
  "updated_at": "2026-11-26T17:24:13.606Z"
}
```

## Create an alternate

`POST /v1/identify/alternates`

Names cached or alternate content a traffic rule can serve to suspected scrapers: one of your alternate templates (`static`, `template`) or your own cached copy of the page (`snapshot`, read by the middleware's hook or your edge cache). Provenance never fetches or stores your pages.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `name` | body | string | yes | The alternate's name. |
| `source` | body | enum | yes | Where the content comes from. One of `snapshot`, `static`, `template`. |
| `template_id` | body | string | no | `static` and `template`: an alternate template (`irt_…`). |
| `snapshot` | body | object | no | `snapshot` only. |
| `snapshot.cache_key_prefix` | body | string \| null | no | Your edge cache's key prefix. |
| `max_age_seconds` | body | integer | no | The oldest snapshot served (default 86400). |
| `content_types` | body | array of enums | no | The content types it answers (default: the template's, or `text/html` for a snapshot). |

### Returns

The alternate.

### Errors

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

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X POST "$PROVENANCE_API/v1/identify/response_templates" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Catalogue page",
    "purpose": "alternate",
    "content_type": "text/html",
    "body": "<!doctype html><title>Catalogue</title><p>Browse the catalogue.</p>",
    "confirm_no_offers": true
  }' > step.json
export TEMPLATE_ID=$(jq -r '.id' step.json)
curl -X POST "$PROVENANCE_API/v1/identify/alternates" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"name\": \"Catalogue\",
    \"source\": \"static\",
    \"template_id\": \"$TEMPLATE_ID\"
  }"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/response_templates`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "name": "Catalogue page",
    "purpose": "alternate",
    "content_type": "text/html",
    "body": "<!doctype html><title>Catalogue</title><p>Browse the catalogue.</p>",
    "confirm_no_offers": true
  }),
})).json();
const templateId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/alternates`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "name": "Catalogue",
    "source": "static",
    "template_id": templateId
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/identify/response_templates", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "name": "Catalogue page",
    "purpose": "alternate",
    "content_type": "text/html",
    "body": "<!doctype html><title>Catalogue</title><p>Browse the catalogue.</p>",
    "confirm_no_offers": True
}).json()
template_id = step1["id"]
data = httpx.post(f"{api}/v1/identify/alternates", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "name": "Catalogue",
    "source": "static",
    "template_id": template_id
}).json()
```

### Response 201

```json
{
  "id": "ialt_01M8CQ310BK10XM537RYB8M5VB",
  "object": "identify_alternate",
  "name": "Catalogue",
  "source": "static",
  "template_id": "irt_01M8CQ31091MVQ5PHHAPBNCVW8",
  "snapshot": null,
  "max_age_seconds": 86400,
  "content_types": [
    "text/html"
  ],
  "served_count": 0,
  "guarded_count": 0,
  "fallbacks": {},
  "created_at": "2026-11-26T19:59:59.499Z",
  "updated_at": "2026-11-26T19:59:59.499Z"
}
```

## Retrieve the Identify settings

`GET /v1/identify/settings/site`

Returns your route map, origins, display name, fail mode, retention and pseudonym setting, or the defaults with is_default true.

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

### Parameters

No parameters.

### Returns

The settings. See [the identify config object](#object).

### 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)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/identify/settings/site" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/settings/site`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.get(f"{api}/v1/identify/settings/site", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "identify_config",
  "route_map": [
    {
      "path": "/checkout*",
      "action": "checkout"
    },
    {
      "path": "/login*",
      "action": "login"
    },
    {
      "path": "/account*",
      "action": "account_change"
    },
    "… 3 more"
  ],
  "origins": [],
  "display_name": null,
  "fail_mode": "closed",
  "decisions_ttl_days": 30,
  "pseudonyms": "on",
  "protocols": {
    "routes": [],
    "ap2": {
      "header": null,
      "verify_url": null,
      "secret_last4": null,
      "verifier_configured": false
    },
    "x402": {
      "legacy": false
    }
  },
  "vendors": {},
  "storefront": {
    "field_timing": false
  },
  "keep_full_ip": false,
  "is_default": true,
  "updated_at": null
}
```

## Retrieve the scraping settings

`GET /v1/identify/settings/scraping`

Returns your scraping detection thresholds, per-session counting and calibration sharing, or the defaults with is_default true.

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

### Parameters

No parameters.

### Returns

The settings.

### 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)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/identify/settings/scraping" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/settings/scraping`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.get(f"{api}/v1/identify/settings/scraping", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "identify_scraping_settings",
  "version": 1,
  "thresholds": {
    "min_distinct_paths": 60,
    "min_read_share": 0.95,
    "max_asset_ratio": 0.1,
    "max_interval_cv": 0.15
  },
  "session_counting": false,
  "calibration_sharing": false,
  "is_default": true,
  "updated_at": null
}
```

## Retrieve a response template

`GET /v1/identify/response_templates/{id}`

Returns one response template.

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

### Parameters

No parameters.

### Returns

The template.

### Errors

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

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X POST "$PROVENANCE_API/v1/identify/response_templates" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Not available",
    "purpose": "block",
    "content_type": "text/html",
    "body": "<!doctype html><p>This page isn'\''t available.</p>"
  }' > step.json
export TEMPLATE_ID=$(jq -r '.id' step.json)
curl "$PROVENANCE_API/v1/identify/response_templates/$TEMPLATE_ID" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/response_templates`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "name": "Not available",
    "purpose": "block",
    "content_type": "text/html",
    "body": "<!doctype html><p>This page isn't available.</p>"
  }),
})).json();
const templateId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/response_templates/${templateId}`, {
  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/identify/response_templates", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "name": "Not available",
    "purpose": "block",
    "content_type": "text/html",
    "body": "<!doctype html><p>This page isn't available.</p>"
}).json()
template_id = step1["id"]
data = httpx.get(f"{api}/v1/identify/response_templates/{template_id}", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "id": "irt_01M8CE60TS6TWS51092E77R4D0",
  "object": "identify_response_template",
  "name": "Not available",
  "purpose": "block",
  "content_type": "text/html; charset=utf-8",
  "body": "<!doctype html><p>This page isn't available.</p>",
  "confirmation": null,
  "created_at": "2026-11-26T17:24:20.441Z",
  "updated_at": "2026-11-26T17:24:20.441Z"
}
```

## Retrieve the scraping preview

`GET /v1/identify/scraping_preview`

For 30 days after the release that added `scraping_suspected`, how many of your last 7 days' recorded visits the signal moved into `suspected_bot` (unsigned visits at 50 or more that would be under 50 without it).

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

### Parameters

No parameters.

### Returns

The preview.

### 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)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/identify/scraping_preview" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/scraping_preview`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.get(f"{api}/v1/identify/scraping_preview", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "identify_scraping_preview",
  "released_at": "2026-11-26T00:00:00.000Z",
  "shown_until": "2026-12-26T00:00:00.000Z",
  "active": true,
  "from": "2026-11-26T00:00:00.000Z",
  "to": "2026-11-26T21:31:39.165Z",
  "visits": 7,
  "moved_into_suspected_bot": 0,
  "truncated": false
}
```

## Retrieve an alternate

`GET /v1/identify/alternates/{id}`

Returns one alternate with its served count, guard replacements and fallbacks by reason.

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

### Parameters

No parameters.

### Returns

The alternate.

### Errors

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

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X POST "$PROVENANCE_API/v1/identify/alternates" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Edge cache",
    "source": "snapshot",
    "snapshot": {
      "cache_key_prefix": "https://cache.harborbean.example/"
    }
  }' > step.json
export ALTERNATE_ID=$(jq -r '.id' step.json)
curl "$PROVENANCE_API/v1/identify/alternates/$ALTERNATE_ID" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/alternates`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "name": "Edge cache",
    "source": "snapshot",
    "snapshot": {
      "cache_key_prefix": "https://cache.harborbean.example/"
    }
  }),
})).json();
const alternateId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/alternates/${alternateId}`, {
  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/identify/alternates", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "name": "Edge cache",
    "source": "snapshot",
    "snapshot": {
        "cache_key_prefix": "https://cache.harborbean.example/"
    }
}).json()
alternate_id = step1["id"]
data = httpx.get(f"{api}/v1/identify/alternates/{alternate_id}", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "id": "ialt_01M8CQ310C3XJNQ3Q4C438ACK8",
  "object": "identify_alternate",
  "name": "Edge cache",
  "source": "snapshot",
  "template_id": null,
  "snapshot": {
    "cache_key_prefix": "https://cache.harborbean.example/"
  },
  "max_age_seconds": 86400,
  "content_types": [
    "text/html"
  ],
  "served_count": 0,
  "guarded_count": 0,
  "fallbacks": {},
  "created_at": "2026-11-26T19:59:59.500Z",
  "updated_at": "2026-11-26T19:59:59.500Z"
}
```

## Update the Identify settings

`PUT /v1/identify/settings/site`

Updates the fields you send. The route map turns paths into the actions your traffic policy reads (`checkout`, `login`, `account_change`, …); origins are the audiences your site accepts.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `route_map` | body | array of objects | no | First match wins. |
| `route_map.method` | body | string | no | The HTTP method, or any. |
| `route_map.path` | body | string | yes | An anchored glob over the path. |
| `route_map.action` | body | string | yes | The action name your policy reads. |
| `origins` | body | array of strings | no | Your site's origins (at most 20). |
| `display_name` | body | string \| null | no | The name shown in approval requests and as your agents' operator. |
| `fail_mode` | body | enum | no | What the middleware does before it has ever loaded a bundle. One of `open`, `closed`. |
| `decisions_ttl_days` | body | integer | no | How long decisions are kept. |
| `pseudonyms` | body | enum | no | Whether verdicts carry a per-person pseudonym. One of `on`, `off`. |
| `keep_full_ip` | body | boolean | no | Keep whole request addresses on decisions (Pro; turning it off is always allowed). Off, only the /24 or /48 prefix is kept. |
| `storefront` | body | object | no | The storefront check on your own site. |
| `storefront.field_timing` | body | boolean | no | Field timing on your cart and checkout pages (off by default; runs only for visitors who allow analytics). |
| `protocols` | body | object | no | The hosted check's payment-protocol settings (AP2, ACP, x402). |
| `protocols.routes` | body | array of strings | no | Path globs whose `request.body` is read. |
| `protocols.ap2` | body | object | no | Your own AP2 verifier. Identify posts the SD-JWT to it, signed with the secret in `Provenance-Signature`, and it answers `{content}` with the closed mandate. |
| `protocols.ap2.header` | body | string \| null | no | The header that carries the SD-JWT. |
| `protocols.ap2.verify_url` | body | string \| null | no | Your verifier, https only. |
| `protocols.ap2.secret` | body | string \| null | no | The signing secret (encrypted at rest; null removes it). |
| `protocols.x402` | body | object | no | x402 settings. |
| `protocols.x402.legacy` | body | boolean | no | Accepted and ignored: Identify reads x402 payments from `PAYMENT-SIGNATURE` only. |

### Returns

The settings. See [the identify config object](#object).

### 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)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -X PUT "$PROVENANCE_API/v1/identify/settings/site" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "origins": [
      "https://harborbean.example"
    ],
    "display_name": "Harbor Bean Coffee",
    "storefront": {
      "field_timing": true
    }
  }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/settings/site`, {
  method: "PUT",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "origins": [
      "https://harborbean.example"
    ],
    "display_name": "Harbor Bean Coffee",
    "storefront": {
      "field_timing": true
    }
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.put(f"{api}/v1/identify/settings/site", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "origins": [
        "https://harborbean.example"
    ],
    "display_name": "Harbor Bean Coffee",
    "storefront": {
        "field_timing": True
    }
}).json()
```

### Response 200

```json
{
  "object": "identify_config",
  "route_map": [
    {
      "path": "/checkout*",
      "action": "checkout"
    },
    {
      "path": "/login*",
      "action": "login"
    },
    {
      "path": "/account*",
      "action": "account_change"
    },
    "… 3 more"
  ],
  "origins": [
    "https://harborbean.example"
  ],
  "display_name": "Harbor Bean Coffee",
  "fail_mode": "closed",
  "decisions_ttl_days": 30,
  "pseudonyms": "on",
  "protocols": {
    "routes": [],
    "ap2": {
      "header": null,
      "verify_url": null,
      "secret_last4": null,
      "verifier_configured": false
    },
    "x402": {
      "legacy": false
    }
  },
  "vendors": {},
  "storefront": {
    "field_timing": true
  },
  "keep_full_ip": false,
  "is_default": false,
  "updated_at": "2026-11-28T21:23:53.516Z"
}
```

## Update the scraping settings

`PUT /v1/identify/settings/scraping`

Updates the fields you send. A threshold change raises `version`, which each decision records and the policy bundle carries. Per-session counting must be on before a rule uses `per: session`. Turning calibration sharing off starts the 90 days after which your labels are removed; turning it back on keeps them.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `thresholds` | body | object | no | The thresholds to change; the others stay. |
| `thresholds.min_distinct_paths` | body | integer | no | Distinct pages in five minutes, at least. |
| `thresholds.min_read_share` | body | number | no | Share of reads, at least. |
| `thresholds.max_asset_ratio` | body | number | no | Assets per page under this. |
| `thresholds.max_interval_cv` | body | number | no | Gap variation under this. |
| `calibration_sharing` | body | boolean | no | Label your own decisions for the calibration. |
| `session_counting` | body | boolean | no | Per-session counting: the middleware sets the first-party `pv_cid` cookie (a random id, 30 idle minutes, 24 hours at most) so a `per: session` rule counts a visitor across addresses. Turning it off stops the cookie and expires the session records. |

### Returns

The settings.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`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_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -X PUT "$PROVENANCE_API/v1/identify/settings/scraping" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "thresholds": { "min_distinct_paths": 80 } }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/settings/scraping`, {
  method: "PUT",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "thresholds": { "min_distinct_paths": 80 } }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.put(f"{api}/v1/identify/settings/scraping", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "thresholds": {
        "min_distinct_paths": 80
    }
}).json()
```

### Response 200

```json
{
  "object": "identify_scraping_settings",
  "version": 2,
  "thresholds": {
    "min_distinct_paths": 80,
    "min_read_share": 0.95,
    "max_asset_ratio": 0.1,
    "max_interval_cv": 0.15
  },
  "session_counting": false,
  "calibration_sharing": false,
  "is_default": false,
  "updated_at": "2026-11-26T18:19:28.974Z"
}
```

## Update a response template

`PATCH /v1/identify/response_templates/{id}`

Updates the fields you send. Changed alternate content is checked again and needs your confirmation again. The policy bundle carries the new bytes from its next refresh.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `name` | body | string | no | The template's name. |
| `content_type` | body | string | no | `text/html`, `application/json` or `text/plain`. |
| `body` | body | string | no | The exact bytes to serve. |
| `confirm_no_offers` | body | boolean | no | Alternate content only: required when the content changes. |

### Returns

The template.

### Errors

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

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X POST "$PROVENANCE_API/v1/identify/response_templates" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Catalogue",
    "purpose": "alternate",
    "content_type": "application/json",
    "body": "{\"items\":[],\"page\":1}",
    "confirm_no_offers": true
  }' > step.json
export TEMPLATE_ID=$(jq -r '.id' step.json)
curl -X PATCH "$PROVENANCE_API/v1/identify/response_templates/$TEMPLATE_ID" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Empty catalogue",
    "body": "{\"items\":[]}",
    "confirm_no_offers": true
  }'
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/response_templates`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "name": "Catalogue",
    "purpose": "alternate",
    "content_type": "application/json",
    "body": "{\"items\":[],\"page\":1}",
    "confirm_no_offers": true
  }),
})).json();
const templateId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/response_templates/${templateId}`, {
  method: "PATCH",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "name": "Empty catalogue",
    "body": "{\"items\":[]}",
    "confirm_no_offers": true
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/identify/response_templates", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "name": "Catalogue",
    "purpose": "alternate",
    "content_type": "application/json",
    "body": "{\"items\":[],\"page\":1}",
    "confirm_no_offers": True
}).json()
template_id = step1["id"]
data = httpx.patch(f"{api}/v1/identify/response_templates/{template_id}", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "name": "Empty catalogue",
    "body": "{\"items\":[]}",
    "confirm_no_offers": True
}).json()
```

### Response 200

```json
{
  "id": "irt_01M8CE646NWS1BENXSBFC6YM8A",
  "object": "identify_response_template",
  "name": "Empty catalogue",
  "purpose": "alternate",
  "content_type": "application/json",
  "body": "{\"items\":[]}",
  "confirmation": {
    "confirmed_by": "key_01M8CE63KX80WYKJRBGFQP1RPZ",
    "confirmed_at": "2026-11-26T17:24:23.903Z"
  },
  "created_at": "2026-11-26T17:24:23.893Z",
  "updated_at": "2026-11-26T17:24:23.903Z"
}
```

## Update an alternate

`PATCH /v1/identify/alternates/{id}`

Updates the fields you send. The source can't change. The policy bundle carries the change from its next refresh.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `name` | body | string | no | The alternate's name. |
| `template_id` | body | string | no | `static` and `template`: another alternate template. |
| `snapshot` | body | object | no | `snapshot` only. |
| `snapshot.cache_key_prefix` | body | string \| null | no | Your edge cache's key prefix. |
| `max_age_seconds` | body | integer | no | The oldest snapshot served. |
| `content_types` | body | array of enums | no | The content types it answers. |

### Returns

The alternate.

### Errors

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

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X POST "$PROVENANCE_API/v1/identify/alternates" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Edge cache",
    "source": "snapshot",
    "snapshot": {
      "cache_key_prefix": "https://cache.harborbean.example/"
    }
  }' > step.json
export ALTERNATE_ID=$(jq -r '.id' step.json)
curl -X PATCH "$PROVENANCE_API/v1/identify/alternates/$ALTERNATE_ID" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "max_age_seconds": 7200 }'
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/alternates`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "name": "Edge cache",
    "source": "snapshot",
    "snapshot": {
      "cache_key_prefix": "https://cache.harborbean.example/"
    }
  }),
})).json();
const alternateId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/alternates/${alternateId}`, {
  method: "PATCH",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "max_age_seconds": 7200 }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/identify/alternates", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "name": "Edge cache",
    "source": "snapshot",
    "snapshot": {
        "cache_key_prefix": "https://cache.harborbean.example/"
    }
}).json()
alternate_id = step1["id"]
data = httpx.patch(f"{api}/v1/identify/alternates/{alternate_id}", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "max_age_seconds": 7200
}).json()
```

### Response 200

```json
{
  "id": "ialt_01M8CQ310DD5CKTQ2GV0S67SZD",
  "object": "identify_alternate",
  "name": "Edge cache",
  "source": "snapshot",
  "template_id": null,
  "snapshot": {
    "cache_key_prefix": "https://cache.harborbean.example/"
  },
  "max_age_seconds": 7200,
  "content_types": [
    "text/html"
  ],
  "served_count": 0,
  "guarded_count": 0,
  "fallbacks": {},
  "created_at": "2026-11-26T19:59:59.501Z",
  "updated_at": "2026-11-26T19:59:59.502Z"
}
```

## List the published ranges' sources

`GET /v1/identify/list_sources`

Every crawler and cloud range source the rules read, when it was fetched, how many entries it has, and the ones marked absent.

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

### Parameters

No parameters.

### Returns

The sources.

### 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)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/identify/list_sources" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/list_sources`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.get(f"{api}/v1/identify/list_sources", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "identify_list_sources",
  "refreshed_at": "2026-11-28T23:41:09.130Z",
  "sources": [
    {
      "id": "googlebot",
      "kind": "crawler",
      "source": "https://developers.google.com/static/search/apis/ipranges/googlebot.json",
      "status": "ok",
      "fetched_at": "2026-11-28T23:41:09.130Z",
      "count": 317
    },
    {
      "id": "bingbot",
      "kind": "crawler",
      "source": "https://www.bing.com/toolbox/bingbot.json",
      "status": "ok",
      "fetched_at": "2026-11-28T23:41:09.130Z",
      "count": 29
    },
    {
      "id": "applebot",
      "kind": "crawler",
      "source": "https://search.developer.apple.com/applebot.json",
      "status": "ok",
      "fetched_at": "2026-11-28T23:41:09.130Z",
      "count": 24
    },
    "… 15 more"
  ]
}
```

## List response templates

`GET /v1/identify/response_templates`

Lists your rejection pages and alternate content, oldest first.

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

### Parameters

No parameters.

### Returns

The account's response templates.

### 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)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X POST "$PROVENANCE_API/v1/identify/response_templates" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Not available",
    "purpose": "block",
    "content_type": "text/html",
    "body": "<!doctype html><p>This page isn'\''t available.</p>"
  }' > /dev/null
curl "$PROVENANCE_API/v1/identify/response_templates" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/response_templates`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "name": "Not available",
    "purpose": "block",
    "content_type": "text/html",
    "body": "<!doctype html><p>This page isn't available.</p>"
  }),
})).json();
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/response_templates`, {
  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/identify/response_templates", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "name": "Not available",
    "purpose": "block",
    "content_type": "text/html",
    "body": "<!doctype html><p>This page isn't available.</p>"
}).json()
data = httpx.get(f"{api}/v1/identify/response_templates", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "list",
  "data": [
    {
      "id": "irt_01M8CE5XH79WHPV9BCXVM1EC81",
      "object": "identify_response_template",
      "name": "Not available",
      "purpose": "block",
      "content_type": "text/html; charset=utf-8",
      "body": "<!doctype html><p>This page isn't available.</p>",
      "confirmation": null,
      "created_at": "2026-11-26T17:24:17.063Z",
      "updated_at": "2026-11-26T17:24:17.063Z"
    }
  ],
  "has_more": false,
  "next_cursor": null
}
```

## List alternates

`GET /v1/identify/alternates`

Lists your alternate content sources, oldest first, each with its served count, guard replacements and fallbacks.

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

### Parameters

No parameters.

### Returns

The account's alternates.

### 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)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X POST "$PROVENANCE_API/v1/identify/alternates" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Edge cache",
    "source": "snapshot",
    "snapshot": {
      "cache_key_prefix": "https://cache.harborbean.example/"
    },
    "max_age_seconds": 3600
  }' > /dev/null
curl "$PROVENANCE_API/v1/identify/alternates" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/alternates`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "name": "Edge cache",
    "source": "snapshot",
    "snapshot": {
      "cache_key_prefix": "https://cache.harborbean.example/"
    },
    "max_age_seconds": 3600
  }),
})).json();
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/alternates`, {
  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/identify/alternates", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "name": "Edge cache",
    "source": "snapshot",
    "snapshot": {
        "cache_key_prefix": "https://cache.harborbean.example/"
    },
    "max_age_seconds": 3600
}).json()
data = httpx.get(f"{api}/v1/identify/alternates", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "list",
  "data": [
    {
      "id": "ialt_01M8CQ310BHNC71R8JNV913TE8",
      "object": "identify_alternate",
      "name": "Edge cache",
      "source": "snapshot",
      "template_id": null,
      "snapshot": {
        "cache_key_prefix": "https://cache.harborbean.example/"
      },
      "max_age_seconds": 3600,
      "content_types": [
        "text/html"
      ],
      "served_count": 0,
      "guarded_count": 0,
      "fallbacks": {},
      "created_at": "2026-11-26T19:59:59.499Z",
      "updated_at": "2026-11-26T19:59:59.499Z"
    },
    {
      "id": "ialt_01M8CQ310BK10XM537RYB8M5VB",
      "object": "identify_alternate",
      "name": "Catalogue",
      "source": "static",
      "template_id": "irt_01M8CQ31091MVQ5PHHAPBNCVW8",
      "snapshot": null,
      "max_age_seconds": 86400,
      "content_types": [
        "text/html"
      ],
      "served_count": 0,
      "guarded_count": 0,
      "fallbacks": {},
      "created_at": "2026-11-26T19:59:59.499Z",
      "updated_at": "2026-11-26T19:59:59.499Z"
    }
  ],
  "has_more": false,
  "next_cursor": null
}
```

## List traffic policy templates

`GET /v1/identify/policy_templates`

The four starter traffic policies. Save one with `PUT /v1/identify/policies`.

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

### Parameters

No parameters.

### Returns

The templates.

### 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)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/identify/policy_templates" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/policy_templates`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.get(f"{api}/v1/identify/policy_templates", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "list",
  "data": [
    {
      "id": "welcome_shopping_agents",
      "object": "traffic_policy_template",
      "name": "Welcome verified shopping agents with a human approval at checkout",
      "description": "Signed shopping agents browse freely; at checkout they need the shopper's approval of the exact order.",
      "document": {
        "rules": [
          {
            "id": "shopping-agent-checkout",
            "when": [
              {
                "fact": "agent.class",
                "op": "eq",
                "value": "signed_agent"
              },
              {
                "fact": "agent_category",
                "op": "eq",
                "value": "shopping_agent"
              },
              {
                "fact": "action",
                "op": "eq",
                "value": "checkout"
              }
            ],
            "then": {
              "action": "require_intent",
              "binding": "order"
            }
          },
          {
            "id": "shopping-agent-browse",
            "when": [
              {
                "fact": "agent.class",
                "op": "eq",
                "value": "signed_agent"
              },
              {
                "fact": "agent_category",
                "op": "eq",
                "value": "shopping_agent"
              }
            ],
            "then": {
              "action": "allow"
            }
          }
        ],
        "default": "allow"
      }
    },
    {
      "id": "block_ai_training",
      "object": "traffic_policy_template",
      "name": "Block AI training crawlers",
      "description": "Signed or declared AI training crawlers are blocked; search crawlers and assistants are not.",
      "document": {
        "rules": [
          {
            "id": "block-training-signed",
            "when": [
              {
                "fact": "agent_category",
                "op": "eq",
                "value": "ai_training_crawler"
              }
            ],
            "then": {
              "action": "block",
              "reason": "ai_training_not_allowed"
            }
          },
          {
            "id": "block-training-declared",
            "when": [
              {
                "fact": "signals",
                "op": "contains",
                "value": "known_ai_crawler"
              }
            ],
            "then": {
              "action": "block",
              "reason": "ai_training_not_allowed"
            }
          }
        ],
        "default": "allow"
      }
    },
    {
      "id": "rate_limit_unknown_bots",
      "object": "traffic_policy_template",
      "name": "Rate-limit unknown bots",
      "description": "Suspected bots get 30 requests a minute per address; signed agents and likely humans are unaffected.",
      "document": {
        "rules": [
          {
            "id": "rate-limit-suspected",
            "when": [
              {
                "fact": "agent.class",
                "op": "eq",
                "value": "suspected_bot"
              }
            ],
            "then": {
              "action": "rate_limit",
              "per": "ip",
              "window_seconds": 60,
              "max": 30
            }
          }
        ],
        "default": "allow"
      }
    },
    "… 3 more"
  ],
  "has_more": false,
  "next_cursor": null
}
```

## Delete a response template

`DELETE /v1/identify/response_templates/{id}`

Deletes a template no traffic rule names. While your active or shadow policy names it, the delete is refused.

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

### Parameters

No parameters.

### Returns

The deleted template.

### Errors

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

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X POST "$PROVENANCE_API/v1/identify/response_templates" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Not available",
    "purpose": "block",
    "content_type": "text/html",
    "body": "<!doctype html><p>This page isn'\''t available.</p>"
  }' > step.json
export TEMPLATE_ID=$(jq -r '.id' step.json)
curl -X DELETE "$PROVENANCE_API/v1/identify/response_templates/$TEMPLATE_ID" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/response_templates`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "name": "Not available",
    "purpose": "block",
    "content_type": "text/html",
    "body": "<!doctype html><p>This page isn't available.</p>"
  }),
})).json();
const templateId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/response_templates/${templateId}`, {
  method: "DELETE",
  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/identify/response_templates", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "name": "Not available",
    "purpose": "block",
    "content_type": "text/html",
    "body": "<!doctype html><p>This page isn't available.</p>"
}).json()
template_id = step1["id"]
data = httpx.delete(f"{api}/v1/identify/response_templates/{template_id}", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "id": "irt_01M8CE67NVVVW7R5R5YKVWWMZT",
  "object": "identify_response_template",
  "deleted": true
}
```

## Delete an alternate

`DELETE /v1/identify/alternates/{id}`

Deletes an alternate. Refused while a rule in your active or shadow traffic policy serves it.

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

### Parameters

No parameters.

### Returns

The deleted alternate.

### Errors

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

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X POST "$PROVENANCE_API/v1/identify/alternates" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Edge cache", "source": "snapshot" }' > step.json
export ALTERNATE_ID=$(jq -r '.id' step.json)
curl -X DELETE "$PROVENANCE_API/v1/identify/alternates/$ALTERNATE_ID" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/alternates`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "name": "Edge cache", "source": "snapshot" }),
})).json();
const alternateId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/alternates/${alternateId}`, {
  method: "DELETE",
  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/identify/alternates", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "name": "Edge cache",
    "source": "snapshot"
}).json()
alternate_id = step1["id"]
data = httpx.delete(f"{api}/v1/identify/alternates/{alternate_id}", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "id": "ialt_01M8CQ310ECWQCDWW2ZDGJ332Y",
  "object": "identify_alternate",
  "deleted": true
}
```

## Remove a vendor key

`DELETE /v1/identify/vendors/{vendor}`

Removes the stored key. Verdicts then report `vendor_score.status` as `not_configured`.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `vendor` | path | enum | yes | The vendor. One of `fingerprint`. |

### Returns

The removed key.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`identify_vendor_not_configured`](https://provenanceauth.com/docs/platform/errors.md#identify_vendor_not_configured)
- [`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_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X PATCH "$PROVENANCE_API/v1/identify/vendors/fingerprint" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "api_key": "fp_live_secret_example_0001", "region": "us" }' > /dev/null
curl -X DELETE "$PROVENANCE_API/v1/identify/vendors/fingerprint" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/vendors/fingerprint`, {
  method: "PATCH",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "api_key": "fp_live_secret_example_0001", "region": "us" }),
})).json();
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/vendors/fingerprint`, {
  method: "DELETE",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.patch(f"{api}/v1/identify/vendors/fingerprint", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "api_key": "fp_live_secret_example_0001",
    "region": "us"
}).json()
data = httpx.delete(f"{api}/v1/identify/vendors/fingerprint", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "id": "fingerprint",
  "object": "identify_vendor",
  "deleted": true
}
```

## Store a vendor key

`PATCH /v1/identify/vendors/{vendor}`

Stores your own bot-score vendor key for the hosted check, encrypted at rest. `fingerprint` only; Cloudflare's score is read at the edge.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `vendor` | path | enum | yes | The vendor. One of `fingerprint`. |
| `api_key` | body | string | yes | Your secret Server API key. Never returned. |
| `region` | body | enum | no | Your workspace region (default us). One of `us`, `eu`, `ap`. |

### Returns

The vendor's settings.

### 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)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -X PATCH "$PROVENANCE_API/v1/identify/vendors/fingerprint" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "api_key": "fp_live_secret_example_0001", "region": "us" }'
curl -s -X DELETE "$PROVENANCE_API/v1/identify/vendors/fingerprint" \
  -H "Authorization: Bearer $PROVENANCE_KEY" > /dev/null
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/vendors/fingerprint`, {
  method: "PATCH",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "api_key": "fp_live_secret_example_0001", "region": "us" }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.patch(f"{api}/v1/identify/vendors/fingerprint", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "api_key": "fp_live_secret_example_0001",
    "region": "us"
}).json()
```

### Response 200

```json
{
  "id": "fingerprint",
  "object": "identify_vendor",
  "configured": true,
  "region": "us",
  "key_last4": "0001",
  "updated_at": "2026-11-07T19:22:53.546Z"
}
```

## Test a vendor key

`POST /v1/identify/vendors/{vendor}/test`

Scores one Fingerprint `requestId` with your stored key, so you can check the key and region.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `vendor` | path | enum | yes | The vendor. One of `fingerprint`. |
| `request_id` | body | string | yes | A Fingerprint requestId from your pages. |

### Returns

The vendor score.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`identify_vendor_error`](https://provenanceauth.com/docs/platform/errors.md#identify_vendor_error)
- [`identify_vendor_not_configured`](https://provenanceauth.com/docs/platform/errors.md#identify_vendor_not_configured)
- [`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)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -X POST "$PROVENANCE_API/v1/identify/vendors/fingerprint/test" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "request_id": "1708102555327.NLOjmg" }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/vendors/fingerprint/test`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "request_id": "1708102555327.NLOjmg" }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/identify/vendors/fingerprint/test", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "request_id": "1708102555327.NLOjmg"
}).json()
```

### Response 200

```json
{
  "object": "vendor_score",
  "vendor": "fingerprint",
  "status": "ok",
  "score": 0,
  "label": "not_detected",
  "raw": 0
}
```
