Custom identifiers
Register, read and remove the identifiers of your own that AbuseZero checks on every evaluation.
Custom identifiers bring your own signals into every evaluation: a license ID, an account number, a contract reference from your own records. You hash each value with a secret only you hold, and AbuseZero checks the hash against your workspace's full claim history without ever receiving the raw value. Register each identifier and the version of the secret you hash it with before you send it. See Custom identifiers for the concept and Send identifiers for hashing.
Examples on this page use a server client:
import { AbuseZero } from "abusezero/server";
const abusezero = new AbuseZero({ key: process.env.ABUSEZERO_SECRET_KEY!, outage: "throw" });The custom identifier object
{
"object": "custom_identifier",
"id": "cid_7d3b1f9a-4e2c-4a8b-b5d6-2f0e8c4a6b19",
"key": "license_id",
"key_version": "2026-10",
"description": "License ID from our billing system",
"created_at": "2026-10-29T10:02:41.000Z",
"updated_at": "2026-10-29T10:02:41.000Z"
}| Field | Type | Description |
|---|---|---|
object | "custom_identifier" | The object type. |
id | string | The registration ID, starting with cid_. |
key | string | The identifier's name. Evaluations send it as identifiers.custom[].key. |
key_version | string | The version label of the secret you hash this identifier's values with. Evaluations send it as identifiers.custom[].value_hash.key_version. |
description | string | What the identifier is, as you wrote it. |
created_at | string | When the registration was created. |
updated_at | string | When the registration last changed. |
Each registration covers one key and key_version pair. To rotate the secret behind an identifier, register the same key with a new key_version, then start hashing with the new secret. A hash made with a different secret is a different value, so claims recorded under the earlier version don't match values hashed under the new one.
Register a custom identifier
| Method | Path | Scope | Idempotency-Key |
|---|---|---|---|
POST | /v1/custom-identifiers | custom_identifiers:write | Required |
Also available as abusezero custom-identifiers register in the AbuseZero CLI, abusezero_register_custom_identifier on the AbuseZero MCP server and registerCustomIdentifier() in the AbuseZero Node.js SDK.
Request body
| Field | Type | Required | Limits | Description |
|---|---|---|---|---|
key | string | Yes | 1 to 64 characters: lowercase letters, digits and underscores, starting with a letter | The identifier's name, such as license_id. |
key_version | string | Yes | 1 to 128 printable characters, no spaces | The version label of the secret you hash values with, such as 2026-10. |
description | string | Yes | 3 to 200 characters | What the identifier is, for your team. |
Example
await abusezero.registerCustomIdentifier(
{
key: "license_id",
key_version: "2026-10",
description: "License ID from our billing system",
},
"register-license-id-2026-10",
);Response
Returns 201.
{
"object": "custom_identifier"
}The response confirms the registration. To read its ID, list custom identifiers. A retry with the same Idempotency-Key and body returns the same confirmation.
Once registered, the identifier can be sent in evaluations:
{
"identifiers": {
"custom": [
{
"key": "license_id",
"value_hash": {
"algorithm": "hmac-sha256",
"key_version": "2026-10",
"value": "<64 lowercase hex characters>"
}
}
]
}
}The AbuseZero Node.js SDK's createCustomIdentifier builds this object for you. See Send identifiers.
Errors
| Code | Status | Meaning |
|---|---|---|
INVALID_FIELD | 422 | A field is missing or outside its limits. |
IDENTIFIER_ALREADY_REGISTERED | 409 | This key and key_version pair is already registered. field is key_version. Register a new key version instead. |
An evaluation that sends a key and key_version pair that isn't registered returns UNSUPPORTED_FIELD, with the message "Register this custom identifier and key version in Developers → Custom identifiers first." For every other code, see REST API errors.
List custom identifiers
Returns registrations, most recently changed first.
| Method | Path | Scope | Idempotency-Key |
|---|---|---|---|
GET | /v1/custom-identifiers | custom_identifiers:read | Not used |
Also available as abusezero custom-identifiers list in the AbuseZero CLI, abusezero_list_custom_identifiers on the AbuseZero MCP server and customIdentifiers() in the AbuseZero Node.js SDK.
Query parameters
| Parameter | Type | Required | Limits | Description |
|---|---|---|---|---|
limit | integer | No | 1 to 100, default 50 | How many registrations to return. |
cursor | string | No | The next_cursor from the previous page, unchanged. |
Example
const page = await abusezero.customIdentifiers();Response
Returns 200.
{
"object": "list",
"data": [
{
"object": "custom_identifier",
"id": "cid_7d3b1f9a-4e2c-4a8b-b5d6-2f0e8c4a6b19",
"key": "license_id",
"key_version": "2026-10",
"description": "License ID from our billing system",
"created_at": "2026-10-29T10:02:41.000Z",
"updated_at": "2026-10-29T10:02:41.000Z"
}
],
"next_cursor": null
}Retrieve a custom identifier
| Method | Path | Scope | Idempotency-Key |
|---|---|---|---|
GET | /v1/custom-identifiers/{id} | custom_identifiers:read | Not used |
Also available as abusezero custom-identifiers get in the AbuseZero CLI, abusezero_get_custom_identifier on the AbuseZero MCP server and call() in the AbuseZero Node.js SDK.
Path parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The registration ID, starting with cid_. |
Example
const registration = await abusezero.call("/v1/custom-identifiers/cid_7d3b1f9a-4e2c-4a8b-b5d6-2f0e8c4a6b19");Response
Returns 200 with a custom identifier object.
Errors
| Code | Status | Meaning |
|---|---|---|
RESOURCE_NOT_FOUND | 404 | No registration with this ID exists in the workspace. |
Remove a custom identifier
Removes one key and key_version registration. Evaluations that send that pair afterwards return UNSUPPORTED_FIELD, so stop sending it first.
| Method | Path | Scope | Idempotency-Key |
|---|---|---|---|
DELETE | /v1/custom-identifiers/{id} | custom_identifiers:write | Required |
Also available as abusezero custom-identifiers delete in the AbuseZero CLI, abusezero_delete_custom_identifier on the AbuseZero MCP server and deleteCustomIdentifier() in the AbuseZero Node.js SDK.
Path parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The registration ID, starting with cid_. |
Example
await abusezero.deleteCustomIdentifier(
"cid_7d3b1f9a-4e2c-4a8b-b5d6-2f0e8c4a6b19",
"remove-cid-7d3b1f9a",
);Response
Returns 200. A retry with the same Idempotency-Key returns this same response.
{
"object": "deleted",
"id": "cid_7d3b1f9a-4e2c-4a8b-b5d6-2f0e8c4a6b19",
"deleted": true
}Errors
| Code | Status | Meaning |
|---|---|---|
IDENTIFIER_NOT_FOUND | 404 | No registration with this ID exists in the workspace. |
IDENTIFIER_IN_USE | 409 | A rule in a policy's active version uses this identifier. Update those policies first, then remove it. |
Related
How is this guide?
Last updated on