---
title: "Import an asset (image or TTF/OTF font) from base64 or a public URL"
method: POST
path: "/assets/import"
---

# Import an asset (image or TTF/OTF font) from base64 or a public URL

`POST /assets/import`

## Request

- Base URL: `https://rendry.io/api/v1`
- URL: `https://rendry.io/api/v1/assets/import`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer
  - HTTP bearer
  - HTTP bearer

JSON alternative to the multipart POST /assets. Body: {filename, data_base64|url}. Images ≤5MB (inline base64 is additionally bounded by the 2MB request body; for larger files use url, or POST multipart to /assets). Fonts TTF/OTF. Returns the stored asset; its url is a path under /api/v1/files/… that only the owner's key or session can fetch — user assets are private, the renderer reads them internally, so the url works in a layer but is not a link to hand out. Note: MCP tool calls apply a stricter 96KB cap on data_base64 — inline base64 there costs the calling model output tokens.

## Headers

- `X-Rendry-Account` string

## Request body

- object
  - `filename` string, required
  - `data_base64` string
  - `url` string

## Response `201`

Asset created

- Asset: A stored file of the account: an image or a TTF/OTF font.
  - `id` string, required
  - `user_id` string
  - `file_name` string, required
  - `storage_key` string, required: user_assets/{user}/… — what image layers, /images/* and fonts (font_storage_key) refer to
  - `url` string, required: Path under /api/v1/files/… relative to the API origin. NOT a public link: a user asset is served only to its owner's key or session (GET /files/{path}); the renderer reads it internally, so it works in a layer
  - `content_type` string, required
  - `size` integer, required: Bytes
  - `asset_type` 'image' | 'font', required
  - `font_family` string: Fonts only: the family name to put in a text layer's font
  - `created_via` 'web' | 'api' | 'derived': web: uploaded by a person in the browser; api: uploaded with a key; derived: made by a cutout tool
  - `created_at` string, required

## Other responses

- `400`: The upload door's codes: `file_required` (empty file), `unsupported_file_type`, `file_not_image`, `invalid_font_file`, `file_too_large` (with `size` and `limit` in MB); `url_rejected`, `download_failed`; `unknown_field` (a key this door does not read) or `invalid_input`. 503 `service_unavailable` when storage fails.
- `403`: Asset quota exceeded

---

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