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
| Parameter | Value |
|---|---|
endpointId | Unique identifier of the site, mobile app, etc. |
fileKind | attachment |
Headers
| Header | Value |
|---|---|
Accept | application/json |
Content-Type | multipart/form-data |
Authorization | SecretKey {Secret key} |
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
| Kind | Content-Type |
|---|---|
| Documents | application/mswordapplication/pdfapplication/rtfapplication/vnd.oasis.opendocument.textapplication/vnd.openxmlformats-officedocument.wordprocessingml.document |
| Spreadsheets | application/vnd.ms-excelapplication/vnd.oasis.opendocument.spreadsheetapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
| Presentations | application/vnd.ms-powerpointapplication/vnd.oasis.opendocument.presentationapplication/vnd.openxmlformats-officedocument.presentationml.presentation |
| Graphics documents | application/vnd.oasis.opendocument.graphics |
| Archives | application/x-7z-compressedapplication/x-rar-compressedapplication/zip |
| Images | image/gifimage/jpegimage/pjpegimage/pngimage/svg+xmlimage/tiffimage/vnd.microsoft.icon |
| Text and web | text/htmltext/plain |
| Calendar | text/calendar |
| Video | video/mp4video/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"
}Updated about 3 hours ago

