Skip to content

Upload a file's bytes

PUT
/u/{token}
curl --request PUT \
--url https://api.pixonaut.app/u/example

Operation ID: assets.upload

The uploadUrl POST /v1/assets answered with. The body is the file itself, exactly the mime and the number of bytes declared there; no key is needed, since the signed token in the path is the credential. A small image is accepted with a warning (and warningKey, warningParams for translation) rather than refused.

token
required
string

The file is stored

Media typeapplication/json
object
assetId
required
string
contentKey
required

The asset’s contentKey, as its listing reports it: pass it as v to /v1/assets/{id}/content and the answer is cached immutable.

string
effectiveDpi
required
number | null
heightPx
required
number
improveResolution
required

Set when this upload is below the minimum print resolution at its size and may be improved before the proof (POST /v1/assets/{id}/improve-resolution), to this size: the template allows upscaling, the tenant’s plan and credits cover it, and the shortfall is within one upscale. Null otherwise.

object
heightPx
required
number
widthPx
required
number
warning
required
string | null
warningKey
required
string | null
warningParams
required
Any of:
object
actualPx
required
number
minPx
number
widthPx
required
number

Examples

Exampleexample

Example

{
"assetId": "7a3e9b10-2c4d-4e5f-9a6b-1c2d3e4f5a6b",
"contentKey": "ck_4f7a1c9e2b8d",
"effectiveDpi": 300,
"heightPx": 3600,
"improveResolution": null,
"warning": null,
"warningKey": null,
"warningParams": null,
"widthPx": 3000
}
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: unknown_upload

Media typeapplication/json
object
error
required
string

Examples

Exampleunknown_upload

unknown_upload

{
"error": "unknown_upload"
}
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: upload_expired

Media typeapplication/json
object
error
required
string

Examples

Exampleupload_expired

upload_expired

{
"error": "upload_expired"
}
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: size_mismatch, unsupported_mime, animation_not_supported, not_a_valid_image, pixel_dimensions_too_large, size_out_of_bounds

Media typeapplication/json
object
allowed

Always sent with unsupported_mime.

Array<string>
error
required
string
heightPx

Always sent with pixel_dimensions_too_large, pixel_dimensions_too_large.

number
maxBytes

Always sent with size_out_of_bounds.

number
maxEdgePx

Always sent with pixel_dimensions_too_large.

number
maxPixels

Always sent with pixel_dimensions_too_large.

number
widthPx

Always sent with pixel_dimensions_too_large, pixel_dimensions_too_large.

number

Examples

animation_not_supported

{
"error": "animation_not_supported"
}
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: preview_failed. A request that failed unexpectedly answers as text instead.

object
error
required
string

Examples

Examplepreview_failed

preview_failed

{
"error": "preview_failed"
}
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

Media typeapplication/json
object
error
required
string

Examples

Examplelock_timeout

lock_timeout

{
"error": "lock_timeout"
}
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