Image Uploads
Upload and manage images for your email templates.
Image Uploads
Upload images to use in your email templates. Templated stores images in cloud storage and serves them via CDN for fast delivery.
Upload an image
curl -b cookies.txt -X POST \
https://app.templated.email/api/accounts/{slug}/images \
-F "file=@/path/to/image.png"Returns the uploaded image metadata including the CDN URL you can use in templates.
Supported formats
| Format | Max size |
|---|---|
| PNG | 5 MB |
| JPEG | 5 MB |
| GIF | 5 MB |
| WebP | 5 MB |
| SVG | 1 MB |
Response
{
"url": "https://cdn.templated.email/images/acme/hero.png",
"key": "images/acme/hero.png",
"size": 48213,
"contentType": "image/png",
"width": 1200,
"height": 600
}Use the returned url as the src of an ImageBlock. Uploaded images are immutable — to change an image, upload a new one and update the template.
Unsplash integration
Search and use royalty-free photos from Unsplash directly:
Search photos
curl -b cookies.txt \
"https://app.templated.email/api/accounts/{slug}/integrations/unsplash/search?query=office+workspace"Download a photo
curl -b cookies.txt -X POST \
https://app.templated.email/api/accounts/{slug}/integrations/unsplash/download \
-H "Content-Type: application/json" \
-d '{ "downloadLocation": "https://api.unsplash.com/photos/abc123/download?ixid=..." }'Pass the download_location URL from the search result's links object. This registers the download (required by Unsplash's API terms); use the photo's regular URL in your template afterwards.
Best practices for email images
- Optimize file size — Large images slow down email load times. Aim for under 200 KB per image.
- Use appropriate dimensions — Email max width is typically 600px. Don't upload 4000px images.
- Always include alt text — Set alt text in your template for accessibility and image-blocking email clients.
- Use CDN URLs — Always use the returned CDN URL, not the upload URL.
Next steps
- Create templates using uploaded images
- Test endpoints in the API Reference