Skip to content

Check whether the tenant already stores a file

GET
/v1/asset-duplicate/{sha256hex}
curl --request GET \
--url https://api.pixonaut.app/v1/asset-duplicate/example \
--header 'Authorization: Bearer <token>'

Operation ID: assets.checkDuplicate

Asks by the file’s SHA-256, in lowercase hex, before uploading it. Advisory: uploading a duplicate is allowed, and counts against the quota again.

sha256hex
required
string
/^[0-9a-f]{64}$/

Whether the bytes are stored, and as which asset (the earliest)

Media typeapplication/json
Any of:
object
exists
required
boolean

Examples

Exampleexample

Example

{
"assetId": "7a3e9b10-2c4d-4e5f-9a6b-1c2d3e4f5a6b",
"exists": true,
"name": "Summer logo"
}
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: 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: invalid_hash

Media typeapplication/json
object
error
required
string

Examples

Exampleinvalid_hash

invalid_hash

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

Questions? Write to [email protected].

Status · Terms of service · Privacy policy · Subprocessors