Files
Upload, download, and reuse tenant-scoped input files.
The file pool stores PDF, PNG, and JPEG inputs for reuse across parse and extract requests. Upload once with POST /files, then pass the returned file_id in admission request JSON instead of attaching bytes on every call.
Pool uploads accept up to 100 MiB. Direct inline multipart uploads on parse/extract admission are limited to 50 MiB. Field definitions live in the Files API reference.
Upload a file
POST /files accepts multipart/form-data with a single file part and returns metadata including the reusable id.
curl -X POST 'https://api.openparser.dev/files' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-F 'file=@./contract.pdf'Get file metadata
GET /files/{id} returns filename, size, and content type for a tenant-owned file. Missing or cross-tenant ids return 404 file_not_found.
curl -s 'https://api.openparser.dev/files/FILE_ID' \
-H 'Authorization: Bearer YOUR_API_KEY'Download file bytes
GET /files/{id}/content streams the stored bytes.
curl -s 'https://api.openparser.dev/files/FILE_ID/content' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-o ./contract.pdfDelete a file
DELETE /files/{id} removes the file from your pool. Later admissions that reference the id return 404 file_not_found.
curl -X DELETE 'https://api.openparser.dev/files/FILE_ID' \
-H 'Authorization: Bearer YOUR_API_KEY'Reuse file_id on admission
Set file_id in the JSON request part of parse or extract admission. Omit the multipart file field when file_id is present. The same id works across multiple jobs until you delete it.
curl -X POST 'https://api.openparser.dev/parse' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H "Idempotency-Key: $(uuidgen 2>/dev/null || openssl rand -hex 16)" \
-F 'request={"ocr_model":"paddleocr-vl-1.6","file_id":"FILE_ID","output_format":"openparser@1"};type=application/json'Batch items can reference file_id per child instead of file_index when no inline files are uploaded.