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

result, err := client.Agents.GetAuditSessionSummary(ctx, "prj_xxx", "...", nil)

Parameters

ParameterTypeRequiredDescription
ctxcontext.ContextYesRequest context
projectIDstringYesUnique project identifier (prefixed, e.g. prj_xxx).
sessionIDstringYesSession identifier from an audit entry's session_id field. Unique per connection within a proxy instance, not over time.
params*pgbeam.GetAuditSessionSummaryParamsNoQuery parameters
params.StartstringNoReturn entries at or after this timestamp (inclusive lower bound).
params.EndstringNoReturn entries strictly older than this timestamp (cursor / upper bound).

Response

(*pgbeam.AuditSessionSummary, error): session summary.

Example

import pgbeam "go.pgbeam.com/sdk"

client := pgbeam.NewClient(&pgbeam.ClientOptions{
  APIKey: "pgb_your_api_key",
})

result, err := client.Agents.GetAuditSessionSummary(ctx, "prj_xxx", "...", &pgbeam.GetAuditSessionSummaryParams{
    Start: "...",
    End: "...",
  })
if err != nil {
  log.Fatal(err)
}
fmt.Println(result)

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