PgBeam
PgBeam Docs
Agents

Summarize one agent session

GET
/v1/projects/{project_id}/audit-logs/sessions/{session_id}

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.

Authorization

AuthorizationBearer <token>

JWT issued by Better Auth. Verified via JWKS.

In: header

Path Parameters

project_id*string

Unique project identifier (prefixed, e.g. prj_xxx).

Match^[a-zA-Z0-9_.-]+$
session_id*string

Session identifier from an audit entry's session_id field. Unique per connection within a proxy instance, not over time.

Match^[a-zA-Z0-9_.-]+$

Query Parameters

start?string

Return entries at or after this timestamp (inclusive lower bound).

Formatdate-time
end?string

Return entries strictly older than this timestamp (cursor / upper bound).

Formatdate-time

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/projects/string/audit-logs/sessions/string"
{  "session_id": "0000a41f",  "project_id": "string",  "credential_ids": [    "string"  ],  "sources": [    "string"  ],  "started_at": "2019-08-24T14:15:22Z",  "ended_at": "2019-08-24T14:15:22Z",  "duration_ms": 0,  "entries_scanned": 0,  "statements": 0,  "allowed": 0,  "blocked": 0,  "masked": 0,  "truncated": 0,  "other": 0,  "rows_returned": 0,  "bytes_out": 0,  "latency_ms_total": 0,  "tables_read": [    "string"  ],  "tables_written": [    "string"  ],  "tables_blocked": [    "string"  ],  "unparsed_statements": 0,  "scan_truncated": true}