Overview
The Contract Review AI API allows you to analyze contracts programmatically. You can upload contract text and receive structured risk analysis results in JSON format.
API access is available on Business and Enterprise plans.
Authentication
All API requests require a valid API key. Generate your API key from your account page.
Include the key in the Authorization header:
Authorization: Bearer a1b2c3d4.5f6e7d8c9b0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4
Endpoints
POST
/api.php?action=analyze
Analyze a contract and return risk assessment results.
Request Headers
| Header | Value | Required |
|---|---|---|
Authorization | Bearer <your_api_key> | Yes |
Content-Type | application/json | Yes |
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
contract | string | Yes | The full text of the contract to analyze (max 50,000 characters) |
save | boolean | No | If true, saves the analysis to your dashboard history (default: false) |
name | string | No | Friendly name for the saved contract (used when save: true) |
Example Request
curl -X POST https://your-site.com/api.php?action=analyze \
-H "Authorization: Bearer a1b2c3d4.5f6e7d8c9b0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4" \
-H "Content-Type: application/json" \
-d '{
"contract": "This Agreement is made on [DATE] between [PARTY A] and [PARTY B]...",
"save": true,
"name": "NDA with Vendor"
}'
Response
{
"success": true,
"data": {
"risks": [
{
"type": "high",
"title": "Auto-Renewal Clause",
"description": "Contract automatically renews without explicit consent.",
"location": "Termination Section",
"recommendation": "Require explicit opt-in for renewal."
}
],
"entities": [],
"summary": {
"total_risks": 5,
"high_risk_count": 1,
"medium_risk_count": 2,
"low_risk_count": 2,
"overall_risk_level": "medium",
"key_findings": ["High risk: Auto-Renewal Clause"]
},
"analysis_id": 42,
"timestamp": "2026-06-16 12:00:00",
"nlp_engine": "rule_based"
}
}
Response Fields
| Field | Description |
|---|---|
risks | Array of detected risks, each with type (high/medium/low), title, description, location, and recommendation |
entities | Extracted named entities (available when Google NLP is configured) |
summary.total_risks | Total number of risks detected |
summary.overall_risk_level | Overall risk assessment: low, medium, or high |
summary.key_findings | List of the most important findings to review |
analysis_id | Database ID if save: true was set |
nlp_engine | Which analysis engine was used: deepseek (AI) or rule_based (basic) |
Error Codes
| HTTP Status | Error | Cause |
|---|---|---|
| 400 | Invalid action / Missing contract | Bad request parameters |
| 401 | Missing or invalid Authorization header | No API key provided or key is invalid/revoked |
| 403 | Plan does not include API access | Your plan does not support the API |
| 403 | Analysis limit reached | Your plan has run out of analyses |
| 405 | Method not allowed | Only POST is accepted |
| 413 | Contract text too long | Text exceeds 50,000 character limit |
| 429 | Rate limit exceeded | Max 60 requests per minute per key |
Rate Limits
API requests are rate-limited to 60 requests per minute per API key. The rate limit resets every 60 seconds.
If you exceed the limit, the API returns HTTP 429 with an error message.
Plan Features
The analysis engine used depends on your plan:
| Plan | Analysis Engine | API Access |
|---|---|---|
| Trial | Rule-based (basic clause detection) | No |
| Occasional | Rule-based (basic clause detection) | No |
| Regular | AI-powered (Deepseek) + Rule-based | No |
| Professional | AI-powered (Deepseek) + Rule-based | No |
| Business | AI-powered (Deepseek) + Rule-based | Yes |
| Enterprise | AI-powered (Deepseek) + Rule-based | Yes |
Support
For API support, contact us at api@contractreview.ai or visit your account page to manage your API keys.