PgBeam
PgBeam Docs
Honeytokens

createHoneytoken

Register a honeytoken

Registers a decoy (canary) relation for the project. Any agent statement that references it is blocked and recorded as a canary_tripped audit event.

Usage

const result = await api.honeytokens.createHoneytoken({
  pathParams: { project_id: "prj_xxx" },
  body: {
    relation_name: "customer_ssns",
    action: "audit_only",
  },
});

Parameters

ParameterTypeRequiredDescription
pathParams.project_idstringYesUnique project identifier (prefixed, e.g. prj_xxx).
body.schema_namestringNoOptional schema. Null or empty matches the unqualified/public form.
body.relation_namestringYesRelation (table or view) name of the decoy.
body.action"audit_only" | "kill"YesResponse when the honeytoken is tripped.

Response

Promise<Honeytoken>: honeytoken registered.

Example

import { PgBeamClient } from "pgbeam";

const client = new PgBeamClient({
  token: "pbk_...",
  baseUrl: "https://api.pgbeam.com",
});

const result = await client.api.honeytokens.createHoneytoken({
  pathParams: { project_id: "prj_xxx" },
  body: {
    relation_name: "customer_ssns",
    action: "audit_only",
  },
});

Errors

StatusDescription
400Invalid request parameters.
401Missing or invalid authentication.
403Operation not allowed by current plan limits.
404Resource not found.
429Rate limited. Try again later.

On this page