Send Video

Send a video file to a chat.

POST
https://api.wawp.net/v2/send/video?access_token=123456789&asNote=false&caption=Watch+this+clip&chatId=201234567890%40c.us&convert=true&file%5Bfilename%5D=video.mp4&file%5Bmimetype%5D=video%2Fmp4&file%5Burl%5D=https%3A%2F%2Fwawp.net%2Fsamples%2Ffile_example_MP4_480_1_5MG.mp4&instance_id=123456789

Authentication Required

Login to swap the placeholders with your real Instance ID and Access Token.

Log In
Test /v2/send/video endpoint
POSTGET

No query parameters required

This endpoint doesn't expect data in the URL.

Best practices

  • Use "reply_to" to maintain conversation context.

  • Handle distinct message types (text, image, video) appropriately.

  • Implement a robust retry mechanism for failed sends.

Moving Pictures: Mastering the Video Messaging Engine

Video is the ultimate medium for complex information delivery, whether it's an educational tutorial, a personalized message from a CEO, or a visually rich product demonstration. The /v2/send/video endpoint is engineered to handle the substantial data and processing requirements of video files, ensuring they arrive on the recipient's phone in a format that is ready for instant playback.


🏗️ The Intelligent Video Processing Pipeline

Unlike basic file transfers, Wawp treats videos as dynamic assets. Our pipeline includes several specialized stages:

  1. Validation & Mime-Type Consistency: The engine checks the file[mimetype] against the actual binary headers. While MP4 is the standard, our engine can handle various containers and normalize them for the WhatsApp network.
  2. The "Conversion" Engine: One of Wawp's most powerful features is the convert flag. When enabled, the engine evaluates the source video's bitrate, resolution, and encoding (H.264/AAC). If the video is likely to be rejected by WhatsApp due to incompatible parameters, Wawp performs a cloud-based re-encoding to ensure a successful delivery.
  3. Stream Buffering: To prevent transient network failures from killing a transfer, our engine uses an adaptive buffering strategy when fetching videos from your remote file[url].

🛡️ Strategic Best Practices for Video Optimization

1. The 16MB Frontier

WhatsApp has a hard limit of 16MB for video transfers on most mobile devices.

  • Developer Action: If your source video is 50MB, do not send it directly. Use a pre-processing tool or our /v2/media/convert utility to bring it under the 16MB threshold.
  • Target Bitrate: Aim for a bitrate of 1.5 Mbps to 2 Mbps with a resolution of 480p or 720p. This strikes the perfect balance between visual clarity and file size safety.

2. Formatting for Success (MP4 vs. Others)

While many formats exist, MP4 (H.264) is the gold standard for Wawp.

  • Universal Playback: By sticking to H.264, you ensure that even users on older Android or iOS devices can play the video instantly without downloading additional codecs.
  • Audio Sync: Always ensure your audio is encoded in AAC at 44.1kHz or 48kHz to prevent "Mute Video" errors on the recipient's device.

3. AsNote: The "Video Note" Advantage

The asNote parameter allows you to send videos in the distinctive circular "Video Note" format.

  • UX Impact: Round video notes feel more personal and spontaneous. They are perfect for "Thank You" messages or quick status updates.
  • Constraint: Video notes are typically limited to 60 seconds and do not support captions. Ensure your content fits these constraints when switching to "Note" mode.

🧩 Advanced Use Cases

Educational Drip Campaigns

Videos are perfect for daily educational content. By using the caption field, you can provide a textual summary of the video's key points. Because Wawp supports full markdown, you can use *bold* headers to make the caption as engaging as the video itself.

Customer Support via Screen-Cast

Instead of explaining a complex UI step-by-step in text, send a 30-second screen-cast. Use the reply_to field to link the video directly to the user's specific support ticket, creating a high-resolution support experience.


🛠️ Common Pitfalls and Solutions

  • Failed Fetches: If your video server is behind a slow connection, the Wawp engine might timeout. Ensure your video host responds to GET requests within 5-10 seconds.
  • The "No Thumbnail" Bug: If a video arrives but the thumbnail is black, it’s often because the first frame of the video is black. Consider fading into your content or ensuring the metadata isn't corrupted.
  • Unsupported Codecs: Attempting to send H.265 (HEVC) or AV1 without setting convert: true may lead to a "Format Not Supported" error on older devices. Always default to true if you aren't 100% sure of your source encoding.

Summary of Capabilities:

  • Deliver high-quality MP4 videos with integrated, markdown-rich captions.
  • Automated cloud-based video re-encoding via the convert flag.
  • Support for the "Video Note" circular format for high-engagement messaging.
  • Remote fetching from any secure HTTPS URL with adaptive buffering.
  • Consistent success reporting with unique message_id generation for full delivery tracking.

Request Parameters

Configure the parameters required to interact with this endpoint. All query and body arguments are listed below with their details.

Request Body

Sent as a JSON object
string

Your unique WhatsApp Instance ID

Example:
string

Your API Access Token

Example:
string

Recipient's WhatsApp ID (JID). Supports Individuals (@c.us), Groups (@g.us), and Newsletters (@newsletter).

Example:
string

Video caption

Example:
boolean

Attempt to convert video to compatible MP4 if needed

Example:
boolean

Send as a round 'Video Note' (if supported by engine)

Example:
string

Publicly accessible URL of the video

Example:
string

Filename for the video

Example:
string

MIME type of the video

Example:

Request Samples

Use these ready-to-go code snippets to integrate our API into your project quickly and efficiently. Choose your preferred language and library.

1const baseUrl = "https://api.wawp.net";
2const endpoint = "/v2/send/video";
3const params = new URLSearchParams({
4 "instance_id": "123456789",
5 "access_token": "123456789"
6}).toString();
7const body = {
8 "chatId": "201234567890@c.us",
9 "caption": "Watch this clip",
10 "convert": "true",
11 "asNote": "false",
12 "file[url]": "https://wawp.net/samples/file_example_MP4_480_1_5MG.mp4",
13 "file[filename]": "video.mp4",
14 "file[mimetype]": "video/mp4"
15};
16
17fetch(`${baseUrl}${endpoint}${params ? '?' + params : ''}`, {
18 method: "POST",
19 headers: { "Content-Type": "application/json" },
20 body: JSON.stringify(body)
21})
22 .then(async (response) => {
23 if (response.ok) {
24 const data = await response.json();
25 console.log("Success:", data);
26 return data;
27 }
28
29 // Error Handling
30 if (response.status === 400) {
31 console.error("Error 400: Bad Request - Missing Required Parameter(s)");
32 }
33 if (response.status === 400) {
34 console.error("Error 400: Bad Request - Invalid Number (Egypt)");
35 }
36 if (response.status === 400) {
37 console.error("Error 400: Bad Request - Invalid Number (Saudi Arabia)");
38 }
39 if (response.status === 400) {
40 console.error("Error 400: Bad Request - Invalid Number (Unknown)");
41 }
42 if (response.status === 400) {
43 console.error("Error 400: Bad Request (XML Format)");
44 }
45 if (response.status === 400) {
46 console.error("Error 400: Bad Request (Plain Text)");
47 }
48 if (response.status === 401) {
49 console.error("Error 401: Unauthorized - Invalid or Missing Access Token");
50 }
51 if (response.status === 401) {
52 console.error("Error 401: Unauthorized (XML Format)");
53 }
54 if (response.status === 404) {
55 console.error("Error 404: Not Found - Session Does Not Exist");
56 }
57 if (response.status === 404) {
58 console.error("Error 404: Not Found (XML Format)");
59 }
60 if (response.status === 429) {
61 console.error("Error 429: Too Many Requests - Rate Limit Exceeded");
62 }
63 if (response.status === 500) {
64 console.error("Error 500: Internal Server Error - Unexpected Failure");
65 }
66 if (response.status === 500) {
67 console.error("Error 500: Internal Server Error (HTML)");
68 }
69 if (response.status === 502) {
70 console.error("Error 502: Bad Gateway - Connection Failed to Upstream");
71 }
72 if (response.status === 502) {
73 console.error("Error 502: Bad Gateway (XML Format)");
74 }
75
76 const errorText = await response.text();
77 console.error(`Error ${response.status}: ${errorText}`);
78 })
79 .catch((error) => console.error("Network Error:", error));
Interactive Samples
Ln 79, Col 1javascript

Expected Responses

Explore all possible responses and outcomes from the server. We have documented each status code with data examples to make success and error handling easier.

Message Sent Successfully
Type:
application/json
object *
string *
object *
number *
boolean *
string *
string *
number *
string *
string *
string *
boolean *
number *
boolean *
boolean *
boolean *
boolean *
boolean *
array *
array *
array *
boolean *
array *

Example

{
"_data": {
  "id": {
    "fromMe": true,
    "remote": "000000000000@c.us",
    "id": "MSG_ID_123456",
    "_serialized": "true_000000000000@c.us_MSG_ID_123456"
    },
  "viewed": false,
  "body": "BASE64_IMAGE_DATA",
  "type": "image",
  "t": 1759108866,
  "from": {
    "server": "c.us",
    "user": "111111111111",
    "_serialized": "111111111111@c.us"
    },
  "to": {
    "server": "c.us",
    "user": "000000000000",
    "_serialized": "000000000000@c.us"
    },
  "ack": 0,
  "isNewMsg": true,
  "star": false,
  "kicNotified": false,
  "caption": "Here's your requested image.",
  "deprecatedMms3Url": "https://example.com/media-url",
  "directPath": "/media/direct/path/example",
  "mimetype": "image/jpeg",
  "filehash": "FILE_HASH_PLACEHOLDER",
  "encFilehash": "ENC_FILE_HASH_PLACEHOLDER",
  "size": 192487,
  "mediaKey": "MEDIA_KEY_PLACEHOLDER",
  "mediaKeyTimestamp": 1759108865,
  "streamable": false,
  "mediaHandle": null,
  "isFromTemplate": false,
  "pollInvalidated": false,
  "isSentCagPollCreation": false,
  "latestEditMsgKey": null,
  "latestEditSenderTimestampMs": null,
  "mentionedJidList": {
    },
  "groupMentions": {
    },
  "isEventCanceled": false,
  "eventInvalidated": false,
  "isVcardOverMmsDocument": false,
  "isForwarded": false,
  "isQuestion": false,
  "questionReplyQuotedMessage": null,
  "questionResponsesCount": 0,
  "readQuestionResponsesCount": 0,
  "labels": {
    },
  "hasReaction": false,
  "disappearingModeInitiator": "chat",
  "disappearingModeTrigger": "chat_settings",
  "productHeaderImageRejected": false,
  "lastPlaybackProgress": 0,
  "isDynamicReplyButtonsMsg": false,
  "isCarouselCard": false,
  "parentMsgId": null,
  "callSilenceReason": null,
  "isVideoCall": false,
  "callDuration": null,
  "callCreator": null,
  "callParticipants": null,
  "isCallLink": null,
  "callLinkToken": null,
  "isMdHistoryMsg": false,
  "stickerSentTs": 0,
  "lastUpdateFromServerTs": 0,
  "invokedBotWid": null,
  "bizBotType": null,
  "botResponseTargetId": null,
  "botPluginType": null,
  "botPluginReferenceIndex": null,
  "botPluginSearchProvider": null,
  "botPluginSearchUrl": null,
  "botPluginSearchQuery": null,
  "botPluginMaybeParent": false,
  "botReelPluginThumbnailCdnUrl": null,
  "botMessageDisclaimerText": null,
  "botMsgBodyType": null,
  "requiresDirectConnection": false,
  "bizContentPlaceholderType": null,
  "hostedBizEncStateMismatch": false,
  "senderOrRecipientAccountTypeHosted": false,
  "placeholderCreatedWhenAccountIsHosted": false,
  "galaxyFlowDisabled": false,
  "links": {
    }
  },
"mediaKey": "MEDIA_KEY_PLACEHOLDER",
"id": {
  "fromMe": true,
  "remote": "000000000000@c.us",
  "id": "MSG_ID_123456",
  "_serialized": "true_000000000000@c.us_MSG_ID_123456"
  },
"ack": 0,
"hasMedia": true,
"body": "Here's your requested image.",
"type": "image",
"timestamp": 1759108866,
"from": "111111111111@c.us",
"to": "000000000000@c.us",
"deviceType": "android",
"isForwarded": false,
"forwardingScore": 0,
"isStatus": false,
"isStarred": false,
"fromMe": true,
"hasQuotedMsg": false,
"hasReaction": false,
"vCards": {
  },
"mentionedIds": {
  },
"groupMentions": {
  },
"isGif": false,
"links": {
  }
}
Bad Request - Missing Required Parameter(s)
Unauthorized - Invalid or Missing Access Token
Not Found - Session Does Not Exist
Too Many Requests - Rate Limit Exceeded
Internal Server Error - Unexpected Failure
Bad Gateway - Connection Failed to Upstream
Previous TopicSend Voice
Next TopicSend Link Preview

Command Palette

Search for a command to run...