API Documentation
RESTful API for document processing. Bank statements, Emirates ID, trade licenses, fraud detection, and more.
Quick Start
Get started with the PaperWork API in minutes.
Get API Key
Contact us to get your API key. Keys start with sk-paperwork-
Add Authorization
Include your key in the Authorization header as a Bearer token.
Make Requests
Send documents via multipart/form-data or JSON depending on endpoint.
Base URL
Authentication
All requests require a Bearer token in the Authorization header.
Endpoints
Available API endpoints for document processing.
/api/v1/bank-statement/analyzeBank Statement Analysis
Extract transactions, balances, and metadata from UAE bank statements.
Request
curl -X POST https://api.paperwork.to/api/v1/bank-statement/analyze \ -H "Authorization: Bearer sk-paperwork-YOUR_API_KEY" \ -F "file=@statement.pdf" \ -F "include_categories=true"
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | file (PDF) | Yes | Bank statement PDF file |
| bank_hint | string | No | Bank name hint for better parsing (e.g., "ENBD", "FAB") |
| include_categories | boolean | No | Include AI-powered transaction categories |
Response
{
"account_holder": "John Smith",
"account_number": "****1234",
"bank_name": "Emirates NBD",
"currency": "AED",
"period": {
"start_date": "2024-01-01",
"end_date": "2024-01-31"
},
"opening_balance": 15000.00,
"closing_balance": 18500.00,
"transactions": [
{
"date": "2024-01-05",
"description": "SALARY TRANSFER",
"amount": 25000.00,
"type": "credit",
"balance": 40000.00,
"category": "income"
}
],
"summary": {
"total_credits": 25000.00,
"total_debits": 21500.00,
"transaction_count": 45
}
}Response Fields
| Field | Type | Description |
|---|---|---|
| account_holder | string | Account holder name |
| account_number | string | Masked account number |
| bank_name | string | Detected bank name |
| currency | string | Currency code (AED, USD, etc.) |
| period | object | Statement period (start_date, end_date) |
| opening_balance | number | Opening balance |
| closing_balance | number | Closing balance |
| transactions | array | Array of transaction objects |
| summary | object | Total credits, debits, transaction count |
Error Codes
Standard HTTP status codes with detailed error messages.
| Code | Description |
|---|---|
| 400 | Bad Request - Invalid parameters or file format |
| 401 | Unauthorized - Missing or invalid API key |
| 403 | Forbidden - API key lacks permission for this endpoint |
| 404 | Not Found - Resource not found |
| 413 | Payload Too Large - File exceeds size limit (50MB) |
| 422 | Unprocessable Entity - Document could not be parsed |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error - Contact support |
Error Response Format
{
"error": {
"code": "invalid_file_format",
"message": "File must be PDF or image (JPG, PNG)",
"details": {
"received": "text/plain",
"expected": ["application/pdf", "image/jpeg", "image/png"]
}
}
}Rate Limits
Rate limits vary by subscription plan. Headers include usage info.
| Plan | Requests | Concurrent | Max File Size |
|---|---|---|---|
| Starter | 100/day | 2 | 10MB |
| Professional | 1,000/day | 5 | 25MB |
| Enterprise | 10,000/day | 20 | 50MB |
Rate Limit Headers
X-RateLimit-Limit: 1000 X-RateLimit-Remaining: 847 X-RateLimit-Reset: 1705401600
Webhooks
Receive notifications when async processing completes.
Configuration
Set your webhook URL in the dashboard. We'll send POST requests with processing results.
- HTTPS endpoints only
- Signature verification via X-Webhook-Signature header
- 3 retry attempts with exponential backoff
- 30 second timeout
Webhook Payload
{
"event": "document.processed",
"timestamp": "2024-01-15T10:30:00Z",
"data": {
"request_id": "req_abc123",
"status": "completed",
"result": { ... }
}
}SDKs & Libraries
Official libraries for common languages. All SDKs are open source.
Python
pip install paperwork-sdkAvailableNode.js
npm install @paperwork/sdkAvailableGo
go get paperwork.to/sdkComing soonPHP
composer require paperwork/sdkComing soon