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

HeaderValueRequired
AuthorizationBearer <your_api_key>Yes
Content-Typeapplication/jsonYes

Request Body

ParameterTypeRequiredDescription
contractstringYesThe full text of the contract to analyze (max 50,000 characters)
savebooleanNoIf true, saves the analysis to your dashboard history (default: false)
namestringNoFriendly 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

FieldDescription
risksArray of detected risks, each with type (high/medium/low), title, description, location, and recommendation
entitiesExtracted named entities (available when Google NLP is configured)
summary.total_risksTotal number of risks detected
summary.overall_risk_levelOverall risk assessment: low, medium, or high
summary.key_findingsList of the most important findings to review
analysis_idDatabase ID if save: true was set
nlp_engineWhich analysis engine was used: deepseek (AI) or rule_based (basic)

Error Codes

HTTP StatusErrorCause
400Invalid action / Missing contractBad request parameters
401Missing or invalid Authorization headerNo API key provided or key is invalid/revoked
403Plan does not include API accessYour plan does not support the API
403Analysis limit reachedYour plan has run out of analyses
405Method not allowedOnly POST is accepted
413Contract text too longText exceeds 50,000 character limit
429Rate limit exceededMax 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:

PlanAnalysis EngineAPI Access
TrialRule-based (basic clause detection)No
OccasionalRule-based (basic clause detection)No
RegularAI-powered (Deepseek) + Rule-basedNo
ProfessionalAI-powered (Deepseek) + Rule-basedNo
BusinessAI-powered (Deepseek) + Rule-basedYes
EnterpriseAI-powered (Deepseek) + Rule-basedYes

Support

For API support, contact us at api@contractreview.ai or visit your account page to manage your API keys.