Skip to content

Send messages

Send video

Send a video with an optional caption over WhatsApp, Instagram or Messenger.

Send a video with POST /v1/messages and type: "video". Fields shared by every type (to, reply_to, typing, delay_ms, the 24 h window) are in Common fields.

Janela do terminal
curl -X POST https://api.messajo.com/v1/messages \
-H "Authorization: Bearer $MESSAJO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"connection_id": "con_123",
"to": "5511999990000",
"type": "video",
"video": {
"link": "https://cdn.exemplo.com/video.mp4",
"caption": "How to assemble it"
}
}'

The response is 201 with id (msg_…), status: "queued" and conversation_id. The final state arrives by webhook.

Provide exactly one of link and media_id. Sending both, or neither, returns 400 validation_failed with exactly one of media_id or link is required.

  • link: URL of the video.
  • media_id (med_…): comes from POST /v1/media, a multipart/form-data request with file (and connection_id, unless the key is a mjc_… connection key). Requires the send permission. The type is read from the file bytes, not from the extension.
Janela do terminal
curl -X POST https://api.messajo.com/v1/media \
-H "Authorization: Bearer $MESSAJO_API_KEY" \
-F connection_id=con_123 \

The upload returns the media id (med_…), which you pass as video.media_id.

  • video.caption: caption up to 1024 characters.
  • Upload: up to 16 MiB. The upload recognises the video/mp4 and video/3gpp containers.

The body is the same, with two differences:

  • link must be https.
  • There is no caption. Sending one returns 422 type_not_supported_by_channel pointing at video.caption. Send the caption as a separate text message.
Channel Max size Formats
Instagram 25 MiB video/mp4, video/ogg, video/x-msvideo, video/quicktime, video/webm
Messenger 25 MiB video/mp4
Code Status When
validation_failed 400 link and media_id together, or neither
media_too_large 413 File above the limit
media_type_not_supported 415 Format the channel does not accept
media_error 422 Meta could not process the media
type_not_supported_by_channel 422 caption on Instagram or Messenger
outside_service_window 422 Free-form message outside the 24 h window

Details for each code are in the error catalog.