API Documentation
The DocsAll external API lets developers integrate document processing capabilities into their own applications. Pro includes 100 calls per month, Team includes 1000 calls per month.
Quick Start
- Upgrade to a Pro or Team plan
- Create an API Key in My Center
- Include it in the request header
Authorization: Bearer da_xxx
Authentication
All API requests must include the API Key in the Header:
Authorization: Bearer da_your_api_key_here 1. Document Conversion API
Convert between PDF and Word/Excel/PPT, supporting 4 conversion types. 注:curl/服务端调用请用 JSON 格式(Cloudflare 平台会拦截非浏览器客户端的表单类 POST;浏览器端 multipart 不受影响)。
Request Parameters
| Field | Type | Description |
|---|---|---|
| file | File | File to convert (max 50MB). JSON 格式: {"name":"document.pdf","data":"<base64>"} |
| type | String | Conversion type: pdf-to-word / pdf-to-excel / word-to-pdf / excel-to-pdf / ppt-to-pdf |
Example (curl, JSON mode)
curl -X POST https://docsall.com/api/v1/external/convert \
-H "Authorization: Bearer da_xxx" \
-H "Content-Type: application/json" \
-d '{"type":"pdf-to-word","file":{"name":"document.pdf","data":"'$(base64 -w0 document.pdf)'"}}' \
-o converted.docx multipart/form-data 格式仍受支持:-F "file=@document.pdf" -F "type=pdf-to-word"(仅限浏览器同源调用)。
2. AI Capabilities API
AI writing, summarization, translation, PPT outline generation.
Request Body (JSON)
| Field | Type | Description |
|---|---|---|
| action | String | write / summarize / translate / ppt-outline |
| messages | Array | Message array, same format as OpenAI: [{"role":"user","content":"..."}] |
| systemPrompt | String? | Custom system prompt (optional) |
| temperature | Number? | 0-2, default 1.0 |
curl -X POST https://docsall.com/api/v1/external/ai \
-H "Authorization: Bearer da_xxx" \
-H "Content-Type: application/json" \
-d '{"action":"summarize","messages":[{"role":"user","content":"Please summarize this text..."}]}' 3. PDF Processing API
PDF merge, split, rotate, compress. curl 调用请用 JSON 格式(含 base64 文件数据)。
| action | Additional Fields | Description |
|---|---|---|
merge | files (multiple) | Merge multiple PDFs |
split | file + pages | Split PDF (e.g. pages="1-3,5,7-9") |
rotate | file + angle | Rotate PDF (angle: 90/180/270) |
compress | file | Compress PDF |
Example (curl, JSON mode)
curl -X POST https://docsall.com/api/v1/external/pdf \
-H "Authorization: Bearer da_xxx" \
-H "Content-Type: application/json" \
-d '{"action":"merge","files":[{"name":"a.pdf","data":"'$(base64 -w0 a.pdf)'"},{"name":"b.pdf","data":"'$(base64 -w0 b.pdf)'"}]}' \
-o merged.pdf 4. Image Processing API
Image compression, format conversion, resize, rotate. curl 调用请用 JSON 格式(含同样以 base64 编码文件数据)。
| action | Additional Fields | Description |
|---|---|---|
compress | file + quality? | Compress to WebP (quality 1-100, default 80) |
convert | file + format | Format conversion (jpeg/png/webp) |
resize | file + width/height | Resize (maintain aspect ratio, no upscaling) |
rotate | file + angle | Rotate (angle: 90/180/270) |
Example (curl, compress)
curl -X POST https://docsall.com/api/v1/external/image \
-H "Authorization: Bearer da_xxx" \
-H "Content-Type: application/json" \
-d '{"action":"compress","file":{"name":"photo.png","data":"'$(base64 -w0 photo.png)'"},"quality":80}' \
-o photo.webp Error Codes
| Status Code | Meaning |
|---|---|
| 200 | Success |
| 400 | Invalid request parameters |
| 401 | Unauthorized (missing or invalid API Key) |
| 403 | Free users have no API access |
| 413 | File too large |
| 429 | Monthly API quota exhausted |
| 503 | Service not configured |
Get Started with the API
Upgrade to a Pro or Team plan and create an API Key to start integrating
View Plans