---
title: "Upload a new asset"
method: POST
path: "/api/assets"
tags: ["assets"]
---

# Upload a new asset

`POST /api/assets`

Uploads a new asset (binary content plus metadata) and registers it in the asset database.

## Request body

- object — [cloud-only] URL-based asset upload. Caller supplies a URL instead of a file body; the server fetches the content.
  - `url` string, uri, required — [cloud-only] URL of the file to import as an asset
  - `name` string — Display name for the asset
  - `tags` string — Comma-separated tags
  - `user_metadata` string — JSON-encoded user metadata
  - `hash` string — Blake3 hash of the file content (e.g. blake3:abc123...)
  - `mime_type` string — MIME type of the file (overrides auto-detected type)
  - `preview_id` string, uuid — ID of an existing asset to use as the preview image
  - `id` string, uuid, nullable — [cloud-only] Client-supplied asset ID for idempotent creation. If an asset with this ID already exists, the existing asset is returned.

## Response `201`

Asset created

- AssetCreated — A registered asset — an input/output file tracked in the asset database with content hash and metadata.
  - `id` string, uuid, required — Unique identifier for the asset
  - `name` string, required — Name of the asset file
  - `hash` string, nullable — Blake3 content hash of the asset (preferred over asset_hash)
  - `asset_hash` string, nullable — Deprecated: use `hash` instead. Blake3 hash of the asset content.
  - `size` integer, required — Size of the asset in bytes
  - `width` integer, nullable — Original image width in pixels. Null for non-image assets or assets ingested before dimension extraction.
  - `height` integer, nullable — Original image height in pixels. Null for non-image assets or assets ingested before dimension extraction.
  - `mime_type` string — MIME type of the asset
  - `tags` string[] — Tags associated with the asset
  - `user_metadata` object — Custom user metadata
  - `metadata` object — System-managed metadata (read-only)
  - `preview_url` string, uri — URL for asset preview/thumbnail
  - `preview_id` string, uuid — ID of the preview asset if available
  - `prompt_id` string, uuid, nullable — Deprecated: use job_id instead. ID of the prompt that created this asset.
  - `job_id` string, uuid, nullable — ID of the job that created this asset
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `last_access_time` string, date-time
  - `is_immutable` boolean — Whether this asset is immutable
  - `created_new` boolean, required — Whether this was a new creation (true) or returned existing (false)

## Changes

- **2026-05-08** `c9640fded659` — 2 breaking, 6 info
  - the response property `allOf[#/components/schemas/Asset]/asset_hash` became nullable for the status `201`
  - the response property `allOf[#/components/schemas/Asset]/prompt_id` became nullable for the status `201`
  - added the optional property `allOf[#/components/schemas/Asset]/hash` to the response with the `201` status
  - added the optional property `allOf[#/components/schemas/Asset]/height` to the response with the `201` status
  - …4 more
- **2026-05-05** `0d50eed29d03` — 2 info
  - added the new optional request property `id`
  - added the media type `application/json` to the request body
- **2026-04-24** `a66055fa384e` — 1 breaking, 6 warning, 12 info
  - removed the success response with the status `200`
  - removed the request property `id`
  - removed the optional property `allOf[#/components/schemas/Asset]/display_name` from the response with the `201` status
  - removed the optional property `allOf[#/components/schemas/Asset]/file_path` from the response with the `201` status
  - …15 more

[Change history](https://skmtc.dev/comfy-org/apis/comfyui-api/changes/api/assets/post.md)

---

[API](https://skmtc.dev/comfy-org/apis/comfyui-api.md) · [All operations](https://skmtc.dev/comfy-org/apis/comfyui-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/comfy-org/comfyui-api/revisions/2f69d843959c/schema)
