Skip to the documentation
API

Upload a template image

Store an image and get its public address for a template.

POST/templates/images

Runs the real call on your workspace.

POST /templates/images

Store an image and get its public address for a template.

Example

Needs templates:write. Send the bytes as the body with their type as Content-Type: PNG, JPEG, WebP, GIF or SVG, up to 5 MB. It is fitted into 1200 by 1800 pixels and stored in a form every mail client shows. Answers 201.

curl
curl -X POST "$OE/templates/images" -H "$AUTH" -H "Content-Type: image/png" \  --data-binary @hero.png
Response
{  "object": "template_image",  "id": "5f0c9a8e-2b7d-4c1e-9a3f-8d6b2e4c7a10",  "url": "https://cdn.openemail.uk/templates/images/8a9c35f0/5f0c9a8e-2b7d-4c1e-9a3f-8d6b2e4c7a10.png",  "size": 48213,  "width": 1200,  "height": 630}

An image of another type, one over 5 MB or one that cannot be read is a 422 invalid_image. A busy image service answers 503 image_busy and a failed save 502 image_not_stored.

Reference