Updating Assets
Asset content is considered immutable. This is done to simplify HTTP cache semantics. You cannot change an asset's
content at a given entryId. Depending on how you use the entryId, you have a few options:
- To truly "replace" the asset, you can delete the asset and then upload a new one
- If using the
entryIdas a versioning mechanism, you can POST the new asset to the path. Doing so lets you fetch the newest asset by default when callingGET /assets/your/pathsince the default ordering selector isnew.
Asset information can be updated, however. This includes:
alt- Labels
- Tags
Updating asset information
To update asset information, you must PUT to the asset using the entryId. Relative selectors such as order are not
allowed.
PUT /assets follows RESTful PUT semantics. The entire payload must be supplied and all fields are
overwritten.
PUT is a complete replacement of the asset information. Even if updating one field, the rest of the fields must be supplied, or they will be erased.
To update asset information:
PUT /assets/users/123/-/entry/0
Content-Type: application/json
{
"alt": "Profile Picture",
"tags": ["headshot", "team"],
"labels": {
"department": "engineering"
}
}
Cache-Control
Updating asset information automatically changes the asset's ETag.
Even though the binary content has not changed, the ETag must rotate because information fields like alt are often served
alongside the content (e.g., in the Konifer-Alt header). Rotating the ETag ensures that CDNs and browsers re-fetch the
asset to receive the updated accessibility information.