Upload document
upload_documentUpload a base64-encoded file to Paperless as a new document, set metadata by name, and optionally wait for Paperless to return the document ID or task ID.
Instructions
Upload a file, sent as base64 content, to Paperless as a new document. The type comes from the content, not the name: PDF, images, plain text and CSV (Office, OpenDocument and RTF only if Paperless runs Tika). Metadata is given by name as in search_documents; an unknown name is an error and nothing is uploaded; tags are never created. Paperless consumes the file later: the result holds the task_id and, with wait_seconds, the new document_id and web_url; a problem found only then (a taken archive serial number) shows as state failure. Each call adds a document, also for content Paperless already holds (no duplicate check).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"content_base64": "<content_base64>",
"filename": "<filename>"
},
"name": "upload_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | Tag names or ids; they must exist (none is created). | |
| title | No | Title (at most 128 characters); default: the file name without extension. | |
| created | No | Creation date (YYYY-MM-DD); default: Paperless reads it. | |
| filename | Yes | The file's name, e.g. 'Rechnung März.pdf'. Directories are dropped, other characters (non-ASCII too) are kept; Paperless keeps it as the original name. | |
| storage_path | No | Name or id; see list_taxonomy. | |
| wait_seconds | No | Wait up to this many seconds for Paperless to consume the file and return the new document_id; more than 30 is cut to 30. 0 returns the task id at once; follow it with get_task. | |
| correspondent | No | Name or id; see list_taxonomy. | |
| custom_fields | No | Custom field values keyed by field name or id. Values by data type: string/longtext text; url with scheme; date 'YYYY-MM-DD'; boolean true/false; integer; float; monetary 'EUR12.50' (or 12.5); documentlink a list of document ids; select the option's label. | |
| document_type | No | Name or id; see list_taxonomy. | |
| content_base64 | Yes | The file's bytes as standard base64 (RFC 4648) on one line, without a data: prefix. The server refuses files over its size limit (10 MiB by default). | |
| archive_serial_number | No | Archive serial number; it must be unused. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wait | Yes | not_requested: wait_seconds was 0; finished: consumption ended within the wait (see state); timed_out: still running, ask get_task later. | |
| state | Yes | pending, started, success, failure or revoked; unknown when the task could not be read after the upload (e.g. this user may not view tasks): the upload was accepted all the same. | |
| message | Yes | Why consumption failed, or why the state is unknown. | |
| task_id | Yes | Follow it with get_task; Paperless consumes later. | |
| web_url | Yes | Link to the new document, once known. | |
| filename | Yes | The name the file was uploaded under. | |
| mime_type | Yes | The type found in the content. | |
| size_bytes | Yes | ||
| document_id | Yes | The new document once consumption succeeded; else null. | |
| waited_seconds | Yes |