Media
Upload a file once and send it by id, or download what customers send you.
EndpointsKey permission
- POST
/v1/mediaUpload a file (multipart)media:write - GET
/v1/mediaList files (?kind, ?cursor, ?limit)media:write - GET
/v1/media/{id}File details - GET
/v1/media/{id}/contentDownload the bytesmedia:write - DELETE
/v1/media/{id}media:write
Uploading
Send the file as the file field of a multipart/form-data request. The response is 201 with the media object. Uploading the exact same bytes again returns 200 with the existing object instead of a copy.
POST /v1/media
Shell
curl https://engage.swastik.ai/v1/media \
-H "Authorization: Bearer $ENGAGE_API_KEY" \
-F "file=@./brochure.pdf"Response · 201
JSON
{
"id": "6a1f0c2e-…",
"kind": "document",
"mime": "application/pdf",
"size_bytes": 482113,
"filename": "brochure.pdf",
"direction": "out",
"url": "/v1/media/6a1f0c2e-…/content",
"created_at": "2026-11-11T10:30:00Z"
}Then send it with { "type": "document", "document": { "media_id": "6a1f0c2e-…" } }.
Downloading
Images, voice notes and documents that customers send arrive in message.received and are stored by Engage with direction: "in". Fetch the bytes with GET /v1/media/{id}/content and your API key — the url field is a path on the API host, not a public link.
Download
Shell
curl https://engage.swastik.ai/v1/media/6a1f0c2e-…/content \
-H "Authorization: Bearer $ENGAGE_API_KEY" \
-o brochure.pdfSomething unclear or missing on this page? Tell us at contact@swastik.ai