Read an asset
const url = 'https://api.pixonaut.app/v1/assets/example';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/example \ --header 'Authorization: Bearer <token>'Operation ID: assets.get
One finished asset of any kind. Its bytes are at /v1/assets/{id}/content and /v1/assets/{id}/original.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Responses
Section titled “Responses”The asset
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
{ "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": { "assetId": "3c1d8e72-5a4b-4f9e-8d2c-7b6a5e4d3c2b", "inLibrary": true, "name": "Summer logo, small", "sourceHeightPx": 900, "sourceWidthPx": 750 }, "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: 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: 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].