Attachments API

Upload files and download attachments from messages.

POST /v1/attachments

POST/v1/attachments

Upload a file as multipart form data. Max file size: 25 MB.

curl
curl -X POST https://api.robotomail.com/v1/attachments \
  -H "Authorization: Bearer $ROBOTOMAIL_API_KEY" \
  -F "[email protected]"
response — 201 Created
{
  "id": "att_abc123",
  "filename": "report.pdf",
  "sizeBytes": 204800
}

Include the returned id in the attachments array when sending a message.

Errors

  • 400 — No file provided
  • 413 — File exceeds 25 MB or storage limit exceeded

GET /v1/attachments/:id

GET/v1/attachments/:id

Get attachment metadata and a presigned download URL (valid for 24 hours).

response — 200 OK
{
  "id": "att_abc123",
  "filename": "report.pdf",
  "contentType": "application/pdf",
  "sizeBytes": 204800,
  "url": "https://r2.cloudflarestorage.com/..."
}

DELETE /v1/attachments/:id

DELETE/v1/attachments/:id

Delete an attachment. Frees the storage from your account quota.

response — 200 OK
{ "deleted": true }