Documentation Index
Fetch the complete documentation index at: https://docs.unosend.co/llms.txt
Use this file to discover all available pages before exploring further.
Upload files to Unosend’s file cache and reuse them across multiple email sends without re-uploading. Cached files are referenced by their file_cache_key in subsequent API calls.
The filename including extension (e.g., logo.png, invoice.pdf).
The file content as multipart/form-data.
Request
curl -X POST "https://api.unosend.co/v1/files?name=logo.png" \
-H "Authorization: Bearer un_xxxxxxxxxx" \
-F "file=@/path/to/logo.png"
Response
{
"message": "OK",
"data": {
"file_cache_key": "fc_1a2b3c4d5e6f",
"name": "logo.png",
"size": 24576,
"content_type": "image/png",
"created_at": "2026-01-15T10:30:00.000Z"
}
}
Using Cached Files in Emails
Reference the file_cache_key when sending emails:
{
"from": {"address": "hello@yourdomain.com", "name": "Your App"},
"to": [{"email_address": {"address": "user@example.com"}}],
"subject": "Your Invoice",
"htmlbody": "<p>Please find your invoice attached.</p>",
"attachments": [
{
"file_cache_key": "fc_1a2b3c4d5e6f",
"name": "invoice.pdf"
}
]
}
Inline Images
Use cid to embed images inline in HTML:
{
"htmlbody": "<img src='cid:logo' />",
"inline_images": [
{
"file_cache_key": "fc_1a2b3c4d5e6f",
"cid": "logo"
}
]
}
- Maximum file size: 10 MB
- Total email size (headers + body + attachments): 15 MB
- Cached files are stored for 30 days from last use