Public Developer API
Relevant source files
The following files were used as context for generating this wiki page:
The Public Developer API in Comply-Quick provides a programmatic interface for generating compliance packages, uploading marketplace templates, and monitoring metered usage. It is designed to allow agencies and developers to integrate Comply-Quick's compliance engine directly into their own deployment pipelines or internal tools.
The API is primarily a metered feature available to Pro, Agency, and Enterprise tier users. It leverages a centralized ClauseEngine to transform technical inputs—such as web frameworks and tracking pixels—into structured legal documents, including liability waivers and privacy policy addendums.
Sources: src/app/dashboard/api/ApiView.tsx:106-114, src/app/api/v1/compliance/route.ts:54-54, src/app/dashboard/home/CommandCenterView.tsx:254-263
Authentication and Security
API access is secured via Bearer tokens. These keys are prefixed with cq_live_ and are only displayed once during the initial creation process. Users can manage their keys through the Developer API dashboard, which provides functionality to name, create, and revoke specific keys.
The sequence above illustrates the lifecycle of an API key from creation to its use in authenticating requests.
Sources: src/app/dashboard/api/ApiView.tsx:47-68, src/app/dashboard/api/ApiView.tsx:174-181, src/app/api/v1/compliance/route.ts:56-56
API Endpoints and Usage
The API exposes three primary categories of endpoints for compliance generation, template management, and usage tracking.
Compliance Generation
The core endpoint POST /api/v1/compliance accepts a JSON body describing the technical stack and target jurisdictions. It returns a structured CompliancePackage containing an inward contract shield, privacy addendum, and a pre-launch checklist.
Request Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
userType | string | Yes | Either developer or merchant. |
framework | string | Yes | Supported: shopify, nextjs, wordpress, wix, etc. |
trackingPixels | string[] | Yes | List of pixels: meta, google, tiktok, linkedin, etc. |
targetRegions | string[] | Yes | Jurisdictions like us_general, california_ccpa, eu_gdpr. |
complianceModules | string[] | No | Enterprise modules: hipaa, pci_dss, ada_wcag, soc2. |
format | string | No | Output format: json (default) or markdown. |
Sources: src/app/api/v1/compliance/route.ts:31-38, src/app/api/compliance/route.ts:58-69, src/app/api/compliance/route.ts:109-114
Metered Billing and Limits
Usage is tracked in real-time and billed on top of the user's subscription plan. Every successful call to the compliance generation endpoint is recorded as an api_call.
Rate Limits:
The API enforces a limit of 120 requests per minute per key. Clients should monitor the following response headers:
X-RateLimit-LimitX-RateLimit-RemainingX-RateLimit-Reset
Exceeding these limits results in a 429 Too Many Requests status code.
Sources: src/app/dashboard/api/ApiView.tsx:196-202, src/app/api/compliance/route.ts:16-16, src/app/api/v1/compliance/route.ts:74-74
Data Flow: Compliance Generation
The generation process validates the input against an allowed set of frameworks and regions before invoking the ClauseEngine.
This flowchart describes the internal logic of the /api/v1/compliance route handler.
Sources: src/app/api/v1/compliance/route.ts:54-102, src/app/api/compliance/route.ts:78-144, src/components/ClauseEngine.tsx:430-466
Integration Example
Developers can interact with the API using standard HTTP clients. Below is a curl example for generating a standard merchant package for a Shopify site with Meta and Google tracking.
curl -X POST https://comply-quick.com/api/v1/compliance \
-H "Authorization: Bearer cq_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"userType": "merchant",
"framework": "shopify",
"trackingPixels": ["meta", "google"],
"targetRegions": ["us_general", "eu_gdpr"]
}'
Sources: src/app/dashboard/api/ApiView.tsx:206-214, src/tests/api-compliance.test.ts:14-23
Summary
The Public Developer API serves as the bridge between Comply-Quick's legal logic engine and external automation tools. By providing secure, metered access to stack-specific compliance packages, it enables developers to scale legal protection across numerous projects without manual intervention. The system ensures technical accuracy by validating all inputs against supported frameworks and regions before generating protective documentation.
Sources: src/app/dashboard/api/ApiView.tsx:106-114, src/app/api/v1/compliance/route.ts:101-104