Skip to content

Improve a customer's upload before the proof

POST
/v1/assets/{id}/improve-resolution
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.

id
required
string
x-pixonaut-session

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.

string

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 improved upload, delivered already: asked again, as when an answer was lost

Media typeapplication/json
object
assetId
required
string
contentKey
required
string
heightPx
required
number
sourceAssetId
required
string
widthPx
required
number

Examples

Exampleexample

Example

{
"assetId": "c41d0e2f-8b7a-4c6d-9e1f-2a3b4c5d6e7f",
"contentKey": "ck_9b2e4d6f1a3c",
"heightPx": 1773,
"sourceAssetId": "7a3e9b10-2c4d-4e5f-9a6b-1c2d3e4f5a6b",
"widthPx": 1418
}
X-Request-Id
required
string

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

Media typeapplication/json
object
assetId
required
string
contentKey
required
string
heightPx
required
number
sourceAssetId
required
string
widthPx
required
number

Examples

Exampleexample

Example

{
"assetId": "c41d0e2f-8b7a-4c6d-9e1f-2a3b4c5d6e7f",
"contentKey": "ck_9b2e4d6f1a3c",
"heightPx": 1773,
"sourceAssetId": "7a3e9b10-2c4d-4e5f-9a6b-1c2d3e4f5a6b",
"widthPx": 1418
}
X-Request-Id
required
string

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

Media typeapplication/json
object
error
required
string

Examples

Exampleunauthorized

unauthorized

{
"error": "unauthorized"
}
X-Request-Id
required
string

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.

Media typeapplication/json
object
availableCredits

Always sent with insufficient_credits.

number
error
required
string
reason

Always sent with insufficient_credits.

string
requiredCredits

Always sent with insufficient_credits.

number

Examples

insufficient_credits

{
"error": "insufficient_credits"
}
X-Request-Id
required
string

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

Media typeapplication/json
object
error
required
string
feature

The feature the tenant does not have. Always sent with feature_disabled.

string

Examples

feature_disabled

{
"error": "feature_disabled",
"feature": "api"
}
X-Request-Id
required
string

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

Media typeapplication/json
object
error
required
string

Examples

Examplenot_found

not_found

{
"error": "not_found"
}
X-Request-Id
required
string

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

Media typeapplication/json
object
error
required
string

Examples

Examplealready_improved

already_improved

{
"error": "already_improved"
}
X-Request-Id
required
string

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

Media typeapplication/json
object
bytes

Sent with payload_too_large.

number
error
required
string
maxBytes

Always sent with payload_too_large.

number

Examples

not_improvable

{
"error": "not_improvable"
}
X-Request-Id
required
string

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

Media typeapplication/json
object
error
required
string

Examples

Examplerate_limited

rate_limited

{
"error": "rate_limited"
}
X-Request-Id
required
string

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
error
required
string

Examples

Exampledb_error

db_error

{
"error": "db_error"
}
X-Request-Id
required
string

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

Media typeapplication/json
object
error
required
string

Examples

aborted

{
"error": "aborted"
}
X-Request-Id
required
string

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.

Media typeapplication/json
object
error
required
string
quotaBytes

Always sent with storage_quota_exceeded.

number
usedBytes

Always sent with storage_quota_exceeded.

number

Examples

storage_quota_exceeded

{
"error": "storage_quota_exceeded"
}
X-Request-Id
required
string

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].

Status · Terms of service · Privacy policy · Subprocessors