Developer + AI Operator Docs

Use LegalKit from your app, terminal, or AI agent. Scan a site, generate the compliance layer, fetch install assets, verify what is live, and keep proof current.

Base URL: https://api.legalkit.iov1.0
Agent Workflow

What Claude Code can already do

1
Create or select a site
2
Run a scan
3
Generate a one-shot preview
4
Fetch install assets
5
Verify the deploy
6
Keep monitoring current

Publish remains gated behind explicit human review confirmation.

CLI Quickstart

The CLI is the fastest way to operate LegalKit from a terminal or from an AI coding loop.

npm install -g @legalkit/cli
export LEGALKIT_API_KEY=lk_live_xxxxxxxxxxxxx
legalkit one-shot --site-id site_xxx --contact-email [email protected]
legalkit install --site-id site_xxx --snippet banner
legalkit verify --site-id site_xxx --mode hosted

Use preview mode by default. Publishing generated policies still requires explicit human review confirmation.

MCP + Claude Code

Start the MCP server from the CLI when you want Claude Code or another agent to drive the workflow directly.

export LEGALKIT_API_KEY=lk_live_xxxxxxxxxxxxx
legalkit mcp

Current MCP tools cover site listing, site detail, scans, reports, install assets, verification, and one-shot flows.

Authentication

Most API endpoints require authentication using an API key. Include your key in theAuthorization header.

Authorization: Bearer YOUR_API_KEY

Get your API key from the dashboard settings.

Rate Limits

PlanRequests/minScans/day
Free1050
Pro60500
Enterprise300Unlimited

Scanner

Code Example

Request

const response = await fetch("https://legalkit.io/api/scan", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "url": "https://example.com",
  "deepScan": true
}),
});

const data = await response.json();

Body Parameters

urlstringrequired

The URL to scan

deepScanboolean

Enable JavaScript tracker detection

multiPageboolean

Scan multiple pages

Response

{
  "result": {
    "domain": "example.com",
    "complianceScore": 78,
    "summary": {
      "totalServices": 12,
      "requiresConsent": 8,
      "criticalFindings": 1
    },
    "services": [...],
    "recommendations": [...]
  }
}

Webhook Events

Subscribe to these events to receive real-time notifications.

scan.completed

Website scan finished successfully

scan.failed

Scan encountered an error

tracker.new

New tracker detected on site

fingerprinting.detected

Browser fingerprinting found

score.decreased

Compliance score dropped

score.increased

Compliance score improved

alert.triggered

Monitoring alert fired

consent.accepted

User accepted cookies

consent.rejected

User rejected cookies