Integrate contract risk analysis directly into your applications
import SubShield from '@subshield/sdk';
const client = new SubShield({
apiKey: 'sk_live_...'
});
// Analyze a contract
const analysis = await client.contracts.analyze({
document: fs.readFileSync('contract.pdf'),
options: {
state: 'California',
includeBenchmarks: true
}
});
console.log(`Risk Score: ${analysis.riskScore}`);
console.log(`Issues Found: ${analysis.issues.length}`);Authenticate your API requests by including your API key in the Authorization header:
Authorization: Bearer sk_live_your_api_keyGet your API key from the Settings page. Keep your API key secure—it provides full access to your account.
/api/v1/analyzeAnalyze a contract document
Request
{
"document": "base64_encoded_document",
"filename": "subcontract.pdf",
"options": {
"include_benchmarks": true,
"include_state_analysis": true,
"state": "California"
}
}Response
{
"id": "ana_abc123",
"risk_score": 7.2,
"risk_level": "HIGH",
"issues": [
{
"title": "Pay-If-Paid Clause",
"severity": "CRITICAL",
"category": "Payment Terms",
"clause_text": "Payment shall be conditioned...",
"explanation": "This clause shifts collection risk...",
"discussion_points": "Suggest modifying to...",
"state_note": "Generally unenforceable in CA"
}
],
"contract_summary": {
"gc_name": "ABC Construction",
"project_name": "Office Tower Phase 2",
"contract_value": "$450,000",
"payment_terms": "Net 45",
"retainage": "10%"
},
"state_compliance": {
"state": "California",
"alerts": ["Pay-if-paid unenforceable", "5% retainage cap"]
}
}/api/v1/contractsList analyzed contracts
Request
// Query parameters ?limit=20 &offset=0 &sort=created_at &order=desc
Response
{
"contracts": [
{
"id": "con_xyz789",
"filename": "subcontract.pdf",
"risk_score": 7.2,
"gc_name": "ABC Construction",
"analyzed_at": "2026-01-22T10:30:00Z"
}
],
"total": 156,
"has_more": true
}/api/v1/contracts/:idGet contract details
Request
// Path parameter :id = "con_xyz789"
Response
{
"id": "con_xyz789",
"filename": "subcontract.pdf",
"risk_score": 7.2,
"risk_level": "HIGH",
"analysis": { /* full analysis object */ },
"created_at": "2026-01-22T10:30:00Z"
}/api/v1/webhooksRegister a webhook endpoint
Request
{
"url": "https://your-app.com/webhook",
"events": ["analysis.completed", "analysis.failed"],
"secret": "your_webhook_secret"
}Response
{
"id": "wh_def456",
"url": "https://your-app.com/webhook",
"events": ["analysis.completed", "analysis.failed"],
"active": true,
"created_at": "2026-01-22T10:30:00Z"
}Business Plan
1,000
requests/minute
Enterprise Plan
10,000
requests/minute
Burst Limit
100
concurrent requests
Rate limit headers are included in every response:X-RateLimit-Limit,X-RateLimit-Remaining,X-RateLimit-Reset
Receive real-time notifications when contract analysis completes. Webhooks are signed using HMAC-SHA256.
analysis.completedanalysis.failedcontract.createdcontract.deletedGet started with the SubShield API today