Skip to content

Update a library asset

PATCH
/v1/assets/{id}
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.

id
required
string
Media typeapplication/json
object
categoryId

The id of a category, as list_asset_categories returns it, or null to take the picture out of its category.

string | null
expectedUpdatedAt

The picture’s updatedAt, as list_assets returned it. The change is refused if the picture changed since.

integer
localizedNames

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
da
string
>= 1 characters <= 120 characters
de
string
>= 1 characters <= 120 characters
en
string
>= 1 characters <= 120 characters
es
string
>= 1 characters <= 120 characters
fi
string
>= 1 characters <= 120 characters
fr
string
>= 1 characters <= 120 characters
nb
string
>= 1 characters <= 120 characters
nl
string
>= 1 characters <= 120 characters
sv
string
>= 1 characters <= 120 characters
name

The picture’s new name; it cannot be empty.

string
>= 1 characters <= 200 characters
role

picture, or blank-photo for a blank’s product photo. A blank photo is in no category.

string
Allowed values: picture blank-photo
tags

The picture’s whole tag list, replacing the current one: lowercase words, e.g. summer, logo. At most 100.

Array<string>
<= 100 items
visibility

public lets the picture be offered to customers; private keeps it to the tenant.

string
Allowed values: public private

Examples

Exampleexample

Example

{
"categoryId": "5d8f2a41-9b3c-4d7e-8f1a-2b3c4d5e6f70",
"expectedUpdatedAt": 1760356800000,
"name": "Summer logo",
"tags": [
"logo",
"summer"
],
"visibility": "public"
}

The updated asset

Media typeapplication/json
object
categoryId
required
string | null
createdAt
required
number
heightPx
required
number | null
id
required
string
localizedNames
required

Its name per customer-facing language, by code; a language left out shows its own name.

object
key
additional properties
string
mime
required
string
name
required
string | null
role
required

picture, or blank-photo for a blank’s product photo, which is in no category and counted in no category or tag.

string
sizeBytes
required
number
tags
required
Array<string>
updatedAt
required

When the asset’s name, visibility, category or tags last changed: what a PATCH’s expectedUpdatedAt names.

number
visibility
required
string
widthPx
required
number | null

Examples

Exampleexample

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
}
X-Request-Id
required
string

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

Media typeapplication/json
object
error
required
string

Examples

Examplebad_json

bad_json

{
"error": "bad_json"
}
X-Request-Id
required
string

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

Media typeapplication/json
object
error
required
string

Examples

Exampleunauthorized

unauthorized

{
"error": "unauthorized"
}
X-Request-Id
required
string

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

Media typeapplication/json
object
error
required
string
feature

The feature the tenant does not have. Always sent with feature_disabled.

string

Examples

feature_disabled

{
"error": "feature_disabled",
"feature": "api"
}
X-Request-Id
required
string

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

Media typeapplication/json
object
error
required
string

Examples

Examplenot_found

not_found

{
"error": "not_found"
}
X-Request-Id
required
string

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

Media typeapplication/json
object
current

Always sent with stale_update.

object
categoryId
required
string | null
createdAt
required
number
heightPx
required
number | null
id
required
string
localizedNames
required

Its name per customer-facing language, by code; a language left out shows its own name.

object
key
additional properties
string
mime
required
string
name
required
string | null
role
required

picture, or blank-photo for a blank’s product photo, which is in no category and counted in no category or tag.

string
sizeBytes
required
number
tags
required
Array<string>
updatedAt
required

When the asset’s name, visibility, category or tags last changed: what a PATCH’s expectedUpdatedAt names.

number
visibility
required
string
widthPx
required
number | null
error
required
string

Examples

Examplestale_update

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"
}
X-Request-Id
required
string

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

Media typeapplication/json
object
bytes

Sent with payload_too_large.

number
error
required
string
maxBytes

Always sent with payload_too_large.

number
tag

Always sent with invalid_tag.

string

Examples

blank_photo_uncategorised

{
"error": "blank_photo_uncategorised"
}
X-Request-Id
required
string

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
error
required
string

Examples

Exampledb_error

db_error

{
"error": "db_error"
}
X-Request-Id
required
string

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

Media typeapplication/json
object
error
required
string

Examples

Examplelock_timeout

lock_timeout

{
"error": "lock_timeout"
}
X-Request-Id
required
string

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].

Status · Terms of service · Privacy policy · Subprocessors