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

# Upload a new asset

`POST /api/assets`

Uploads a new asset to the system with associated metadata.
Supports two upload methods:
1. Direct file upload (multipart/form-data)
2. URL-based upload (application/json with source: "url")

If an asset with the same hash already exists, returns the existing asset.

## Request body

- object
  - `name` string, required — Display name for the asset (used to determine file extension)
  - `preview_id` string, uuid — Optional preview asset ID
  - `tags` string[] — Freeform tags for the asset. Common types include "models", "input", "output", and "temp", but any tag can be used in any order.
  - `url` string, uri, required — HTTP/HTTPS URL to download the asset from
  - `user_metadata` object — Custom metadata to store with the asset

## Response `201`

Asset created successfully

- AssetCreated — Response returned when a new asset is successfully created.
  - `asset_hash` string — Deprecated: use hash instead. Blake3 hash of the asset content.
  - `created_at` string, date-time, required — Timestamp when the asset was created
  - `display_name` string, nullable — Display name of the asset. Mirrors name for backwards compatibility.
  - `hash` string — Blake3 hash of the asset content. Preferred over asset_hash.
  - `id` string, uuid, required — Unique identifier for the asset
  - `is_immutable` boolean — Whether this asset is immutable (cannot be modified or deleted)
  - `job_id` string, uuid, nullable — ID of the job that created this asset, if available
  - `last_access_time` string, date-time — Timestamp when the asset was last accessed
  - `metadata` object — System-managed metadata from download sources (HuggingFace, CivitAI, etc.) - read-only, not user-modifiable
  - `mime_type` string — MIME type of the asset
  - `name` string, required — Name of the asset file
  - `preview_id` string, uuid, nullable — ID of the preview asset if available
  - `preview_url` string, uri — URL for asset preview/thumbnail
  - `size` integer — Size of the asset in bytes
  - `tags` string[] — Tags associated with the asset
  - `updated_at` string, date-time, required — Timestamp when the asset was last updated
  - `user_metadata` object — Custom user metadata for the asset
  - `created_new` boolean, required — Whether this was a new asset creation (true) or returned existing (false)

## Other responses

- `400` — Invalid request (bad file, invalid URL, invalid content type, etc.)
- `401` — Unauthorized
- `403` — Source URL requires authentication or access denied
- `404` — Source URL not found
- `413` — File too large
- `415` — Unsupported media type
- `422` — Download failed due to network error or timeout
- `500` — Internal server error

## Changes

- **2026-06-03** `8560879e6188` — 8 breaking, 5 warning, 11 info
  - the request property `id` became not nullable (media type: multipart/form-data)
  - the request property `name` became required (media type: application/json)
  - the `tags` request property type/format changed from `string`/`` to `array`/`` (media type: multipart/form-data)
  - the `tags` request property type/format changed from `string`/`` to `array`/`` (media type: application/json)
  - …20 more
- **2026-05-22** `09a5075587c8` — 10 info
  - api operation id `createAsset` removed and replaced with `uploadAsset`
  - added the non-success response with the status `400`
  - added the non-success response with the status `401`
  - added the non-success response with the status `403`
  - …6 more
- **2026-05-19** `751ce8e3ddf2` — 2 warning
  - removed the optional property `allOf[#/components/schemas/Asset]/height` from the response with the `201` status
  - removed the optional property `allOf[#/components/schemas/Asset]/width` from the response with the `201` status
- …earlier changes not shown

[Full 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/8560879e6188/schema)
