Skip to main content
POST
Preview monitor content-filter matches

Authorizations

Authorization
string
header
required

API key authorization. Pass your API key in the Authorization header as a Bearer token. Both new (gsk_*) and legacy (gsk-) API keys are accepted, e.g. Authorization: Bearer gsk_... or Authorization: Bearer gsk-....

Body

application/json
productId
string
required

Product whose recent production sessions the preview scans.

Example:

"prod_123"

samplingPercentage
number
required

Candidate sampling percentage (greater than 0, at most 100).

Required range: 0 < x <= 100
Example:

10

versionId
string | null

Optional version to narrow the preview to. Null previews the whole product.

Example:

"version_123"

filterQuery
string | null

Candidate content filter. Null means every recent session matches (sampling only).

Maximum string length: 500
Example:

"refund"

filterTarget
enum<string> | null

Which side of a turn filterQuery matches against. Set together with filterQuery.

Available options:
INPUT,
OUTPUT,
EITHER
Example:

"EITHER"

excludeQuery
string | null

Candidate exclude filter. Comma-separated terms; a session is dropped when a turn whose chosen target (excludeTarget) contains ANY term. Null excludes nothing. Set together with excludeTarget. Independent of filterQuery.

Maximum string length: 500
Example:

"test, internal"

excludeTarget
enum<string> | null

Which side of a turn excludeQuery matches against. Set together with excludeQuery.

Available options:
INPUT,
OUTPUT,
EITHER
Example:

"EITHER"

days
integer

Trailing window in days to look back over (default 90, max 90).

Required range: 1 <= x <= 90
Example:

90

monitorId
string | null

Existing monitor id when previewing an EDIT, so sampling uses its real seed (exact). Omit for a create preview (representative sampling).

Example:

"monitor_123"

Response

Preview computed successfully

Read-only preview of how many and which recent past sessions a candidate monitor content filter and sampling percentage would select. No evaluations run and no credits are spent.

range
object
required
candidateCount
integer
required

Recent closed production sessions considered (bounded by the window and an internal cap).

Example:

500

matchCount
integer
required

Sessions whose content matched the candidate filter (exact; a null filter matches every candidate).

Example:

120

sampledCount
integer
required

Matched sessions that also fell in the sampling fraction.

Example:

12

approximateSampling
boolean
required

True for a create preview (no monitorId): the sampled subset is representative, computed from a placeholder seed. The match count is always exact.

Example:

true

sampledSessions
object[]
required

The would-be-selected sessions, most-recent first (capped at 100).