---
title: "Upload a template image"
description: "Store an image and get its public address for a template."
url: "https://openemail.uk/docs/api/templates/upload-image"
area: "API"
category: "Mailbox"
---

# Upload a template image

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

`POST /templates/images`

## 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

- [`POST /templates/images`](https://openemail.uk/docs/api/reference/templates#post-templates-images): full reference
