Authentication

All API requests require authentication using an API key. You can generate API keys from your PureLaw.ai dashboard under Settings → API Keys.

HTTP Header
Authorization: Bearer YOUR_API_KEY

Keep your API keys secure. Never expose them in client-side code or public repositories.

API Endpoints

Base URL: https://api.purelaw.ai/v1

POST /contracts/review

Submit a contract for AI review. Returns risk scores, issues, and suggested redlines.

POST /contracts/draft

Generate contract clauses or complete documents using natural language prompts.

POST /contracts/ask

Ask questions about a contract and receive answers with clause citations.

GET /contracts/{id}

Retrieve details and analysis results for a previously submitted contract.

GET /benchmarks

Get market benchmarking data for specific clause types and industries.

Example Request

curl
curl -X POST https://api.purelaw.ai/v1/contracts/review \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "document": "base64_encoded_document", "document_type": "nda", "options": { "risk_scoring": true, "suggest_redlines": true } }'

SDKs & Libraries

We offer official SDKs for popular programming languages to make integration easier.

🐍
Python
v1.2.0
📦
Node.js
v1.1.0
💎
Ruby
v1.0.0
Java
v1.0.0
Python
from purelaw import PureLawClient client = PureLawClient(api_key="YOUR_API_KEY") # Review a contract result = client.contracts.review( document=open("contract.pdf", "rb"), document_type="nda" ) print(result.risk_score) print(result.issues)

Webhooks

Configure webhooks to receive real-time notifications when contract analysis is complete or other events occur.

POST /webhooks

Create a new webhook endpoint to receive event notifications.

Supported events: contract.review.completed, contract.draft.completed, playbook.updated

Need Help?

Our developer support team is here to help with integration questions.

Contact Developer Support