Retain or delete assets in bulk
const url = 'https://api.pixonaut.app/v1/assets/bulk';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"action":"retain","ids":["7a3e9b10-2c4d-4e5f-9a6b-1c2d3e4f5a6b","b8c9d0e1-f2a3-4b4c-8d5e-6f7a8b9c0d1e"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.pixonaut.app/v1/assets/bulk \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "action": "retain", "ids": [ "7a3e9b10-2c4d-4e5f-9a6b-1c2d3e4f5a6b", "b8c9d0e1-f2a3-4b4c-8d5e-6f7a8b9c0d1e" ] }'Operation ID: assets.bulkUpdate
Answers every id on its own, in results, so one refusal does not fail the rest. retain keeps design uploads from being deleted when the tenant’s retention runs out; any other id answers not_found. delete deletes assets of either kind, refusing each one as DELETE /v1/assets/{id} would, and a design upload an order holds as order_referenced.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Examples
Example
{ "action": "retain", "ids": [ "7a3e9b10-2c4d-4e5f-9a6b-1c2d3e4f5a6b", "b8c9d0e1-f2a3-4b4c-8d5e-6f7a8b9c0d1e" ]}Responses
Section titled “Responses”Each id’s answer
object
Examples
Example
{ "results": [ { "id": "7a3e9b10-2c4d-4e5f-9a6b-1c2d3e4f5a6b", "ok": true }, { "error": "not_found", "id": "b8c9d0e1-f2a3-4b4c-8d5e-6f7a8b9c0d1e", "ok": false } ]}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: payload_too_large, invalid_input
object
Sent with payload_too_large.
Always sent with payload_too_large.
Examples
invalid_input
{ "error": "invalid_input"}payload_too_large
{ "error": "payload_too_large", "maxBytes": 0}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].