API Documentation
Use ExportJson programmatically to upload documents and receive structured JSON back.
Base URL
Use the following base URL in production:
https://exportjson.com
Authentication
This API supports two authentication methods:
API Key
Add your API key as a request header:
X-Api-Key: YOUR_API_KEY
Bearer Token (JWT)
If you have a token, send it using:
Authorization: Bearer YOUR_JWT
Never expose API keys or bearer tokens in frontend code. Use them from server-side code only.
Obtaining a Bearer Token
If you prefer to authenticate using a Bearer token (JWT), you can obtain one by calling the login API with your ExportJson account credentials.
POST /api/login
Send your credentials as a JSON body. On success, the API returns a JWT token which can be used in subsequent requests.
Request
{
"username": "user@example.com",
"password": "your-password"
}
Response
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
Using the token
Include the token in the Authorization header for API requests:
Authorization: Bearer YOUR_JWT_TOKEN
- Bearer tokens expire ervy 10 minutes automatically.
- Tokens grant full access to your account and credits.
- Do not expose tokens in frontend code or public repositories.
- For long-running integrations, API keys are recommended instead.
Endpoint
Upload a document and receive extracted JSON:
POST /api/document/create
Request format
Use multipart/form-data with these fields:
| Field | Type | Required | Description |
|---|---|---|---|
| DocumentUpload | File | Yes | PDF / image / scan / text file |
| InputMessage | Text | Yes | Fields to extract (one per line) |
You can upload multiple files by repeating DocumentUpload.
Response
On success, the API returns a JSON object extracted from your document.
{
"invoice_number": "INV-2026-001",
"invoice_date": "2026-01-23",
"total_amount": 129.95,
"vendor_name": "Example Vendor"
}
Examples (cURL)
Using an API key
curl -X POST "https://exportjson.com/api/document/create" \
-H "X-Api-Key: YOUR_API_KEY" \
-F "InputMessage=invoice_number
invoice_date
total_amount
vendor_name" \
-F "DocumentUpload=@/path/to/file.pdf"
Using a Bearer token (JWT)
curl -X POST "https://exportjson.com/api/document/create" \
-H "Authorization: Bearer YOUR_JWT" \
-F "InputMessage=invoice_number
invoice_date
total_amount
vendor_name" \
-F "DocumentUpload=@/path/to/file.pdf"
Errors
Missing or invalid API key / bearer token.
Missing required form-data fields (DocumentUpload / InputMessage) or not enough credits.
File exceeds server upload limits.
Unexpected error while processing the document.
Credits & limits
Each document processing request consumes credits. If you run out of credits, requests will fail with a 400 response. You can purchase credits from your dashboard.
If you need a higher volume plan or want an enterprise integration, contact support via the dashboard.