API documentation

Base URL: https://api.pandectai.com/api/v1 (in dev: http://localhost:3050/api/v1). All endpoints are versioned under /v1; breaking changes will ship as /v2.

Authentication

Every request carries an API key as a Bearer token. Keys are created on the dashboard and shown once; only a hash is stored. Rate limits are per key, per plan (community 60/min, commercial 300/min). 401 means missing or unknown key, 429 means slow down.

curl -H "Authorization: Bearer rc_your_key" \
  https://api.pandectai.com/api/v1/rules/us-or-lease-landlord-entry-notice

Response envelope

Every successful payload includes a top-level disclaimer, and every rule carries its citations, lastVerified, verifiedBy, and status. This is deliberate: the API is honest at the payload level, so a downstream product cannot accidentally strip the epistemics. Errors are { "error": { "code", "message" } } with a meaningful HTTP status.

Bundle — the workhorse

GET/jurisdictions/:code/domains/:domain

“Everything a decoder needs to load for an Oregon lease analysis.” For a state code the bundle contains that state's rules in the domain plus all nationwide/federal rules in the same domain (your decoder needs the FDCPA alongside the state statute of limitations). Draft and superseded rules are excluded. Jurisdiction codes: US, US-OR, US:irs, US-OR:idea.

curl -H "Authorization: Bearer rc_your_key" \
  https://api.pandectai.com/api/v1/jurisdictions/US-OR/domains/lease
{
  "bundle": {
    "jurisdiction": "US-OR",
    "domain": "lease",
    "ruleCount": 3,
    "bundleHash": "c7e2…64-hex…",   // content hash — cache on this
    "generatedAt": "2026-06-10T12:00:00.000Z"
  },
  "rules": [ /* full rule records, sorted by id */ ],
  "disclaimer": "Informational, not legal advice. …"
}

bundleHash covers rule content only (not generatedAt): same hash ⇒ same rules. Cache bundles by hash and refresh on a timer or on the changes feed.

As of verification v2, each rule record in the bundle also carries its quoteAnchors (the exact source sentences — pass them through so your product can cite the statute's own words), volatilityClass, and pipeline state (lastPipelineRun, pipelineVersion, blindAgreement). Fields are absent on rules awaiting backfill — see methodology.

Single rule

GET/rules/:id
curl -H "Authorization: Bearer rc_your_key" \
  https://api.pandectai.com/api/v1/rules/us-debt-sol-ny

Returns the full record including operativeText, changelog, and relatedRules. Rule IDs are stable forever; replaced rules become status: "superseded" with a supersededBy pointer rather than disappearing.

List & filter

GET/rules?domain=&jurisdiction=&tags=&status=&updatedSince=&page=&pageSize=
# Every statute-of-limitations rule, freshest first page
curl -H "Authorization: Bearer rc_your_key" \
  "https://api.pandectai.com/api/v1/rules?tags=statute-of-limitations&pageSize=50"

# Everything Oregon, changed since June 1
curl -H "Authorization: Bearer rc_your_key" \
  "https://api.pandectai.com/api/v1/rules?jurisdiction=US-OR&updatedSince=2026-06-01"

tags is comma-separated AND-match. jurisdiction=US means nationwide/federal rules only; US-OR means Oregon rules (including state program slices). Pagination: page/pageSize (max 100), with pagination.total in the response.

GET/search?q=
curl -H "Authorization: Bearer rc_your_key" \
  "https://api.pandectai.com/api/v1/search?q=security+deposit+deadline"

v1 is keyword search over title, plain language, tags, and id — fast and predictable. Semantic search over the corpus is a v2 item; the response shape will not change.

Changes feed

GET/changes?since=YYYY-MM-DD
curl -H "Authorization: Bearer rc_your_key" \
  "https://api.pandectai.com/api/v1/changes?since=2026-06-01"

The diff feed — the subscription's recurring value. Returns every rule with changelog activity strictly after since: amendments, supersessions, and re-verifications, each with its changelog entries. Poll daily and alert when a rule your product depends on changes or flips to needs-reverification. You can't miss a law change.

Verify

POST/verify
curl -X POST -H "Authorization: Bearer rc_your_key" \
  -H "Content-Type: application/json" \
  -d '{"ruleId": "us-debt-sol-ny", "asOfDate": "2026-06-10"}' \
  https://api.pandectai.com/api/v1/verify
{
  "ruleId": "us-debt-sol-ny",
  "asOfDate": "2026-06-10",
  "verification": {
    "status": "needs-reverification",
    "lastVerified": "2026-06-10",
    "verifiedBy": "rulecore-seed",
    "effectiveAtDate": true,        // law was in effect on asOfDate
    "verificationStale": false,     // lastVerified within the 12-month window
    "attestable": false             // status==verified && effective && !stale
  },
  "citations": [ … ],
  "disclaimer": "…"
}

Built for auditors and underwriting platforms: an honest attestation of what we know about a rule as of a date. attestable is intentionally strict — it is true only for human-verified, currently-effective, freshly-checked rules.

Report an erratum

POST/errata

When a rule disagrees with what you see in practice, file it. Confirmed errors are corrected, changelogged, and published permanently on the public errata changelog, credited to the reporter with consent.

curl -X POST -H "Authorization: Bearer rc_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "ruleId": "us-or-lease-security-deposit-return",
    "reporterClass": "community-partner",
    "severity": "critical",
    "description": "ORS 90.300 was amended; the accounting window changed.",
    "creditConsent": true
  }' \
  https://api.pandectai.com/api/v1/errata

reporterClass determines the key and the SLA: community-partner requires a Community-tier API key and gets the formal triage SLA (48h critical / 7d standard — tier terms); end-user accepts a per-venture product key, so downstream products can wire a “report a problem with this rule” button; internal is operator tooling. severity ∈ critical | standard, contact and creditConsent optional.

The rule schema, field by field

idStable, hierarchical, kebab-case: us[-state]-domainhint-slug. Never changes, never deleted — supersession preserves history.
domainOne of the taxonomy: lease, debt-collection, medical-billing, insurance-denial, benefits, tax-notice, va-benefits, special-education, property-tax, employment, lending, consumer-services, commercial-lease, vendor-contract, franchise, chargebacks, immigration-notices, building-code.
jurisdiction{ country, state?, county?, program? }. program carries federal regimes that act like jurisdictions for decoding: irs, va, idea, medicare, medicaid, snap, fdcpa, nsa, aca, reg-z, reg-e, ftc.
title / plainLanguageThe decoded rule. Plain language explains, never advises — that's a schema policy, enforced in review.
operativeTextClose paraphrase of the statutory/regulatory text with the pin cite.
citations[]{ source, citation, url, type } where type ∈ statute | regulation | agency-guidance | case-law | program-rule. Primary sources preferred; at least one required.
effectiveDateWhen the underlying law took effect (best known).
lastVerified / verifiedByWhen a named human last re-checked the cited sources, and who. The freshness signal for everything downstream.
statusverified needs-reverification draft superseded — all seed rules start at needs-reverification by policy.
supersededBy / relatedRulesGraph edges. Superseded rules keep serving with a pointer forward.
severityDefaultcritical (deadlines, money, forfeiture) | warning (conduct rules) | note (context) — the default weight a decoder should give the rule.
tags / changelogKebab-case tags for filtering; append-only changelog (every edit adds an entry — git enforces it in review).
quoteAnchors[]{ text, sourceUrl, pinCite, capturedAt, sourceMode } — the exact sentence(s) of the government source the rule derives from. A rule cannot claim verified without anchors (or an exemption) — the schema rejects it.
anchorExempt{ reason } for the rare rule synthesized from multiple provisions. Mutually exclusive with anchors; exempt rules get always-on blind re-derivation instead.
questionTemplateThe rule restated as a neutral question answerable from the source alone — what the blind re-derivation pipeline asks a model that never sees the stored rule.
volatilityClassA | B | C | D — how fast the underlying law moves, driving the backstop re-verification interval (D = legislative-session-driven). See methodology.
lastPipelineRun / pipelineVersion / blindAgreementVerification-pipeline state: when the pipeline last ran on this rule, which pipeline version, and the latest blind-re-derivation outcome (agree | disagree | pending).
auditHistory[]{ auditDate, auditor, verdict, notes? } — sampled practitioner audit results. Per-domain measured error rates are published on /coverage.

All v2 fields are optional until backfilled — existing consumers are unaffected, and a missing field means “not yet verified under v2,” never “verified by default.”

The bundle-loading pattern for AI products

Load the bundle, ground your model, cite our citations through to your user:

import { PandectClient, groundingContext } from "@pandect/sdk";

const pandect = new PandectClient({ apiKey: process.env.PANDECT_API_KEY! });

// 1. Load once per (jurisdiction, domain); cache on bundleHash
const bundle = await pandect.getBundle("US-OR", "lease");

// 2. Ground the model — groundingContext() formats rules + citations
//    and instructs the model to cite rule IDs and never invent rules
const system = `You analyze residential leases for tenants.

${groundingContext(bundle)}`;

// 3. Map cited [rule-ids] in the model output back to bundle.rules
//    and render rule.citations in your UI — real statutes, not vibes.

// 4. Daily job: refresh on change
const changed = await pandect.changesSince(lastSyncDate);
if (changed.some(c => myRuleIds.has(c.ruleId))) await refreshBundles();

TypeScript SDK

@pandect/sdk (packages/pandect-sdk) ships a typed client (getBundle, getRule, listRules, search, changesSince, verify, reportErratum) and the groundingContext() helper — which, as of v2, includes each rule's quote anchors so your model can cite the exact source sentence, not just a pin cite. All v2 changes are additive; the migration notes are in the SDK CHANGELOG. Adopting Pandect in a product that already has a local /rules directory is a one-import change — the recipe is in the SDK README.

The verification workflow (the moat)

Rules live in git and change only by pull request — git is the audit trail. A rule claims verified only with evidence: quote anchors to the cited government source (or an explicit exemption routing it to always-on blind re-derivation), checked daily by the source watch, blind re-derived by a model that never sees the stored rule (cross-model on critical rules), and sampled quarterly by contracted practitioners whose measured per-domain error rates are published. The operator governs the system and signs off on runs and escalations — not “a human read every statute.” The full mechanism, honestly described: /methodology. CI validates every rule against the schema on every push: a malformed rule — or an unanchored “verified” rule — fails the build, so the registry gates itself.