Integrate AI-powered contract risk analysis into your workflow
All API requests require a Bearer token. Generate your API key from the Settings page.
Authorization: Bearer cg_live_YOUR_API_KEY
| Method | Endpoint | Description | Auth |
|---|---|---|---|
POST | /api/v1/analyze | Analyze a contract (applies your rules + legal RAG) | API Key |
GET | /api/v1/contracts | List past analyses | API Key |
GET | /api/v1/contracts/:id | Get single analysis | API Key |
GET | /api/contracts | Contract portfolio (with deadlines) | Session |
PATCH | /api/contracts/:id | Update contract (status, dates, value) | Session |
GET | /api/deadlines | Upcoming deadlines | Session |
POST | /api/rules | Create a compliance rule | Session |
GET | /api/legal | Search the legal library | Session |
GET | /api/audit | Audit trail (paginated) | Session |
GET | /api/audit/export | Export audit trail as CSV | Session |
GET | /api/health | System health check | None |
POST | /api/keys | Create API key | Session |
ndasaasserviceemploymentfreelancepartnershipleasevendorlicensedistributionjoint_venturemergerloanconstructionfranchiseagencysupply_chainreal_estatesettlementtosdparesellerothercurl -X POST https://your-domain.com/api/v1/analyze \ -H "Authorization: Bearer cg_live_YOUR_KEY" \ -F "file=@contract.pdf" \ -F "contractType=saas"
| Rate Limit | 30 requests/minute per API key |
| Max File Size | 10 MB |
| Timeout | 120 seconds |
| 401 | Invalid or missing API key |
| 403 | Monthly contract limit reached |
| 429 | Rate limit exceeded |
{
"contractId": "clx...",
"overallRiskGrade": "C", // deprecated alias, kept for backwards compatibility - A (safe) → F (critical)
"overallRiskScore": 54, // deprecated alias - 0-100, higher = riskier
"contractGrade": "C", // same letter as overallRiskGrade
"contractScore": 46, // 100 - overallRiskScore, 0-100, higher = better - shown throughout the dashboard, use this one
"executiveSummary": "...",
"detectedJurisdiction": "US",
"businessContext": "B2B",
"modelUsed": "aiwen-legal-v1",
"processingTimeMs": 649,
"enginesRun": ["Extraction", "Classification", ...],
"clauses": [{
"clauseType": "Unlimited Liability",
"riskLevel": "critical", // critical|high|medium|low|safe
"riskScore": 9, // 0-10
"originalText": "...",
"explanation": "...",
"recommendation": "...",
"confidence": 0.95
}],
"clauses": [{
"clauseType": "Liquidated Damages",
"riskScore": 8,
"summary": "Plain-language explanation of the clause...", // Summary engine
"legalCitations": [{ // Legal RAG engine
"kind": "statute",
"citation": "Code civil, art. 1231-5",
"summary": "Judges may reduce a manifestly excessive penalty...",
"url": "https://www.legifrance.gouv.fr/..."
}, {
"kind": "case", // Judilibre live case law - only present when JUDILIBRE_API_KEY is configured, never a placeholder
"citation": "Cour de cassation, chambre commerciale, ..., n° ...",
"summary": "...",
"url": "https://www.courdecassation.fr/decision/..."
}]
}],
"missingClauses": [{ "type": "...", "criticality": "mandatory" }],
"consistencyIssues": [{ "clauseA": "...", "clauseB": "...", "type": "contradiction" }],
"deviationReport": [{ "clauseType": "...", "deviationScore": 97 }],
"gapReport": [{ "clauseType": "...", "status": "mandatory_missing" }],
"clauseRewrites": [{ "clauseType": "...", "safe": "...", "balanced": "..." }],
"scoreBreakdown": { "clauseScore": 45, "gapScore": 20, "grade": "C" },
"legalRagReport": { // statutes & case law per clause
"appliedJurisdictions": ["FR", "EU"],
"clauseCitations": [{ "clauseType": "...", "citations": [...] }],
"generalProvisions": [...]
},
"metadata": { // extracted contract data
"parties": [{ "name": "ACME SAS", "siret": "55210055400013", "role": "Provider" }],
"totalValue": 120000, "currency": "EUR",
"dates": { "startDate": "2026-01-01", "endDate": "2028-01-01",
"noticePeriodDays": 90, "autoRenews": true },
"paymentTermDays": 90
},
"policyReport": { // your custom compliance rules
"verdict": "blocked", // pass | warning | blocked
"violations": [{ "ruleName": "...", "action": "block", "matchedOn": "..." }]
}
}