# upload_document

> Upload a PDF or Word (.docx) file into the workspace as a persisted document, returning its document_id for use by detect_fields/fill_document/send_envelope.

Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: asks first: it changes something in your workspace, so clients ask you first.

Upload a PDF or Word (.docx) file into the workspace as a persisted document, returning its document_id for use by detect_fields/fill_document/send_envelope. A DOCX is converted to PDF. Send the file in exactly one way: content_base64, file_url (a public https link AppliFlo downloads), or upload_id (from request_upload, once the person has uploaded the file on its page). The type is read from the file's bytes; at most 20 MB. There is no detection or filling until you call detect_fields next.

## Inputs

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | no | Display name for the document, e.g. the original filename. Required with content_base64 or file_url; with upload_id the uploaded file's own name is used. Up to 255 characters |
| `content_base64` | string | no | Base64-encoded PDF or DOCX bytes |
| `file_url` | string | no | Instead of content_base64: a public https:// link to the file (e.g. a chat attachment's download URL). AppliFlo downloads it: no private or internal addresses, at most 3 redirects, 20 MB and 20 seconds. The type is read from the file itself, never the link. Up to 2048 characters |
| `upload_id` | string | no | The upload_id request_upload returned: picks up the document the person uploaded on the link's page. Up to 64 characters |
| `idempotency_key` | string | no | Same key = same call: a retry (e.g. after a timeout) returns the first result instead of doing it again. The same key with other arguments is refused (422 idempotency_key_reused). Up to 255 characters |
