Upload File
upload_fileUpload a PDF file to Formify. Returns a fileId for use with create_document, create_draft or create_link. Provide exactly ONE of these inputs: (1) fileReference — a file reference that the host application supplies when the user attaches a file and the host supports passing files to tools. Pass it exactly as provided; the server downloads the bytes itself. Never construct one by hand and never put a local path in it. (2) url — a PDF reachable over HTTPS. Works in every client; use it whenever a URL is available. (3) uploadId — for an attached file when the host does not pass file references but you can execute shell commands: call request_file_upload_url first, run its curlCommand, then pass the uploadId here. (4) file — the file's bytes as base64 together with fileName, for an attached file when none of the above is possible. Practical ceiling is roughly 30–50 kB of PDF: base64 is a third larger than the file, and a 300 kB PDF would take more output than a model can emit in one message. IMPORTANT: Do NOT use base64 unless you can guarantee you are passing the complete, untruncated file content. AI assistants routinely truncate large strings, which silently corrupts the file and causes upload failures. If the user attached a file but no fileReference reached this tool, retry the call once before choosing another path. Max size: 50 MB. The PDF must not be password-protected or contain digital signatures from other services.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Public URL to the PDF file (must be directly downloadable over HTTPS). | |
| file | No | Base64-encoded PDF file content. Suited only to small files — roughly 30–50 kB of PDF; beyond that the string exceeds what can be emitted in one message and arrives truncated, producing a corrupt, unusable file. Only use this if you can guarantee the value is the complete, untruncated file. Prefer fileReference, url or uploadId. | |
| fileName | No | Filename with extension (e.g. 'contract.pdf'). Required when using base64. Otherwise derived from the file reference, the URL or the staged upload if omitted. | |
| uploadId | No | Upload ID from request_file_upload_url, after its curl command has returned HTTP 200. | |
| fileReference | No | A file reference supplied by the host application when the user attaches a file and the host supports passing files to tools. Pass the object exactly as the host provides it. If the host does not hand you such an object, leave this out and use url, uploadId or file (base64) instead. |