Send file
send_fileSend documents, images, audio, video, or contacts to a recipient on WhatsApp or Telegram. Provide the file by path, URL, or base64; files over 10MB become download links.
Instructions
Send a file (document, image, audio, video, contact) to a recipient via WhatsApp or Telegram. File is uploaded as multipart/form-data. Images under 10MB sent natively, larger files as download links active for 7 days.
Use it when the user wants to share a document, photo, voice message, video or contact card. Provide the file as exactly one of: file_path (local file), file_url (downloaded by the server) or file_base64 (with file_name).
Supported: pdf, doc, docx, ppt, pptx, xls, xlsx, zip, 7z; ogg, opus, mp3, aac, amr, 3gp; jpeg, png, webp; mp4; vcf. Max 100 MB. Recipient rules are the same as send_message.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | document = send as file, image = send as photo (WhatsApp/tdlib). | |
| phone | No | Recipient phone in international format. Optional if username is used (tdlib). | |
| caption | No | Description below the file (WhatsApp only). | |
| file_url | No | Public http(s) URL of the file; the server downloads and uploads it. | |
| priority | No | Sending priority. Chosen automatically if omitted. | |
| username | No | Telegram username (tdlib only). | |
| utm_mark | No | Label for tracking dispatches (see get_utm_tags). | |
| file_name | No | Filename with extension, e.g. document.pdf. Defaults to the name from file_path or file_url. | |
| file_path | No | Absolute path of a local file to upload (~ is expanded). | |
| customer_id | No | Internal client ID. | |
| external_id | No | Your client-side ID for this message (idempotency ID). | |
| file_base64 | No | File content as base64 (a data: URL is accepted too). Requires file_name. | |
| sender_name | No | Registered SMS sender name (see get_balance → sender names). | |
| callback_url | No | URL that receives the final delivery status as a POST request (retried every 2 minutes, up to 10 times, until it returns HTTP 200). | |
| scheduled_at | No | Delayed sending time, format YYYY-MM-DD HH:MM:SS in UTC+0. At least 1 minute and at most 1 month ahead. | |
| tdlib_user_id | No | Telegram user ID (positive = private chat, negative = group chat). tdlib channel only. | |
| simulate_typing | No | Default true: show a typing indicator in WhatsApp before sending. false sends instantly. | |
| dispatch_routing | No | Channels in the order JetAPI should try them (cascade: the next channel is used only if delivery through the previous one fails). whatsapp = WhatsApp, tdlib = personal Telegram account, telegram = Telegram Bot, notify = VK/OK, max = MAX messenger, sms = SMS. If omitted, the account's default routing is used. | |
| reply_to_message_id | No | ID of the message to reply to, taken from an incoming-message webhook. |