PAK4L Public API
Integrate enterprise-grade document intelligence into your workflow. Analyze contracts, policies, and technical documents programmatically.
https://api.pak4l.aiAuthentication
All API requests require authentication via an API key. Include your key in the Authorization header of every request. API keys are available on Business and Enterprise tiers.
API keys follow the format agr_live_... for production keys. You can create and manage keys from the Developer Dashboard.
Authorization: Bearer agr_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcurl https://api.pak4l.ai/api/review/abc-123/status \
-H "Authorization: Bearer agr_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"Keep your API keys secure
Never expose API keys in client-side code or public repositories. Use environment variables and server-side calls only. If a key is compromised, regenerate it immediately from the Developer Dashboard.
API Endpoints
Click any endpoint to expand its documentation, including parameters, request body, and response examples.
Submit plain text for analysis. The system will assign expert agents based on the document type, run a full multi-agent review, and return a structured intelligence report. Use the returned review_id to poll for status and retrieve results.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
document_text | string | Required | The full text of the document to analyze. |
document_title | string | Required | Human-readable title for the document. |
preset | string | Optional | Review preset: "comprehensive", "quick", "legal", "technical", "compliance". Defaults to "comprehensive". |
enable_deep_review | boolean | Optional | Enable deep review mode for more thorough analysis. Uses additional credits. Defaults to false. |
output_language | string | Optional | Language for the output report: "English", "Italian", "Spanish", etc. Defaults to "English". |
webhook_url | string | Optional | URL to receive a POST callback when the review completes. |
Request Example
curl -X POST https://api.pak4l.ai/api/review/text-review \
-H "Authorization: Bearer agr_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"document_text": "AGREEMENT between Party A and Party B...",
"document_title": "Service Agreement Q1 2026",
"preset": "legal",
"output_language": "English",
"webhook_url": "https://your-app.com/webhooks/pak4l"
}'Response
{
"review_id": "rev_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "in_progress",
"credits_used": 12
}Download Endpoints
After a review completes, download the results in various formats. All download endpoints are GET requests and return the file directly. Check the status endpoint for available artifacts before downloading.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/review/{id}/download/txt | Revised plain text |
| GET | /api/review/{id}/download/md | Markdown report |
| GET | /api/review/{id}/download/json | Full structured JSON |
| GET | /api/review/{id}/download/redline | Redline DOCX with tracked changes |
| GET | /api/review/{id}/download/revised-docx | Formatted revised DOCX |
| GET | /api/review/{id}/download/pdf | Analytics PDF report |
| GET | /api/review/{id}/download/report | Intelligence Report PDF |
| GET | /api/review/{id}/download/zip | All files as ZIP archive |
Example
# Download the redline DOCX
curl -o redline.docx \
https://api.pak4l.ai/api/review/rev_a1b2c3d4/download/redline \
-H "Authorization: Bearer agr_live_xxx"
# Download everything as ZIP
curl -o review_bundle.zip \
https://api.pak4l.ai/api/review/rev_a1b2c3d4/download/zip \
-H "Authorization: Bearer agr_live_xxx"Webhooks
Instead of polling for review status, you can provide a webhook_url when starting a review. PAK4L will send a POST request to your URL when the review completes or fails.
Set the webhook_url parameter in the text-review or upload request body. Your endpoint must return a 2xx status code within 10 seconds.
Webhook Payload
{
"event": "review.completed",
"review_id": "rev_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "completed",
"credits_used": 12,
"artifacts": [
"txt", "md", "json", "redline", "revised-docx", "pdf", "report", "zip"
],
"timestamp": "2026-02-28T10:17:45Z"
}Retry Policy
Failed deliveries are retried 3 times with exponential backoff: 30 seconds, 5 minutes, 30 minutes.
Event Types
review.completed- Review finished successfullyreview.failed- Review encountered an error
Rate Limits
API rate limits are enforced per account on a monthly basis. When you exceed your limit, requests will receive a 429 status code.
| Tier | Monthly Limit | Per Minute |
|---|---|---|
| Business | 1,000 calls/month | 60 requests/min |
| Enterprise | Unlimited | 120 requests/min |
Rate Limit Headers
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 847
X-RateLimit-Reset: 2026-03-01T00:00:00ZError Codes
PAK4L uses standard HTTP status codes. Errors include a JSON body with a detail field describing the issue.
| Code | Status | Description |
|---|---|---|
400 | Bad Request | Invalid or missing parameters in the request body. |
401 | Unauthorized | Missing or invalid API key in the Authorization header. |
402 | Insufficient Credits | Your account does not have enough credits for this operation. |
403 | Forbidden | Your tier does not have access to this feature. Upgrade required. |
404 | Not Found | The requested review or resource does not exist. |
429 | Rate Limited | Monthly or per-minute rate limit exceeded. Retry after the reset period. |
500 | Server Error | Internal error. Please retry or contact support if the issue persists. |
Error Response Example
{
"detail": "Insufficient credits. Required: 12, available: 3. Please top up your account.",
"error_code": "INSUFFICIENT_CREDITS",
"status": 402
}SDKs & Libraries
Python SDK
Coming Soonpip install pak4l - Typed client with async support, automatic retries, and streaming.
pip install pak4l # coming soonNode.js SDK
Coming Soonnpm install @pak4l/sdk - TypeScript-first with full type definitions and webhook helpers.
npm install @pak4l/sdk # coming soonIn the meantime, use the REST API directly. Need help integrating? Contact us
Ready to build?
Get your API key and start analyzing documents programmatically in minutes.