AbuseZero

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"
}
FieldTypeDescription
object"custom_identifier"The object type.
idstringThe registration ID, starting with cid_.
keystringThe identifier's name. Evaluations send it as identifiers.custom[].key.
key_versionstringThe version label of the secret you hash this identifier's values with. Evaluations send it as identifiers.custom[].value_hash.key_version.
descriptionstringWhat the identifier is, as you wrote it.
created_atstringWhen the registration was created.
updated_atstringWhen 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

MethodPathScopeIdempotency-Key
POST/v1/custom-identifierscustom_identifiers:writeRequired

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

FieldTypeRequiredLimitsDescription
keystringYes1 to 64 characters: lowercase letters, digits and underscores, starting with a letterThe identifier's name, such as license_id.
key_versionstringYes1 to 128 printable characters, no spacesThe version label of the secret you hash values with, such as 2026-10.
descriptionstringYes3 to 200 charactersWhat 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

CodeStatusMeaning
INVALID_FIELD422A field is missing or outside its limits.
IDENTIFIER_ALREADY_REGISTERED409This 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.

MethodPathScopeIdempotency-Key
GET/v1/custom-identifierscustom_identifiers:readNot 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

ParameterTypeRequiredLimitsDescription
limitintegerNo1 to 100, default 50How many registrations to return.
cursorstringNoThe 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

MethodPathScopeIdempotency-Key
GET/v1/custom-identifiers/{id}custom_identifiers:readNot 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

ParameterTypeDescription
idstringThe 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

CodeStatusMeaning
RESOURCE_NOT_FOUND404No 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.

MethodPathScopeIdempotency-Key
DELETE/v1/custom-identifiers/{id}custom_identifiers:writeRequired

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

ParameterTypeDescription
idstringThe 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

CodeStatusMeaning
IDENTIFIER_NOT_FOUND404No registration with this ID exists in the workspace.
IDENTIFIER_IN_USE409A rule in a policy's active version uses this identifier. Update those policies first, then remove it.

How is this guide?

Last updated on

On this page