Update a library asset
const url = 'https://api.pixonaut.app/v1/assets/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"categoryId":"5d8f2a41-9b3c-4d7e-8f1a-2b3c4d5e6f70","expectedUpdatedAt":1760356800000,"name":"Summer logo","tags":["logo","summer"],"visibility":"public"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.pixonaut.app/v1/assets/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "categoryId": "5d8f2a41-9b3c-4d7e-8f1a-2b3c4d5e6f70", "expectedUpdatedAt": 1760356800000, "name": "Summer logo", "tags": [ "logo", "summer" ], "visibility": "public" }'Operation ID: assets.update
Sets the fields the body names and leaves the rest. tags replaces the asset’s tags with this set, each normalised to lowercase with spaces as dashes; categoryId: null clears the category. role moves the asset between a picture and a blank photo; a blank photo is in no category, so becoming one clears it and blank_photo_uncategorised refuses one a category.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
The id of a category, as list_asset_categories returns it, or null to take the picture out of its category.
The picture’s updatedAt, as list_assets returned it. The change is refused if the picture changed since.
Its name per customer-facing language, by code (en, sv, de, fr, es, nl, da, nb, fi), e.g. {"de": "Stern"}. Replaces every name it had; a language left out shows its own name.
object
The picture’s new name; it cannot be empty.
picture, or blank-photo for a blank’s product photo. A blank photo is in no category.
The picture’s whole tag list, replacing the current one: lowercase words, e.g. summer, logo. At most 100.
public lets the picture be offered to customers; private keeps it to the tenant.
Examples
Example
{ "categoryId": "5d8f2a41-9b3c-4d7e-8f1a-2b3c4d5e6f70", "expectedUpdatedAt": 1760356800000, "name": "Summer logo", "tags": [ "logo", "summer" ], "visibility": "public"}Responses
Section titled “Responses”The updated asset
object
Its name per customer-facing language, by code; a language left out shows its own name.
object
picture, or blank-photo for a blank’s product photo, which is in no category and counted in no category or tag.
When the asset’s name, visibility, category or tags last changed: what a PATCH’s expectedUpdatedAt names.
Examples
Example
{ "categoryId": "5d8f2a41-9b3c-4d7e-8f1a-2b3c4d5e6f70", "createdAt": 1760356800000, "heightPx": 3600, "id": "7a3e9b10-2c4d-4e5f-9a6b-1c2d3e4f5a6b", "localizedNames": {}, "mime": "image/png", "name": "Summer logo", "role": "picture", "sizeBytes": 1843200, "tags": [ "logo", "summer" ], "updatedAt": 1760443200000, "visibility": "public", "widthPx": 3000}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
Refused: bad_json
object
Examples
bad_json
{ "error": "bad_json"}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
Refused: unauthorized
object
Examples
unauthorized
{ "error": "unauthorized"}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
Refused: origin_forbidden, forbidden, feature_disabled, workspace_suspended
object
The feature the tenant does not have. Always sent with feature_disabled.
Examples
feature_disabled
{ "error": "feature_disabled", "feature": "api"}forbidden
{ "error": "forbidden"}origin_forbidden
{ "error": "origin_forbidden"}workspace_suspended
{ "error": "workspace_suspended"}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
Refused: not_found
object
Examples
not_found
{ "error": "not_found"}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
Refused: stale_update
object
Always sent with stale_update.
object
Its name per customer-facing language, by code; a language left out shows its own name.
object
picture, or blank-photo for a blank’s product photo, which is in no category and counted in no category or tag.
When the asset’s name, visibility, category or tags last changed: what a PATCH’s expectedUpdatedAt names.
Examples
stale_update
{ "current": { "categoryId": "string", "createdAt": 0, "heightPx": 0, "id": "string", "localizedNames": {}, "mime": "string", "name": "string", "role": "picture", "sizeBytes": 0, "tags": [ "string" ], "updatedAt": 0, "visibility": "public", "widthPx": 0 }, "error": "stale_update"}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
Refused: invalid_tag, unknown_category, blank_photo_uncategorised, payload_too_large, invalid_input, invalid_name, invalid_visibility, invalid_role, invalid_tags
object
Sent with payload_too_large.
Always sent with payload_too_large.
Always sent with invalid_tag.
Examples
blank_photo_uncategorised
{ "error": "blank_photo_uncategorised"}invalid_input
{ "error": "invalid_input"}invalid_name
{ "error": "invalid_name"}invalid_role
{ "error": "invalid_role"}invalid_tag
{ "error": "invalid_tag", "tag": "string"}invalid_tags
{ "error": "invalid_tags"}invalid_visibility
{ "error": "invalid_visibility"}payload_too_large
{ "error": "payload_too_large", "maxBytes": 0}unknown_category
{ "error": "unknown_category"}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
Refused: db_error. A request that failed unexpectedly answers as text instead.
object
Examples
db_error
{ "error": "db_error"}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
Refused: lock_timeout
object
Examples
lock_timeout
{ "error": "lock_timeout"}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
Questions? Write to [email protected].