post_document
Upload a document to Paperless-NGX with optional metadata (title, tags, correspondent, etc.), getting a task UUID for async tracking or the final document ID when polling is enabled.
Instructions
Upload a new document file (PDF, image, etc.) to Paperless-NGX with optional metadata. Upload is asynchronous: by default returns a task UUID (use list_tasks to track consumer progress) — the actual document ID is assigned only after the consumer has processed the file. Set poll=true to wait for the consumer to finish and return the final result (the new document_id on success, or the consumer error on failure) in a single call. Optional metadata: title, created (date), correspondent, document_type, storage_path, tags, archive_serial_number, custom_fields.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | Base64-encoded file content (the universal method — works for any deployment, since the bytes travel over the wire). Alternatively, an absolute file path (e.g. /tmp/invoice.pdf) that the server reads from its OWN filesystem — this only works when the server runs on the same machine as the file (local/stdio deployments). For a remote server, the path option will fail; use base64 instead. | |
| poll | No | If true, wait for the consumer to finish and return the final task status, the new document_id (on success), or the consumer error (on failure) — instead of just the task UUID. Default false (returns immediately). | |
| tags | No | ||
| title | No | ||
| created | No | ||
| filename | Yes | Original filename including extension (e.g. 'invoice.pdf') | |
| storage_path | No | ||
| correspondent | No | ||
| custom_fields | No | ||
| document_type | No | ||
| poll_timeout_seconds | No | When poll=true, max seconds to wait before returning the still-in-progress status (default 30). Increase for large scans where OCR is slow. | |
| archive_serial_number | No |