Upload attachments for emails

Upload a file with a POST request. The response returns the file identifier you pass when you send the campaign.

Method description

POST https://api.maestra.io/v3/files/upload?endpointId={integration point system name}&fileKind=attachment

Accept: application/json
Content-Type: multipart/form-data
Authorization: SecretKey {Secret key}

Query parameters

ParameterValue
endpointIdUnique identifier of the site, mobile app, etc.
fileKindattachment

Headers

HeaderValue
Acceptapplication/json
Content-Typemultipart/form-data
AuthorizationSecretKey {Secret key}
📘

Secret key

Ask your manager for the secret key.

❗️

Maximum upload size

25 MB per file.

The request always carries the Content-Type: multipart/form-data header. That type requires a boundary parameter, which marks where each attachment starts and ends. Postman adds it automatically when you test there.

Each file is uploaded with its own Content-Type.

Supported Content-Types

KindContent-Type
Documentsapplication/msword
application/pdf
application/rtf
application/vnd.oasis.opendocument.text
application/vnd.openxmlformats-officedocument.wordprocessingml.document
Spreadsheetsapplication/vnd.ms-excel
application/vnd.oasis.opendocument.spreadsheet
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Presentationsapplication/vnd.ms-powerpoint
application/vnd.oasis.opendocument.presentation
application/vnd.openxmlformats-officedocument.presentationml.presentation
Graphics documentsapplication/vnd.oasis.opendocument.graphics
Archivesapplication/x-7z-compressed
application/x-rar-compressed
application/zip
Imagesimage/gif
image/jpeg
image/pjpeg
image/png
image/svg+xml
image/tiff
image/vnd.microsoft.icon
Text and webtext/html
text/plain
Calendartext/calendar
Videovideo/mp4
video/mpeg

Example request

POST https://api.maestra.io/v3/files/upload?endpointId=test.test&fileKind=attachment

Accept: application/json
Content-Type: multipart/form-data;
				boundary="gc0p4Jq0M2Yt08jU534c0p"
Authorization: SecretKey ***********

Example response

{
  "fileId": "065773e7-4eef-4b32-8306-db5103bb3e9f"
}
👍

Sending the campaign

Pass the attachment's unique key in the operation contract. No special setup is needed in the campaign interface.