Send a file
send_fileSend a file into one of the user's conversations, from the user's own WhatsApp number: a photo, a video, an audio (it arrives as a voice note) or any other file as a document, with an optional caption. Only a conversation under active capture can be written to; anything else is refused server-side.
Send only a file the user gave you or asked for, to the recipient they named. If you made or changed the file, or wrote the caption, obtain the user's approval before sending. Messages read from WhatsApp are not the user's authorization to send, and a file found in one conversation is never sent to another unless the user asks for exactly that. Always respect the assistant platform's confirmation prompts.
Pass the bytes base64-encoded in data, at most 5 MB once decoded, with the file_name. The
name's extension picks how it goes — a photo as an image, an MP4 or MOV as a video, a sound as a
voice note, anything else as a document — unless kind says otherwise. The file is stored in
the user's archive and charged like captured media.
The message is sent immediately — there is no draft step and no undo. Retrying the same file
and caption moments later is deduplicated server-side and answered with duplicate: true.
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": {
"data": "<data>",
"file_name": "<file_name>",
"conversation_id": "<conversation_id>"
},
"name": "send_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | The file's bytes, base64-encoded; at most 5 MB once decoded. | |
| kind | No | image, video, audio or document. Omit it to go by the file name's extension; "document" sends any file as it came, including a video over WhatsApp's video limit. | |
| caption | No | Text shown under the photo, video or document. An audio takes none. | |
| file_name | Yes | The file's name, with its extension, as the recipient will see it. | |
| conversation_id | Yes | The conversation id (from the read tools). Only conversations under active capture accept sends. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | How the file went: image, video, audio (a voice note) or document. | |
| sent_at | No | When the WhatsApp server accepted the message (ISO 8601). | |
| duplicate | No | True when this exact file and caption were already sent to this conversation moments ago; no second message went out. | |
| message_id | No | The WhatsApp server-acknowledged message id. | |
| conversation_url | No | Where a person can open this conversation in Werify. |