Skip to main content
POST
/
api
/
v1
/
campaigns
/
upload-attachment
curl -X POST "https://api.usegately.com/api/v1/campaigns/upload-attachment" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "X-Project-ID: YOUR_PROJECT_ID" \
  -F "file=@/path/to/report.pdf"
{
  "success": true,
  "attachment": {
    "content": "JVBERi0xLjQKJcOkw7zDtsO...",
    "filename": "report.pdf",
    "type": "application/pdf",
    "size": 204800,
    "disposition": "attachment"
  },
  "message": "File uploaded successfully"
}
Accepts a multipart/form-data upload and returns the file encoded as base64. Pass the returned attachment object directly into the attachments array of Send Campaign. Limits
  • Max file size: 10 MB per file
  • Allowed types: PDF, Word, Excel, plain text, CSV, JPEG, PNG, GIF, WebP

Headers

Authorization
string
required
Bearer YOUR_API_KEY
X-Project-ID
string
Your project UUID. Not required if the API key already encodes the project.

Request Body

file
file
required
The file to upload (multipart/form-data)

Response

success
boolean
true on successful upload
attachment
object
Ready-to-use attachment object
message
string
Human-readable confirmation
curl -X POST "https://api.usegately.com/api/v1/campaigns/upload-attachment" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "X-Project-ID: YOUR_PROJECT_ID" \
  -F "file=@/path/to/report.pdf"
{
  "success": true,
  "attachment": {
    "content": "JVBERi0xLjQKJcOkw7zDtsO...",
    "filename": "report.pdf",
    "type": "application/pdf",
    "size": 204800,
    "disposition": "attachment"
  },
  "message": "File uploaded successfully"
}