Read the tenant's storage use
const url = 'https://api.pixonaut.app/v1/storage';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/storage \ --header 'Authorization: Bearer <token>'Operation ID: storage.get
Bytes used against the quota, counting every finished asset at its full size, and how many there are, in all and by category: library pictures (assets), customers’ design uploads (customerUploads), blanks’ photos (blankPhotos) and everything in the sandbox (sandbox). A workspace and its sandbox share the quota, so both read the same numbers; a copy Sync made counts only once live has deleted the upload it copies. The categories add up to usedBytes and fileCount.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”The tenant’s storage use
object
Every category, in a fixed order, an empty one reading 0.
object
Examples
Example
{ "categories": [ { "bytes": 31457280, "category": "assets", "fileCount": 9 }, { "bytes": 10485760, "category": "customerUploads", "fileCount": 5 }, { "bytes": 10485760, "category": "blankPhotos", "fileCount": 3 }, { "bytes": 0, "category": "sandbox", "fileCount": 0 } ], "fileCount": 17, "quotaBytes": 1073741824, "usedBytes": 52428800}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: 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].