---
title: "Update asset metadata"
method: PUT
path: "/api/assets/{id}"
tags: ["file"]
---

# Update asset metadata

`PUT /api/assets/{id}`

Updates an asset's metadata. At least one field must be provided.
Only name, mime_type, preview_id, and user_metadata can be updated.
For tag management, use POST (add) and DELETE (remove) /api/assets/{id}/tags.

## Path parameters

- `id` string, uuid, required

## Request body

- object
  - `mime_type` string — Updated MIME type of the asset
  - `name` string — New display name for the asset
  - `preview_id` string, uuid — Updated preview asset ID
  - `user_metadata` object — Updated custom metadata

## Response `200`

Asset updated successfully

- AssetUpdated — Response returned when an existing asset is successfully updated.
  - `display_name` string, nullable — Display name of the asset. Mirrors name for backwards compatibility.
  - `file_path` string, nullable — Relative path in global-namespace-root form (e.g. "models/checkpoints/flux.safetensors")
  - `hash` string — Blake3 hash of the asset content.
  - `id` string, uuid, required — Asset ID
  - `job_id` string, uuid, nullable — ID of the job that created this asset, if available
  - `loader_path` string, nullable — The bare value a loader widget consumes for this asset. For models it is the path inside the category folder (e.g. "flux.safetensors" for "models/checkpoints/flux.safetensors"), which is what the model resolver matches. For input/output/temp it is the content hash, because those assets are fetched by hash rather than staged by name — that is the value LoadImage-style widgets must carry. Clients add the "[output]"/"[temp]" annotation from the asset's own type, so it is never included here. Null when no such value can be derived.
  - `mime_type` string — Updated MIME type of the asset
  - `name` string — Updated name of the asset
  - `tags` string[] — Tags associated with the asset
  - `updated_at` string, date-time, required — Timestamp of the update
  - `user_metadata` object — Updated custom metadata

## Other responses

- `400` — Invalid request — no fields provided, or `preview_id` is the zero UUID (`INVALID_PREVIEW_ID`).
- `401` — Unauthorized
- `404` — Asset not found — returned both when the asset being updated does not exist and when `preview_id` does not reference an asset accessible to the caller.
- `500` — Internal server error

---

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