PgBeam
PgBeam Docs
Agents

getAuditSessionSummary

Summarize one agent session

Groups a session's audit entries into one deterministic summary: the credentials and origins involved, the window it spans, how many statements were allowed, blocked, masked and truncated, the rows and bytes it moved, and the tables it read, wrote and was refused. No model is involved, so the same entries always summarize the same way. Returns metadata only (table names and counts), never row values, and requires the same audit:read permission the list and export endpoints do.

Usage

const result = await api.agents.getAuditSessionSummary({
  pathParams: { project_id: "prj_xxx", session_id: "..." },
});

Parameters

ParameterTypeRequiredDescription
pathParams.project_idstringYesUnique project identifier (prefixed, e.g. prj_xxx).
pathParams.session_idstringYesSession identifier from an audit entry's session_id field. Unique per connection within a proxy instance, not over time.
queryParams.startstringNoReturn entries at or after this timestamp (inclusive lower bound).
queryParams.endstringNoReturn entries strictly older than this timestamp (cursor / upper bound).

Response

Promise<AuditSessionSummary>: session summary.

Example

import { PgBeamClient } from "pgbeam";

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

const result = await client.api.agents.getAuditSessionSummary({
  pathParams: { project_id: "prj_xxx", session_id: "..." },
  queryParams: { start: "...", end: "..." },
});

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