Skip to main content

Send email with attachments

Use POST /sending/messages/with-attachments with your API key as X-API-Key. The message field contains the same JSON message used in Sending email. Add each file using a repeated files field.
Replace the sender with an address on your verified domain. The sender, reply and bounce rules are identical to Sending email: content.from decides what recipients see, content.replyTo decides where replies go, and envelopeSender only changes the bounce address on a verified sending domain. Files must be non-empty, and their combined size must not exceed 5 MB. Your account’s attachment and sending allowances still apply. A successful response means accepted for sending; review delivery activity afterward. Add an Idempotency-Key header to the request if you retry. Repeating the same key with the same message and files returns the original receipt instead of sending twice; the same key with different content returns 409. A problem with the message part returns 400 on this endpoint — missing message, invalid JSON, no recipients, or neither a text nor an HTML body. Sender authorization failures still return 422 with the field named, as they do on the JSON endpoint.

Attach a file from a URL

Send public HTTPS URLs directly with POST /sending/messages:
The service downloads and attaches the file before accepting the message. Use at most 10 URLs on HTTPS port 443, with a combined attachment size of 5 MB. Private/local addresses, credentials in URLs, empty files and redirects are rejected. Use the final download URL; signed query strings are supported. Files must be reachable without cookies or authorization headers. Attachment storage and your account’s sending/attachment allowances must be available.

Upload a file separately

The upload endpoint stores one file, up to 10 MB, when attachment storage is configured:
The response returns data.file with fileName, contentType and sizeBytes, plus publicUrl only when public hosting is configured. A separate upload does not send an email. To attach a file to a message, use the multipart sending example above. These clients upload a file with the same multipart endpoint:

Include multiple files

Repeat files for every attachment. Paths refer to files on the machine running your request. The message can contain plain text, HTML or both.

Node.js: send local files

Node.js 22+ provides fetch, FormData and Blob. Run this on your server, with your sending key in the WAZOBIA_API_KEY environment variable.
Let fetch set the multipart Content-Type and boundary. Setting Content-Type: application/json or a boundary manually will break file uploads. The combined 5 MB attachment limit applies to all files together.