send_file
Send a document/file to a WhatsApp number. file_url must be a DIRECT url to the file itself. If you generated the file yourself, or it is not already at a direct public url, call upload_file first (it takes the bytes as base64 and returns a url plus the filename to pass here). A Google Drive / Dropbox / OneDrive share link is not a direct url — it points at a download page, and the file arrives as an unopenable "BIN" attachment.
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": {
"phone": "<phone>",
"file_url": "<file_url>",
"confirm": "<confirm>"
},
"name": "send_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| phone | Yes | WhatsApp number in international format without + (e.g. 201234567890), or the contact's phone / chat_id as listed by get_conversations_awaiting_reply (website chat, Messenger, Instagram, Telegram…) | |
| caption | No | Optional caption for the file | |
| confirm | Yes | Consent gate — REQUIRED on every call. Pass false first: the tool then performs no action and returns a preview of exactly what would happen. Show that preview to the user, get their explicit approval, and only then call again with true to send this file. | |
| file_url | Yes | URL of the file to send | |
| filename | No | Display name INCLUDING the extension (e.g. invoice.pdf). WhatsApp shows this name and uses the extension to pick the file type, so a name without one arrives as a generic "BIN" attachment the recipient cannot open. Required whenever file_url has no filename in its path. |