Skip to main content
POST
/
v1
/
context
/
preview
Preview a scope
curl --request POST \
  --url https://pnbr.io/v1/context/preview \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "cql": "type:Company after:7d",
  "project_id": "9142fa4d-7aad-4a1b-8f99-b522fd37518d"
}
'
{
  "counts": {
    "projects": 1,
    "sources": 1,
    "types": 1,
    "entities": 76
  },
  "matched": 76,
  "scope_warnings": [],
  "unresolved": {
    "shapes": [],
    "sources": []
  },
  "filter_definition": {
    "entityTypes": [
      "Company"
    ],
    "dateRange": {
      "field": "created_at",
      "start": "2026-06-09T12:00:00.000Z"
    }
  }
}

Authorizations

Authorization
string
header
required

A pnbr- API key. Project-scoped keys make project_id implicit; org-scoped keys require it.

Body

application/json

A developer-intent scope: a CQL string (cql) or a structured filter. Names, not UUIDs. cql is canonical if both are given.

cql
string

CQL filter string. Tokens: type:, shape:, source:, source-shape:, after:, before:. Same-kind tokens union, different-kind intersect. after:/before: accept absolute ISO (YYYY-MM-DD) OR relative expressions resolved server-side in UTC: last-week, last-month, last-year, today, yesterday, now, and signed offsets 7d, -7d, 2w, 3mo, 12h, 1y (sign ignored; past-only). Membership-irrelevant tokens (edge:, agent:, sort:, free text) come back in scope_warnings, never silently dropped.

Example:

"type:Company after:7d"

filter
object

Structured mirror of CQL.

project_id
string

Implicit from a project-scoped key or the X-Penumbra-Project header.

Response

200 - application/json

Counts + matched + warnings.