Authentication
Pass your Heretic API key as a Bearer token in theAuthorization header of every request to the explain endpoint.
HERETIC_API_KEY). Never expose it in client-side code.
Calling the Explain Endpoint
Sample Response
Understanding the Response Fields
string
The overall ruling for the session. One of five values:
boolean
true when the evidence reaches the bar for hard enforcement — either a single absolute signal or multiple composite signals that corroborate each other. false indicates the verdict is directionally informative but not yet absolute.string
A single English sentence describing the primary reason for the verdict. Suitable for logging; do not display it verbatim to end users.
string[]
The signal families that produced contradictions. Empty when
verdict is not contradicted. Use this to tailor UI messaging (for example, surface a regional restriction notice when the list includes network-geometry).object
Aggregate counts:
measured is the number of families the collector attempted; reporting is the number that returned usable data.Signal[]
Flat list of individual signals the collector gathered. Each signal has:
id— stable dot-namespaced identifier (e.g.geo.rtt-below-vacuum). Safe to hard-code in policy rules.tier— evidence strength:compositesignals require cross-family corroboration; other tiers indicate standalone or weaker evidence.headline— short human-readable description of what the signal measured.
Error Responses
Handle these three error statuses before attempting to deserialize the response body as a verdict.401 — Invalid or missing API key
401 — Invalid or missing API key
The
Authorization header was absent, malformed, or the key has been revoked. Verify the key at heretic.quest/dashboard/keys and confirm your environment variable is set correctly in your deployment environment.404 — Session not found or expired
404 — Session not found or expired
The session ID does not exist on the edge — either it was never created, it was already consumed, or it expired. Session IDs have a 15-minute lifetime. If you see frequent 404s, check that the collector’s
collect() promise has resolved before you forward the ID to your backend.429 — Rate limited
429 — Rate limited
Your key has exceeded its request budget for the current window. Back off with exponential jitter and retry. If you consistently hit this limit, review your integration — calling the explain endpoint more than once per session ID is unnecessary.
Session IDs expire 15 minutes after the collector issues them. Call the explain endpoint promptly — ideally within the same request that receives the session ID from the client.

