Skip to main content
POST
/
api
/
sendFile
Send a file
curl --request POST \
  --url https://{host}/api/sendFile \
  --header 'Content-Type: application/json' \
  --header 'apikey: <api-key>' \
  --data '{
  "session": "session",
  "chatId": "5511999999999@c.us",
  "url": "https://example.com/file.pdf",
  "filename": "document.pdf"
}'
{
  "success": true,
  "messageId": "3EB0XXXXXX"
}

Description

This endpoint allows you to send files of any type (documents, PDFs, spreadsheets, etc.) to individual contacts or groups on WhatsApp. The file must be sent in base64 format with the mimetype and file name specified.

Body

{
  "sessionId": "my-session",
  "jid": "5511999999999@s.whatsapp.net",
  "file": {
    "content": "iVBORw0KGgoAAAANSUhEUgAAAA...",
    "mimetype": "image/png",
    "filename": "document.pdf"
  }
}

Body Parameters

PropertyTypeRequiredDescription
sessionIdstring✅ YesAuthenticated session ID that will send the file
jidstring✅ YesRecipient identifier (WhatsApp JID). Format: 5511999999999@s.whatsapp.net for contacts or 120363XXXXX@g.us for groups
fileobject✅ YesObject containing the file information
file.contentstring✅ YesFile content encoded in base64
file.mimetypestring✅ YesFile MIME type (example: application/pdf, application/vnd.ms-excel, application/zip)
file.filenamestring✅ YesFile name with extension (example: document.pdf, spreadsheet.xlsx)
{
  "success": true,
  "messageId": "3EB0XXXXXX"
}

Status Codes

  • 200 - File sent successfully
  • 400 - Invalid parameters
  • 401 - Unauthorized session
  • 404 - Session not found

Usage Example

curl -X POST https://api.wappfy.com.br/api/sendFile \
  -H "Content-Type: application/json" \
  -d '{
    "sessionId": "my-session",
    "jid": "5511999999999@s.whatsapp.net",
    "file": {
      "content": "JVBERi0xLjQKJeLjz9MKMy...",
      "mimetype": "application/pdf",
      "filename": "relatorio.pdf"
    }
  }'

Authorizations

apikey
string
header
required

Your Wappfy API key (get it at dash.wappfy.com.br)

Body

application/json
chatId
string
required

Chat ID (WhatsApp JID)

Example:

"5511999999999@c.us"

file
object
required

File (remote URL or base64 data)

  • Option 1
  • Option 2
session
string
required

Session name (instanceName)

Example:

"my-session"

reply_to
string

Message ID you want to reply to

Example:

null

caption
string

Caption/text that accompanies the file

Response

201 - application/json

The response is of type object.

I