upload_file
Put a file into LetsBot storage and get back a direct https url plus the filename to pass to send_file / send_group_file / send_image / send_video / send_audio. Two ways in — pass exactly one: source_url when the file is already online (a public link, including a Google Drive "Anyone with the link" share link or a Dropbox link; LetsBot downloads it server-side, max 20 MB), or content_base64 only for a small file you generated yourself and hold the bytes of. Prefer source_url whenever a link exists: large base64 strings do not fit in a tool call. Never pass a Google Drive, Dropbox or OneDrive share link straight to the send tools: those point at a download page rather than at the file, so WhatsApp shows an unopenable "BIN" attachment — run it through this tool first. Each call stores a new copy at a new url — if you already have a url from this tool, reuse it instead of uploading again.
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": {
"filename": "<filename>"
},
"name": "upload_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | Name INCLUDING the extension, e.g. "invoice-2026-012.pdf". The extension must match what the bytes actually are. Any directory part is discarded; the stored object is given a random name. This name is what WhatsApp shows the recipient, so pass it on to send_file / send_group_file as `filename`. Required for both source_url and content_base64 — a share link's path (/view, /uc) is not a file name. | |
| source_url | No | A public http(s) link to the file; LetsBot downloads it (max 20 MB, 20 s). Google Drive share links (drive.google.com/file/d/<id>/view) and Dropbox links (?dl=0) are converted to their direct download form automatically — the Drive file must be shared as "Anyone with the link". Private, internal and non-http(s) addresses are refused. Use this OR content_base64, not both. | |
| content_base64 | No | The file contents, base64-encoded — only for a small file you generated yourself. Max 20 MB after decoding. A "data:...;base64," prefix is accepted and its declared type is ignored — the real type is detected from the bytes. Use this OR source_url, not both. |