Base URL
https://app.dmu.email/api/v1
Authentication
Bearer dmk_… API key
Rate limit
120 requests a minute per key

Upload an attachment

POST/drafts/{id}/attachments

Adds a file to a draft. This call reserves its place and returns a URL to upload it to; the file goes straight to storage, never through the API.

Needs the permissionattachments:create

An upload takes three steps: this call; a PUT of the file to uploadUrl, with the same Content-Type as the mimeType you gave; then Confirm an upload. The URL works for ten minutes.

size is checked before you upload anything, so a file that’s too big is refused now rather than after it has gone up. A file can be up to 25 MB, and a message can have 25 of them.

Confirm every upload

Until it’s confirmed, the file is only a reservation. A draft sent with an unconfirmed file doesn’t go without it: the send fails, and Get a message says which file never arrived.

Path parameters

idstringrequired
The draft.

Body

filenamestringrequired
The name recipients will see.
sizenumberrequired
Its size in bytes.
mimeTypestringoptional
Such as application/pdf.

Returns

attachmentIdstring
The file. Confirm it with this id once it’s uploaded.
uploadUrlstring
Where to PUT the file.

Errors

400filename_required
There’s no filename.
400size_required
size isn’t a number of bytes above zero.
400attachment_rejected
The file is too big, the draft has 25 already, or it was refused for a reason the message gives.
401invalid_key
The key is wrong, expired or revoked. With no Authorization header at all, the code is missing_credentials.
403missing_scope
The key doesn’t have attachments:create. The X-Required-Scope header names what’s missing.
404not_found
There’s no such draft, or the key’s owner can’t see it.
429rate_limited
More than 120 requests a minute from this key. Wait for Retry-After seconds.
curl https://app.dmu.email/api/v1/drafts/8c1e2f4a/attachments \
  -X POST \
  -H "Authorization: Bearer dmk_7f3a9c2e1b4d_Xq8v…" \
  -H "Content-Type: application/json" \
  -d '{
    "filename": "delivery-note.pdf",
    "size": 84213,
    "mimeType": "application/pdf"
  }'

Response

200 OK

{
  "data": {
    "attachmentId": "1f6c8d33",
    "uploadUrl": "https://…"
  }
}

Every response wraps its result in data. A page of threads adds nextCursor, which is null on the last page.