Skip to content

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.

View .mdOpen llms.txt

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)

All operations in /openapi.json (OpenAPI 3.1.0)
MethodPathModuleSummary
GET/healthzmetaLiveness and optional ?deep=1 database migration readiness check
GET/v1/statusmetaPublic operational status for /status and /trust pages (zero secrets)
GET/v1/openapi.jsonmetaMerged OpenAPI 3.1.0 specification for all mounted PolicyGrain API routes
GET/v1/public/sites/{siteId}/rights-formrightsRender zero-JS progressive-enhancement DPDP Rights & Grievance HTML form
POST/v1/public/sites/{siteId}/rights-requestsrightsSubmit a DPDP Act ss.11-14 rights or grievance request and receive a Rule 14 receipt
POST/v1/keysidentityIssue a new API key (public email signup or authenticated scoped key)
GET/v1/keysidentityList this account's API keys (requires keys scope)
DELETE/v1/keys/{id}identityRevoke one API key (requires keys scope)
POST/v1/keys/{id}/keepidentityConfirm ownership of an unverified agent-requested API key
GET/v1/accountidentityRead the authenticated account summary
DELETE/v1/accountidentityUnpublish and purge hosted pages, then permanently delete the authenticated account
GET/v1/auth/sign-inidentityBegin browser sign-in flow when WorkOS is configured
POST/v1/auth/codeidentityExchange a sign-in code for a session
POST/v1/auth/refreshidentityRotate the browser refresh session
DELETE/v1/auth/refreshidentityRevoke the browser refresh session
GET/v1/questionsdocumentsThe questionnaire as data
POST/v1/profilesdocumentsCreate a profile: answers stored once, used in every document
GET/v1/profilesdocumentsThis account's profiles, oldest first
GET/v1/profiles/{id}documentsOne profile
PATCH/v1/profiles/{id}documentsMerge answers into a profile; null removes one; confirm inferred values (people only)
POST/v1/generationsdocumentsGenerate a profile's documents (a job: 202, then poll)
GET/v1/generations/{id}documentsPoll a generation
GET/v1/documentsdocumentsEvery document type of a profile
GET/v1/documents/{id}documentsOne document and its versions
GET/v1/documents/{id}/versions/{n}documentsOne version, by number or latest
GET/v1/documents/{id}/publicationdocumentsWhether and where the document is published on pages.policygrain.com
PUT/v1/documents/{id}/publicationdocumentsPublish the newest version at pages.policygrain.com/{slug}. Idempotent: the same request again changes nothing
DELETE/v1/documents/{id}/publicationdocumentsTake the document off pages.policygrain.com (its pages become 404 and are purged from the CDN). The slug stays this document's
POST/v1/sitessitesA site, with its notice profile and domains
GET/v1/sitessitesThis account's sites, oldest first
GET/v1/sites/{id}sitesOne site
PATCH/v1/sites/{id}sitesRename a site or set its notice profile
GET/v1/sites/{id}/domainssitesThe site's domains, by name
POST/v1/sites/{id}/domainssitesAdd a domain (verified later, C2)
DELETE/v1/sites/{id}/domains/{domain}sitesRemove a domain
POST/v1/sites/{id}/domains/{domain}/verifysitesVerify a domain
GET/v1/sites/{id}/configssitesThe site's banner config versions, newest first
POST/v1/sites/{id}/configssitesA new draft version, built from the notice profile and these settings
GET/v1/sites/{id}/configs/{ref}sitesOne version: a number, latest, or live
POST/v1/sites/{id}/configs/{ref}/publishsitesPublish a version: draft or failed → uploading; the publish job makes it live
POST/v1/receiptsevidenceOne consent receipt from the banner (public, no key; any origin, CORS)
OPTIONS/v1/receiptsevidenceCORS preflight
GET/v1/sites/{id}/receiptsevidenceList stored consent receipts for a site, limit-aware (scope: evidence:read)
GET/v1/sites/{id}/consent-eventsevidenceList stored consent events for a site (SDK alias for /v1/sites/{id}/receipts)
GET/v1/sites/{id}/receipts/exportevidenceExport in-limit consent receipts for a site as JSON or CSV (C6 #102, N11)
GET/v1/sites/{id}/sealevidenceHow far a site's receipts are sealed by Ed25519-signed daily Merkle roots (G13)
POST/v1/sites/{id}/evidence-packsevidenceBuild 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}evidenceAn evidence pack's status, counts and download link (G12)
GET/v1/evidence-packs/{id}/downloadevidenceDownload an evidence pack as a .zip (or its files as JSON)
GET/v1/usageusageMonthly trusted receipt usage for the account (or one site via ?site_id=)
GET/v1/sites/{id}/usageusageOne site's monthly trusted receipt count against the 10,000/month free limit
POST/v1/scansscansQueue a scan of one public page
GET/v1/scans/{id}scansRead a scan. The id is the capability; no auth.
POST/v1/scans/{id}/handoffscansA single-use, 24-hour link that carries a completed scan into the caller's PolicyGrain account
POST/v1/handoffs/redeemscansUse a handoff link, in the account it was made for
POST/v1/sites/{id}/verifyverifyQueue a live verification run on a verified domain for this site
POST/v1/sites/{id}/verificationsverifyQueue a live verification run on a verified domain for this site
GET/v1/sites/{id}/verificationsverifyList verification checks for one site, newest first
GET/v1/sites/{id}/verifications/{verificationId}verifyRead one verification check belonging to a site
GET/v1/sites/{id}/verifications/{verificationId}/diffverifyRead deterministic changes since the previous completed verification check for this site
GET/v1/verifications/{id}verifyRead one verification check by id
GET/v1/verifications/{id}/diffverifyRead deterministic changes since the previous completed verification check
GET/v1/billing/plansbillingPublic catalog of plans with transparent INR/paise pricing and Indian 18% GST rules
GET/v1/billing/entitlementsbillingCurrent account plan, max_sites, monthly receipt export allowance, and subscription state
POST/v1/billing/subscriptionsbillingCreate a Razorpay subscription checkout record in created state (never grants entitlement until verified webhook)
POST/v1/billing/subscriptions/cancelbillingSchedule cancellation of the account's active subscription at period end
GET/v1/billing/invoicesbillingList sequential FY Indian GST tax invoices for the authenticated account
GET/v1/billing/invoices/{id}billingFetch one Indian GST tax invoice as JSON
GET/v1/billing/invoices/{id}/htmlbillingRender one printable, zero-JS, zero-inline-style semantic HTML GST tax invoice
POST/v1/billing/webhooks/razorpaybillingReceive an HMAC-SHA256 signed Razorpay subscription webhook (idempotent replay)