---
title: "Library images API"
description: "The images your templates embed."
url: https://www.unitpost.com/docs/platform/library-images
section: "Platform API reference"
updated: 2026-10-13
---
# Library images API

> The images your templates embed. Upload from a URL or as base64; a template takes an image's `path` (`/img/…`). A delete is refused while something uses the image, unless you force it.

Full schemas: [OpenAPI 3.1](https://www.unitpost.com/api/v1/openapi.json). HTML reference: https://www.unitpost.com/docs/platform/library-images.

## Operations

### `GET /api/v1/library-images`

List images

The workspace's image library, newest first: the images a template embeds. Each image's `path` (`/img/…`) is what a template's `<Image src>` (or `<img src>`) takes; `url` is its public address. Requires the `templates:read` capability.

Reference: https://www.unitpost.com/docs/platform/get-library-images ([Markdown](https://www.unitpost.com/docs/platform/get-library-images.md))

### `POST /api/v1/library-images`

Upload an image

Add an image to the library from a public https `url` (fetched once, no redirects, no private addresses) or base64 `data` with its `content_type`: PNG, JPEG, GIF or WebP up to 5 MB and 16,384 px a side (50 megapixels at most), counted against the plan's image storage (`403 limit_reached`). Send an `Idempotency-Key` so a retried upload stores one image. Requires the `templates:write` capability.

Reference: https://www.unitpost.com/docs/platform/post-library-images ([Markdown](https://www.unitpost.com/docs/platform/post-library-images.md))

### `GET /api/v1/library-images/{id}`

Retrieve an image

One library image. Requires the `templates:read` capability.

Reference: https://www.unitpost.com/docs/platform/get-library-images-id ([Markdown](https://www.unitpost.com/docs/platform/get-library-images-id.md))

### `PATCH /api/v1/library-images/{id}`

Update an image

Change the alt text the image suggests when it's inserted. Requires the `templates:write` capability.

Reference: https://www.unitpost.com/docs/platform/patch-library-images-id ([Markdown](https://www.unitpost.com/docs/platform/patch-library-images-id.md))

### `DELETE /api/v1/library-images/{id}`

Delete an image

Remove an image from the library. While a template, a campaign or sent mail uses it, the answer is `409 resource_in_use` naming them (`details[]`); `force=true` deletes it anyway, as the dashboard's "Delete anyway" does: those emails then show a broken image wherever it isn't cached yet. Requires the `templates:write` capability.

Reference: https://www.unitpost.com/docs/platform/delete-library-images-id ([Markdown](https://www.unitpost.com/docs/platform/delete-library-images-id.md))
