Interactive OpenAPI 3.1.0 Reference
Live OpenAPI 3.1.0 explorer powered by @scalar/api-reference-react (MIT) covering the same routes GET /v1/openapi.json serves: identity, documents, sites, evidence, usage, CheckMyDPDP scanner, verify, billing, rights, and status.
OpenAPI 3.1.0 JSON: Download the bundled specification at /openapi.json or query https://api.policygrain.com/v1/openapi.json directly.
Endpoint catalog (70 operations)
| Method | Path | Module | Summary |
|---|---|---|---|
| GET | /healthz | meta | Liveness and optional ?deep=1 database migration readiness check |
| GET | /v1/status | meta | Public operational status for /status and /trust pages (zero secrets) |
| GET | /v1/openapi.json | meta | Merged OpenAPI 3.1.0 specification for all mounted PolicyGrain API routes |
| GET | /v1/public/sites/{siteId}/rights-form | rights | Render zero-JS progressive-enhancement DPDP Rights & Grievance HTML form |
| POST | /v1/public/sites/{siteId}/rights-requests | rights | Submit a DPDP Act ss.11-14 rights or grievance request and receive a Rule 14 receipt |
| POST | /v1/keys | identity | Issue a new API key (public email signup or authenticated scoped key) |
| GET | /v1/keys | identity | List this account's API keys (requires keys scope) |
| DELETE | /v1/keys/{id} | identity | Revoke one API key (requires keys scope) |
| POST | /v1/keys/{id}/keep | identity | Confirm ownership of an unverified agent-requested API key |
| GET | /v1/account | identity | Read the authenticated account summary |
| DELETE | /v1/account | identity | Unpublish and purge hosted pages, then permanently delete the authenticated account |
| GET | /v1/auth/sign-in | identity | Begin browser sign-in flow when WorkOS is configured |
| POST | /v1/auth/code | identity | Exchange a sign-in code for a session |
| POST | /v1/auth/refresh | identity | Rotate the browser refresh session |
| DELETE | /v1/auth/refresh | identity | Revoke the browser refresh session |
| GET | /v1/questions | documents | The questionnaire as data |
| POST | /v1/profiles | documents | Create a profile: answers stored once, used in every document |
| GET | /v1/profiles | documents | This account's profiles, oldest first |
| GET | /v1/profiles/{id} | documents | One profile |
| PATCH | /v1/profiles/{id} | documents | Merge answers into a profile; null removes one; confirm inferred values (people only) |
| POST | /v1/generations | documents | Generate a profile's documents (a job: 202, then poll) |
| GET | /v1/generations/{id} | documents | Poll a generation |
| GET | /v1/documents | documents | Every document type of a profile |
| GET | /v1/documents/{id} | documents | One document and its versions |
| GET | /v1/documents/{id}/versions/{n} | documents | One version, by number or latest |
| GET | /v1/documents/{id}/publication | documents | Whether and where the document is published on pages.policygrain.com |
| PUT | /v1/documents/{id}/publication | documents | Publish the newest version at pages.policygrain.com/{slug}. Idempotent: the same request again changes nothing |
| DELETE | /v1/documents/{id}/publication | documents | Take the document off pages.policygrain.com (its pages become 404 and are purged from the CDN). The slug stays this document's |
| POST | /v1/sites | sites | A site, with its notice profile and domains |
| GET | /v1/sites | sites | This account's sites, oldest first |
| GET | /v1/sites/{id} | sites | One site |
| PATCH | /v1/sites/{id} | sites | Rename a site or set its notice profile |
| GET | /v1/sites/{id}/domains | sites | The site's domains, by name |
| POST | /v1/sites/{id}/domains | sites | Add a domain (verified later, C2) |
| DELETE | /v1/sites/{id}/domains/{domain} | sites | Remove a domain |
| POST | /v1/sites/{id}/domains/{domain}/verify | sites | Verify a domain |
| GET | /v1/sites/{id}/configs | sites | The site's banner config versions, newest first |
| POST | /v1/sites/{id}/configs | sites | A new draft version, built from the notice profile and these settings |
| GET | /v1/sites/{id}/configs/{ref} | sites | One version: a number, latest, or live |
| POST | /v1/sites/{id}/configs/{ref}/publish | sites | Publish a version: draft or failed → uploading; the publish job makes it live |
| POST | /v1/receipts | evidence | One consent receipt from the banner (public, no key; any origin, CORS) |
| OPTIONS | /v1/receipts | evidence | CORS preflight |
| GET | /v1/sites/{id}/receipts | evidence | List stored consent receipts for a site, limit-aware (scope: evidence:read) |
| GET | /v1/sites/{id}/consent-events | evidence | List stored consent events for a site (SDK alias for /v1/sites/{id}/receipts) |
| GET | /v1/sites/{id}/receipts/export | evidence | Export in-limit consent receipts for a site as JSON or CSV (C6 #102, N11) |
| GET | /v1/sites/{id}/seal | evidence | How far a site's receipts are sealed by Ed25519-signed daily Merkle roots (G13) |
| POST | /v1/sites/{id}/evidence-packs | evidence | Build an evidence pack for a UTC date range: in-limit origin_ok receipts, signed roots, inclusion proofs, an offline verifier and a BSA 2023 s.63 template (G12) |
| GET | /v1/evidence-packs/{id} | evidence | An evidence pack's status, counts and download link (G12) |
| GET | /v1/evidence-packs/{id}/download | evidence | Download an evidence pack as a .zip (or its files as JSON) |
| GET | /v1/usage | usage | Monthly trusted receipt usage for the account (or one site via ?site_id=) |
| GET | /v1/sites/{id}/usage | usage | One site's monthly trusted receipt count against the 10,000/month free limit |
| POST | /v1/scans | scans | Queue a scan of one public page |
| GET | /v1/scans/{id} | scans | Read a scan. The id is the capability; no auth. |
| POST | /v1/scans/{id}/handoff | scans | A single-use, 24-hour link that carries a completed scan into the caller's PolicyGrain account |
| POST | /v1/handoffs/redeem | scans | Use a handoff link, in the account it was made for |
| POST | /v1/sites/{id}/verify | verify | Queue a live verification run on a verified domain for this site |
| POST | /v1/sites/{id}/verifications | verify | Queue a live verification run on a verified domain for this site |
| GET | /v1/sites/{id}/verifications | verify | List verification checks for one site, newest first |
| GET | /v1/sites/{id}/verifications/{verificationId} | verify | Read one verification check belonging to a site |
| GET | /v1/sites/{id}/verifications/{verificationId}/diff | verify | Read deterministic changes since the previous completed verification check for this site |
| GET | /v1/verifications/{id} | verify | Read one verification check by id |
| GET | /v1/verifications/{id}/diff | verify | Read deterministic changes since the previous completed verification check |
| GET | /v1/billing/plans | billing | Public catalog of plans with transparent INR/paise pricing and Indian 18% GST rules |
| GET | /v1/billing/entitlements | billing | Current account plan, max_sites, monthly receipt export allowance, and subscription state |
| POST | /v1/billing/subscriptions | billing | Create a Razorpay subscription checkout record in created state (never grants entitlement until verified webhook) |
| POST | /v1/billing/subscriptions/cancel | billing | Schedule cancellation of the account's active subscription at period end |
| GET | /v1/billing/invoices | billing | List sequential FY Indian GST tax invoices for the authenticated account |
| GET | /v1/billing/invoices/{id} | billing | Fetch one Indian GST tax invoice as JSON |
| GET | /v1/billing/invoices/{id}/html | billing | Render one printable, zero-JS, zero-inline-style semantic HTML GST tax invoice |
| POST | /v1/billing/webhooks/razorpay | billing | Receive an HMAC-SHA256 signed Razorpay subscription webhook (idempotent replay) |