Skip to main content
Sending a file through the API is two calls: first you upload the file and get an identifier, then you send the message referencing that identifier.
There’s no single call that receives the file and sends it. Trying to send the file directly to the sending endpoint results in an error. Everything here uses the messages:create scope, the same one used for sending text. If your key already sends messages, it already sends files.

Step 1: upload the file

1

Send the file as multipart/form-data

Two required fields: file with the binary and fileType with the category.
cURL
2

Save the _id from the response

The response carries the attachment record. The field that matters for step 2 is the _id:
The attachment stays saved and can be reused. To send the same file to several contacts, upload it once and use the same _id in each send.

fileType values

The fileType from the upload must match the sending endpoint. Uploading as DOCUMENT and trying to send through send-image doesn’t work.

Step 2: send to the conversation

The body is JSON, with the target conversation and the message object:

message fields

The contentAttributes.inReplyToExternalId field is deprecated and has no effect. To reply quoting a message, use quoteSourceId.

Quoting a message

quoteSourceId expects the id of the message on the channel, not Nuvia’s _id. Sending the _id quotes nothing and returns no error. That value arrives in the source_id field of every message returned by GET /v1/messages/conversation/{id}. Read it from there and send it back in quoteSourceId. The quoted message has to belong to the same conversation.

Limits

  • Upload: up to 100 MB per file.
  • WhatsApp: images up to 5 MB, audio and video up to 16 MB, documents up to 100 MB. The channel limit applies even if the upload accepted the file, so a 50 MB video uploads but doesn’t reach the contact.
  • Formats: only those accepted by WhatsApp, listed in the table above.

Common errors

Next steps

API reference

All the sending endpoints, with parameters and responses.

Integration examples

Complete end-to-end use cases.