API Reference
Extraction API
Submit documents for AI extraction with Human-in-the-Loop verification.
POST
/v1/extractExtract structured data from a document file
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| file | File | ✅ Yes | Document to extract (PDF, JPG, PNG) |
| X-API-Key | Header | ✅ Yes | Your API key |
| webhook_url | String | ❌ No | URL to receive verified results |
Supported File Types
PDFJPGPNGJSONCSV
Maximum file size: 10MB (25MB for Growth, 100MB for Enterprise)
🚨 Understanding Async Human Review (IMPORTANT)
SyncAI uses Human-in-the-Loop verification. The API response depends on extraction confidence:
High Confidence (>95%)
{"status": "verified", "extracted_json": {...}}Data is ready immediately.
Low Confidence (<95%)
{"status": "needs_review", "review_id": "xxx"}Data sent via webhook in 1-5 min.
Always register a webhook to receive async results!
See Webhooks Guide for setup.
Response Schema
Successful Extraction (200 OK)
{
"success": true,
"status": "verified", // or "needs_review" or "processing"
"confidence": 0.97, // 0.0 to 1.0
"document_id": "doc_abc123",
"extracted_json": {
"header": {
"vendor": "TechFlow Inc",
"date": "2024-01-15",
"invoice_no": "INV-2024-0892"
},
"amounts": {
"subtotal": 8500.00,
"tax": 680.00,
"total": 9180.00
},
"line_items": [
{
"description": "Software License",
"quantity": 1,
"unit_price": 5000.00,
"amount": 5000.00
}
]
},
"verified_by": "ai_auto" // or "human_reviewer"
}GET
/v1/status/{doc_id}Check processing status of a document
// Response
{
"document_id": "doc_abc123",
"status": "needs_review", // processing | needs_review | verified | failed
"confidence": 0.72,
"review_id": "rev_xyz789",
"estimated_time": "3 minutes",
"created_at": "2024-01-15T10:30:00Z"
}Error Codes
| Code | Meaning |
|---|---|
| 400 | Bad Request - Invalid file or parameters |
| 401 | Unauthorized - Missing or invalid API key |
| 413 | File too large - Exceeds size limit |
| 429 | Rate limited - Too many requests |
| 500 | Server error - Contact support |