Skip to content

Images

A document can use two kinds of image:

  • images you upload to your account, referenced as asset:<id>;
  • images embedded in the HTML as data: URLs.

Nothing else loads. An <img> that points at a web address is skipped and reported, because the service never fetches an address from a template.

Upload a PNG or JPEG in the portal, under Images, or with the API. The request body is the raw image:

Terminal window
curl -X POST "https://api.example.com/v1/assets?name=logo.png" \
-H "Authorization: Bearer $RUSTEDF_KEY" \
--data-binary @logo.png
{
"id": "0194f2c0-…",
"name": "logo.png",
"content_type": "image/png",
"size": 8123,
"reference": "asset:0194f2c0-…",
"created_at": 1760000000
}

Use the reference as the image source:

<img src="asset:0194f2c0-…" width="120" alt="Company logo">

The reference can also come from your data: <img src="{{ logo }}"> with "logo": "asset:0194f2c0-…".

  • PNG and JPEG only, up to 5 MB each. The type is checked from the file itself, not its name.
  • Your plan limits the total size of your images; see Plans and credits.
  • Images are private to your account. Another account’s image id does not resolve in your documents.
  • Delete an image with DELETE /v1/assets/{id}. Documents that still reference it render without it.

For a small image that changes with every document, such as a QR code, embed it directly:

<img src="data:image/png;base64,iVBORw0KGgo…">

Very large or very high-resolution images are refused with a note rather than slowing the render.