Attachments

Upload a reusable attachment

Two modes: with content (base64) the file is uploaded immediately and the attachment is born ready; with size the response carries a signed uploadUrl to PUT the file to (mandatory beyond the few MB accepted in the body). Executable extensions and files over 10 MB are rejected. Required scope: email:send or inbox:send. An attachment uploaded once is reused across sends: pass attachments: [{ id }] to /emails, /messages, /campaigns or /inboxes/{id}/send.

post/attachments

Request

  • Base URL: https://sending.dev/api/v1
  • URL: https://sending.dev/api/v1/attachments
  • Auth: HTTP bearer

Request body

filenamestring required

File name shown to the recipient.

contentTypestring

When absent, it is inferred from the file name.

sizeinteger

File size in bytes: required in signed upload mode (without content).

contentstring

Base64 content for an immediate upload, without the data: prefix.

Response

Attachment created: attachment alone with content, attachment + uploadUrl with size.

uploadUrlstring required

Signed URL to PUT the file to, with the same declared Content-Type and Content-Length.

expiresIninteger required

Validity of the uploadUrl, in seconds.

Example response

{
  "attachment": {
    "filename": "invoice-2026-07.pdf",
    "contentType": "application/pdf",
    "createdAt": "2026-06-30T12:00:00.000Z"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.