prawnwire Developers

Attachments

Include files as base64 content, with optional inline content identifiers.

POST/v1/email

Attachment fields

Add an Attachments array to a send request using an email:send key.

FieldTypeRequiredMeaning
NamestringYesNonempty filename, trimmed before use. The extension is checked case-insensitively.
ContentstringYesBase64-encoded file bytes. Whitespace is stripped; padding and base64 syntax are checked.
ContentTypestringNoMIME type. Missing or blank defaults to application/octet-stream.
ContentIDstringNoIdentifier for an inline attachment. Missing or blank means a regular attachment.

The example attaches hello.txt containing Hello, Ada..

Inline images

Give the attachment a ContentID, such as logo, and reference it from HtmlBody with <img src="cid:logo" alt="Your logo">. Use the same identifier in both places.

Size limit

The UTF-8 bytes of both bodies plus decoded attachment bytes must fit within 10 MiB (10,485,760 bytes). Base64 increases the JSON request size, so also respect the HTTP request body limits.

Over the message limit returns ErrorCode 300. An invalid base64 value also returns 300.

Forbidden extensions

These filename extensions return ErrorCode 411:

.vbs, .exe, .bin, .bat, .chm, .com, .cpl, .crt, .hlp, .hta, .inf, .ins, .isp, .jse, .lnk, .mdb, .pcd, .pif, .reg, .scr, .sct, .shs, .vbe, .vba, .wsf, .wsh, .wsl, .msc, .msi, .msp, .mst

Do not rename a forbidden file to bypass the check. Send a download link through your own application when a recipient needs a file that cannot be attached.

Retention

Attachment contents are cleared after the message is sent. Activity retains attachment names, not downloadable file bytes. Keep your own copy if your application needs it later.

Search documentation

Type to search the documentation.