Skip to main content
You can attach files to an email in three ways. Pick the one that matches how often you send the file.

Attach a file inline

Send the file encoded in base64 with its filename. The filename must include an extension, and the content must match it: a file named receipt.pdf must actually be a PDF.
You can also send a multipart request, with each file in an attachments[] field. Use the same filename rules.

Reuse a file with the Files API

Upload a file once, then reference it by its file_id in as many emails as you like.
The response includes an id starting with file_. Use it in attachments:
Uploading the same content again returns the existing file, so it is safe to upload before each send. GET /api/v1/files lists your files and GET /api/v1/files/{id} returns one of them.

Embed an image inline

To show an image inside the HTML, give it a content_id and point the src at cid: followed by that id. In multipart, send the file in inline[<content_id>].
Each content_id must be unique within the email.

Limits

File types that mail providers block are refused with attachment_type_not_allowed. This covers executables and scripts, such as .exe, .bat, .js, .vbs, .ps1, .msi and .mdb. For these, zip the file or share a link instead. For formats with a known signature (PDF, PNG, JPEG, GIF, WebP, ZIP, DOCX, XLSX, PPTX, ODT, ODS), the content must match the extension. Otherwise the request fails with attachment_content_mismatch.

Storage and retention

By default, PulseSend keeps a copy of each attachment so you can download it from the dashboard or the API. Set store to false to delete the bytes as soon as the email is handed to the provider. The email keeps the file name, type and size. Stored attachments follow the same retention as the email content: they are deleted after 30 days, and the name, type and size remain.

Download an attachment

Each attachment comes with a download_url, valid for 5 minutes. Request the list again when you need a fresh link.

Errors