Skip to main content

Attachments Overview

Attachments in SendSeven are first-class, re-usable resources. You upload a file once, get back a UUID, and reference that UUID anywhere a message or campaign needs media -- as many times as you want, across as many channels as you want.

Why re-usable?

  • Upload once, send many times. A product image used in 50 outbound messages is uploaded a single time and stored a single time.
  • Smaller request payloads. Sending a message with "attachments": ["<uuid>"] is a few bytes; re-sending the binary every time would be megabytes.
  • Cleaner API surface. Messages, campaigns, WhatsApp templates and interactive messages all reference the same attachment object.
  • Cross-channel. The same attachment UUID can be sent to a WhatsApp contact and an Email recipient (assuming the file type is supported on each channel).

Lifecycle

1. Upload  -->  POST /api/v1/attachments/upload     (multipart binary)
OR
POST /api/v1/attachments/from-url (URL fetched server-side)

2. Receive --> { "id": "<uuid>", "attachment_id": "<uuid>", ... }

3. Use --> POST /api/v1/messages
{ ..., "attachments": ["<uuid>"] }

4. Reuse --> Reference the same "<uuid>" again, on any channel,
in any message or campaign. No re-upload.

The file is stored once in object storage. The attachment row carries tenant_id, so attachments are strictly scoped to your tenant -- another tenant cannot reference your UUID.

Required scopes

ScopePurpose
messages:createUpload attachments (both /upload and /from-url)
messages:readDownload attachment bytes / fetch metadata
messages:deleteDelete an attachment

Two ways to upload

You have...Use
A file on disk (or a Blob / Buffer in your app)POST /api/v1/attachments/upload
A public URL where the file already livesPOST /api/v1/attachments/from-url

Both endpoints return the same response shape, so the rest of your code (sending the message) is identical.

Next