---
title: "Upload an image for emails"
method: POST
path: "/images"
tags: ["Images"]
---

# Upload an image for emails

`POST /images`

## Request

- Base URL: `https://sending.dev/api/v1`
- URL: `https://sending.dev/api/v1/images`
- Auth: HTTP bearer

Returns the public URL to use as the `src` of an image block or inside the html of a campaign. Source: base64 `content` or a public https `url`; png, jpeg, gif or webp, max 5 MB.

Deliberately separate from attachments: an attachment travels inside the message and lives in a private prefix, an image is downloaded by the mail client and so must live at a public URL. An attachment id used as `src` would give a broken image in every inbox. Required scope: `campaigns:write`.

## Request body

- ImageUpload
  - `filename` string, required
  - `content` string
  - `url` string, uri
  - `contentType` string

## Response `201`

Image uploaded.

- Image
  - `id` string, uuid, required
  - `filename` string, required
  - `url` string, required: Public URL: this is what goes in the image block.
  - `contentType` string, required
  - `size` integer, required
  - `createdAt` string, required

## Other responses

- `401`: Missing or invalid token.
- `402`: Plan quota exceeded.
- `403`: Insufficient scope.
- `422`: Invalid input.

---

[API](https://skmtc.dev/sending/apis/sending-dev-api.md) · [All operations](https://skmtc.dev/sending/apis/sending-dev-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sending/apis/sending-dev-api/revisions/9fe78d2918a1?raw)
