---
title: "Create asset reference from existing hash"
method: POST
path: "/api/assets/from-hash"
tags: ["file"]
---

# Create asset reference from existing hash

`POST /api/assets/from-hash`

Creates a new asset reference using an existing asset's hash.
This avoids re-uploading the file content when the asset already exists in storage.
The user can provide their own metadata and tags for the reference.

## Request body

- object
  - `hash` string, required — Hash of the existing asset. Supports Blake3 (blake3:) or SHA256 (sha256:) formats
  - `mime_type` string — MIME type of the asset (e.g., "image/png", "video/mp4")
  - `name` string — Display name for the asset reference (optional)
  - `tags` string[], required — Freeform tags for the asset. Common types include "models", "input", "output", and "temp", but any tag can be used in any order.
  - `user_metadata` object — Custom metadata for this asset reference

## Response `201`

Asset reference 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 hash format, invalid tags, etc.)
- `401` — Unauthorized
- `404` — Source asset with given hash not found
- `500` — Internal server error

## Changes

- **2026-06-03** `8560879e6188` — 7 breaking, 1 warning, 8 info
  - the request property `mime_type` became not nullable
  - the request property `tags` became required
  - the `tags` request property's minItems was increased to `1`
  - added the pattern `^(blake3|sha256):[a-f0-9]{64}$` to the request property `hash`
  - …12 more
- **2026-05-22** `09a5075587c8` — 5 info
  - 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 `404`
  - added the non-success response with the status `500`
  - …1 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
- **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` — 1 info
  - added the new optional request property `mime_type`

[Full history](https://skmtc.dev/comfy-org/apis/comfyui-api/changes/api/assets/from-hash/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)
