PgBeam Docs
Databases

scanDatabaseForPii

Scan a database for likely-PII columns

Connects to the upstream database read-only, inspects information_schema and samples column values against PII heuristics, and returns ranked masking suggestions. Suggestions are advisory — the operator reviews them and applies the ones they want into a policy profile's masking rules. Nothing is auto-applied.

Usage

const result = await api.databases.scanDatabaseForPii({
  pathParams: { project_id: "prj_xxx", database_id: "db_xxx" },
});

Parameters

ParameterTypeRequiredDescription
pathParams.project_idstringYesUnique project identifier (prefixed, e.g. prj_xxx).
pathParams.database_idstringYesUnique database identifier (prefixed, e.g. db_xxx).

Response

Promise<ScanPiiResult> — pii scan result.

Example

import { PgBeamClient } from "pgbeam";

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

const result = await client.api.databases.scanDatabaseForPii({
  pathParams: { project_id: "prj_xxx", database_id: "db_xxx" },
});

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