1MSG

Send a File

POST
/sendFile

Send a file to an existing chat. (Only if the dialogue has an Open Session). Only one destination parameter is needed - chatId, phone, or bsuid. In BSUID-centric routing, chatId can be [email protected], bsuid@lid, [email protected], or username@username. The phone field accepts a phone number or BSUID; bsuid can be passed separately.

Two modes:

  • URL / base64: pass body + filename (legacy).
  • By mediaId: pass numeric WABA mediaId from /uploadMedia together with mediaType (image|video|audio|document). Do not send body and mediaId together.

For a native WhatsApp voice note, send audio (preferably OGG/OPUS) with voice: true (works with URL/base64 or mediaId + mediaType=audio).

Stickers: use /sendSticker instead of /sendFile.

Authorization

JWT token
querytoken<token>

Request Body

  1. body
body?string

File source when not using mediaId:

  • HTTP/HTTPS URL (https://...)
  • Base64 data URI, e.g. data:image/jpeg;base64,/9j/...
  • File in form-data input field

Required together with filename, unless mediaId + mediaType are used.

filename?string

File name with extension, e.g. 1.jpg or hello.xlsx. Required with body; not required when sending by mediaId.

caption?string

Text under the file. When sending an image сan be used with mentionedPhones, example: this image for @556123122026

mediaId?string

Numeric WABA media id from /uploadMedia. Alternative to body/filename. Requires mediaType. Do not combine with body.

mediaType?string

Required when using mediaId. Not used for stickers — use /sendSticker.

Value in"image""video""audio""document"
voice?boolean

If true and the media is audio, send as a native WhatsApp voice note. Prefer OGG/OPUS. Works with URL/base64 or mediaId + mediaType=audio.

Defaultfalse
quotedMsgId?string

Quoted message ID (Cloud API)

chatId?string

Required if phone and bsuid are not set

Chat ID from the message list. Examples: [email protected], RU.1504711984690866@lid, username@username, or [email protected] (group). Used instead of the phone parameter.

phone?string

Required if chatId and bsuid are not set

Recipient identifier. Accepts a phone number starting with the country code, or a BSUID such as RU.1504711984690866.

Use chatId for full chat IDs: [email protected], bsuid@lid, username@username, or [email protected].

bsuid?string

Optional alternative to phone/chatId

Recipient BSUID without the @lid suffix. Example: RU.1504711984690866.

Response Body

Server response example

application/json
  1. response
sent?boolean
id?string

unique message id

message?string

Posting status message

description?string

Result description

curl -X POST 'https://api.1msg.io/123/sendFile' \  -H 'Content-Type: application/json' \  -d '{  "body": "https://example.com/file.pdf",  "filename": "invoice.pdf",  "caption": "Your invoice",  "phone": "12020721369"}'
{  "sent": true,  "id": "gBGGeRhGZTEfAgkJCh2wAz4ZH-8",  "message": "Sent to [email protected]",  "description": "Message has been sent to the provider"}