List assets
const url = 'https://api.pixonaut.app/v1/assets?kind=library&role=picture&retention=retained&sort=most-used&upscaleSources=show&page=1&pageSize=24';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.pixonaut.app/v1/assets?kind=library&role=picture&retention=retained&sort=most-used&upscaleSources=show&page=1&pageSize=24' \ --header 'Authorization: Bearer <token>'Operation ID: assets.list
The tenant’s finished assets of every kind, newest first (or with sort=most-used, the ones the most of the tenant’s drafts use first, then by name), a page at a time. An empty filter is the same as leaving it out. role=picture lists the pictures and role=blank-photo the blank photos; absent, both. category=none lists the assets in no category. q matches a name anywhere, or the start of an asset or session id. retention=retained lists what nothing will delete, and auto-delete everything else. ids=a,b narrows to the named assets; an id this tenant does not hold is left out. Each asset says what it was upscaled from; upscaleSources=hide lists an upscale in place of the picture it was made from, when the upscale is listed too.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Responses
Section titled “Responses”A page of assets
object
object
The stored picture’s colour model: cmyk for a CMYK JPEG, kept as uploaded. Null until it was read.
The description of the colour profile the picture embeds, such as sRGB IEC61966-2.1. Null when it embeds none.
Names the asset’s stored bytes, which never change. Pass it as v to /v1/assets/{id}/content and the answer is cached immutable.
Whether any pixel of the picture is not fully opaque. Null until it was read.
Its name per customer-facing language, by code; a language left out shows its own name.
object
A link to a library picture’s preview that opens with no key, for an hour or two. Null for an asset of another kind.
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.
The picture this asset is an upscale of, at the size it was then; null when it is not an upscale.
object
Whether the source is still in the library: false once it was deleted, since the record outlives its source.
The source’s name, or null when it has none or is no longer in the library.
Examples
Example
{ "assets": [ { "categoryId": "5d8f2a41-9b3c-4d7e-8f1a-2b3c4d5e6f70", "colourModel": "rgb", "colourProfile": "sRGB IEC61966-2.1", "contentKey": "ck_4f7a1c9e2b8d", "createdAt": 1760356800000, "expiresAt": 0, "hasAlpha": true, "heightPx": 3600, "id": "7a3e9b10-2c4d-4e5f-9a6b-1c2d3e4f5a6b", "kind": "library", "localizedNames": {}, "mime": "image/png", "name": "Summer logo", "pictureUrl": "https://api.pixonaut.example/i/eyJhdWQiOiJjYXRhbG9ndWUtaW1hZ2UifQ.c2lnbmF0dXJl", "retained": true, "role": "picture", "sessionId": null, "sizeBytes": 1843200, "tags": [ "logo", "summer" ], "templateId": null, "updatedAt": 1760443200000, "upscaledFrom": null, "visibility": "public", "widthPx": 3000 } ], "page": 1, "pageSize": 24, "total": 1}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: invalid_query
object
Examples
invalid_query
{ "error": "invalid_query"}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.
Questions? Write to [email protected].