Improve a customer's upload before the proof
const url = 'https://api.pixonaut.app/v1/assets/example/improve-resolution';const options = {method: 'POST', 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 POST \ --url https://api.pixonaut.app/v1/assets/example/improve-resolution \ --header 'Authorization: Bearer <token>'Operation ID: assets.improveResolution
Upscales a customer’s upload that is below its picture’s upscale density (upscale.belowDpi on the picture’s constraints, else the minimum print resolution) at the size it was uploaded for, to the size at which it reaches the picture’s target density (upscale.toDpi, else that density), into a new design upload for the same layer; the upload is left as it was. Offered by the upload’s own answer (improveResolution) only where the picture it was uploaded into offers an upscale, the tenant’s credits cover it, the upload is short of the target too, and the shortfall is within one upscale. Takes no size: the upload decides it. Each upload is improved at most once: asked again once delivered, it answers the same improved upload (200) and charges nothing. Paid from the tenant’s credits when delivered.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”The designer’s browser session, which the SDK sends so one visitor’s uploads and proofs are told apart from another’s on the same key: 6 to 64 letters, digits, _ or -. Any other value is ignored.
The designer’s browser session, which the SDK sends so one visitor’s uploads and proofs are told apart from another’s on the same key: 6 to 64 letters, digits, _ or -. Any other value is ignored.
Responses
Section titled “Responses”The improved upload, delivered already: asked again, as when an answer was lost
object
Examples
Example
{ "assetId": "c41d0e2f-8b7a-4c6d-9e1f-2a3b4c5d6e7f", "contentKey": "ck_9b2e4d6f1a3c", "heightPx": 1773, "sourceAssetId": "7a3e9b10-2c4d-4e5f-9a6b-1c2d3e4f5a6b", "widthPx": 1418}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.
The improved upload
object
Examples
Example
{ "assetId": "c41d0e2f-8b7a-4c6d-9e1f-2a3b4c5d6e7f", "contentKey": "ck_9b2e4d6f1a3c", "heightPx": 1773, "sourceAssetId": "7a3e9b10-2c4d-4e5f-9a6b-1c2d3e4f5a6b", "widthPx": 1418}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: insufficient_credits. The tenant’s credits cannot cover this action, its spending cap has no room left for it, it is on the Free plan and Free workspaces together have reached the platform’s daily ceiling on credit spending (it resets at midnight UTC), a storefront’s customer asked and the tenant’s daily storefront ceiling has no room left, or the account that created the tenant has not confirmed its email address yet, so none of it was done. reason says which: balance, spending_cap, free_plan_ceiling, storefront_ceiling or email_unverified. requiredCredits, availableCredits and reason are left out for a publishable key.
object
Always sent with insufficient_credits.
Always sent with insufficient_credits.
Always sent with insufficient_credits.
Examples
insufficient_credits
{ "error": "insufficient_credits"}insufficient_credits (requiredCredits, availableCredits, reason)
{ "availableCredits": 0, "error": "insufficient_credits", "reason": "email_unverified", "requiredCredits": 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: 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: already_improved
object
Examples
already_improved
{ "error": "already_improved"}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_improvable, payload_too_large
object
Sent with payload_too_large.
Always sent with payload_too_large.
Examples
not_improvable
{ "error": "not_improvable"}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: rate_limited
object
Examples
rate_limited
{ "error": "rate_limited"}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.
Refused: lock_timeout, upscale_unavailable, upscale_failed, upscale_timed_out, aborted
object
Examples
aborted
{ "error": "aborted"}lock_timeout
{ "error": "lock_timeout"}upscale_failed
{ "error": "upscale_failed"}upscale_timed_out
{ "error": "upscale_timed_out"}upscale_unavailable
{ "error": "upscale_unavailable"}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: storage_quota_exceeded. The tenant’s storage quota would be exceeded. usedBytes and quotaBytes are left out for a publishable key.
object
Always sent with storage_quota_exceeded.
Always sent with storage_quota_exceeded.
Examples
storage_quota_exceeded
{ "error": "storage_quota_exceeded"}storage_quota_exceeded (usedBytes, quotaBytes)
{ "error": "storage_quota_exceeded", "quotaBytes": 0, "usedBytes": 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.
Questions? Write to [email protected].