REST API

Contract Intelligence API

Analyze, score, and generate contracts programmatically. Simple authentication, credit-based billing.

Quick Start

Terminal
# Analyze a contract
curl -X POST https://docgic.com/api/v1/contracts/analyze \
  -H "X-Api-Key: dg_live_abc123" \
  -H "Content-Type: application/json" \
  -d '{"contract_text": "This Non-Disclosure Agreement..."}'
Response — 200 OK
{
  "risk_score": 67,
  "percentile_rank": 72,
  "flags": [
    {
      "clause": "4.2",
      "issue": "Unusually broad non-compete scope",
      "severity": "high"
    }
  ],
  "recommendations": [
    "Add governing law clause — 94% of similar contracts include this"
  ]
}

Authentication

1. Sign up

Create a free account at docgic.com/register

2. Generate API key

Go to Dashboard → Developer → Generate Key

3. Start calling

Pass your key in the X-Api-Key header

Header format
X-Api-Key: dg_live_xxxxx

Credit-based billing

Each API call deducts credits from your plan. The free tier includes 50 credits/month. If you run out, requests return 402 Payment Required. Upgrade your plan or purchase additional credits from the dashboard.

Core Endpoints

Three endpoints cover the full analysis pipeline.

POST/api/v1/contracts/analyze5 credits

Full analysis: extracts clauses, computes features, returns risk score with percentile rank, flags, comparables, and actionable recommendations.

Request

{
  "contract_text": "This Non-Disclosure Agreement...",
  "type": "nda",           // optional
  "jurisdiction": "US-CA", // optional
  "industry": "tech"       // optional
}

Response

{
  "risk_score": 67,
  "confidence": 0.89,
  "percentile_rank": 72,
  "flags": [
    { "clause": "4.2", "issue": "Broad non-compete", "severity": "high" }
  ],
  "missing_clauses": ["governing_law"],
  "recommendations": [
    "Add governing law clause — 94% of similar contracts include this"
  ],
  "comparables_count": 312
}
POST/api/v1/contracts/score2 credits

Lightweight scoring: returns risk score, confidence, percentile rank, and top risks. Faster and cheaper than full analysis when you only need the score.

Request

{
  "contract_text": "This Service Agreement...",
  "type": "service_agreement",
  "jurisdiction": "US-NY"
}

Response

{
  "risk_score": 42,
  "confidence": 0.91,
  "percentile_rank": 35,
  "top_risks": [
    "No liability cap specified",
    "Broad indemnification clause"
  ],
  "missing_clauses": ["liability_cap", "force_majeure"]
}
POST/api/v1/contracts/comparables3 credits

Find similar contracts from the dataset. Returns matching contracts with similarity scores, outcomes (disputed vs. successful), and key differences.

Request

{
  "contract_text": "This Employment Agreement...",
  "top_k": 5
}

Response

{
  "similar_contracts": [
    {
      "id": "sec_edgar_00421",
      "similarity": 0.87,
      "type": "employment",
      "outcome": "disputed",
      "dispute_type": "wrongful_termination",
      "key_differences": [
        "Includes 2-year non-compete (yours: none)",
        "Explicit IP assignment clause"
      ]
    }
  ]
}

Additional Endpoints

These endpoints support the full contract workflow.

POST/contracts/chat

Ask questions about a contract in plain English. Returns answers with section references.

POST/contracts/compare

Compare two versions of a contract. Returns a risk-annotated diff with change analysis.

GET/contracts/templates

List available contract templates. Returns template metadata, types, and supported jurisdictions.

Rate Limits & Pricing

Starter

Free

50 credits/month

10 requests/minute

Professional

$29.99/mo

500 credits/month

60 requests/minute

Business

$99.99/mo

2,000 credits/month

120 requests/minute

Enterprise

Custom

Custom volume

Dedicated throughput

SLA guarantee

Built for Enterprise Scale

CLM Integration

Seamlessly integrate with your existing contract lifecycle management tools and workflows.

Volume Processing

Process thousands of contracts simultaneously with dedicated throughput and priority queues.

Custom Risk Models

Train custom risk models tailored to your industry, jurisdiction, and internal policies.

Enterprise-Grade Security

Security Features

  • End-to-end encryption for all documents in transit and at rest
  • Zero data retention — documents are purged after processing
  • Your data is never used for AI training
  • Comprehensive audit logging for all API activity
  • SOC 2 Type II certification on our roadmap

Compliance

  • GDPR-compliant data processing and storage
  • Data residency options for EU and US regions
  • Configurable data retention policies
  • Business Associate Agreement (BAA) available

Need more than 2,000 credits?

Get custom pricing, dedicated SLA, and priority support tailored to your organization's needs.