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

# Create asset reference from existing hash

`POST /api/assets/from-hash`

Creates a new asset reference using an existing hash from cloud storage.
This avoids re-uploading file content when the underlying data already exists,
which is useful for large files or when referencing well-known assets.
The user provides their own metadata and tags for the new reference.

## Request body

- object
  - `hash` string, required — Hash of the existing asset. Supports Blake3 (blake3:) or SHA256 (sha256:) formats
  - `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.
  - `mime_type` string — MIME type of the asset (e.g., "image/png", "video/mp4")
  - `user_metadata` object — Custom metadata for this asset reference

## Response `200`

Asset reference already exists (returned existing)

- AssetCreated
  - `id` string, uuid, required — Unique identifier for the asset
  - `name` string, required — Name of the asset file
  - `asset_hash` string — Blake3 hash of the asset content
  - `size` integer, required — Size of the asset in bytes
  - `mime_type` string — MIME type of the asset
  - `tags` string[] — Tags associated with the asset
  - `user_metadata` object — Custom user metadata for the asset
  - `preview_url` string, uri — URL for asset preview/thumbnail
  - `preview_id` string, uuid, nullable — ID of the preview asset if available
  - `prompt_id` string, uuid, nullable — ID of the job/prompt that created this asset, if available
  - `created_at` string, date-time, required — Timestamp when the asset was created
  - `updated_at` string, date-time, required — Timestamp when the asset was last updated
  - `last_access_time` string, date-time — Timestamp when the asset was last accessed
  - `is_immutable` boolean — Whether this asset is immutable (cannot be modified or deleted)
  - `created_new` boolean, required — Whether this was a new asset creation (true) or returned existing (false)

## Other responses

- `201` — Asset reference created successfully
- `400` — Invalid request (bad hash format, invalid tags, etc.)
- `401` — Unauthorized
- `404` — Source asset with given hash not found
- `500` — Internal server error

---

[API](https://skmtc.net/ac/apis/comfy-api.md) · [All operations](https://skmtc.net/ac/apis/comfy-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ac/comfy-api/versions/c1893dffe250/schema)
