Create asset

POST /assets

Creates an asset and returns a presigned URL for uploading its associated file. Returns a 422 error if quota limits are exceeded.

To upload the file, perform a PUT request to the returned upload URL with the following headers: Content-Type, Content-Length, and x-amz-checksum-sha256, using the same values as those provided in the asset creation request.

The file must be uploaded and validated using the complete operation within 60 minutes of asset creation.

Request body✻

Content application/json

Documentation

Properties

appIdstring

format: uuid

Documentation

Example
"3f483b7c-ae82-44ac-94f1-0820861fef29"

checksumstring✻

The base64 encoded, 256-bit SHA256 digest of the asset file.

44..44 characters

Documentation

Example
"PMn3M4bMd4BMeNhBEDZNQLYxOa6l0luM+IrDA3pZlpY="

contentTypestring✻

The MIME type of the asset file.

1..255 characters

Documentation

Examples
"application/pdf"
"image/png"

filenamestring✻

The name of the asset file.

1..255 characters

Documentation

Examples
"document.pdf"
"image.png"

sizeinteger✻

The size of the asset file in bytes. Must be a positive integer not exceeding 20 MiB.

<=20971520>=1

Documentation

Examples
1024
5242880

Responses

    201Created

Content application/json

Documentation

Properties

idstring✻

format: uuid

Documentation

Example
"cf0102d1-3d48-4467-9887-da4d390267c6"

appIdstring✻

format: uuid

Documentation

Example
"3f483b7c-ae82-44ac-94f1-0820861fef29"

userIdstring✻

format: uuid

Documentation

Example
"3f483b7c-ae82-44ac-94f1-0820861fef29"

storageKeystring✻

The unique storage key for the asset.

Documentation

Example
"3a7cf05d-1416-4dc6-8531-2e18037e7f1f"

checksumstring✻

The base64 encoded, 256-bit SHA256 digest of the asset file.

44..44 characters

Documentation

Example
"PMn3M4bMd4BMeNhBEDZNQLYxOa6l0luM+IrDA3pZlpY="

contentTypestring✻

The MIME type of the asset file.

1..255 characters

Documentation

Examples
"application/pdf"
"image/png"

filenamestring✻

The name of the asset file.

1..255 characters

Documentation

Examples
"document.pdf"
"image.png"

sizeinteger✻

The size of the asset file in bytes. Must be a positive integer not exceeding 20 MiB.

<=20971520>=1

Documentation

Examples
1024
5242880

statusstring✻

The asset is awaiting upload completion and cannot be downloaded until the upload process is complete.

"uploadable"

Documentation

uploadUrlstring✻

A presigned URL for upload or download operations expiring after 60 minutes.

format: uri

Documentation

Example
"https://object-storage.hedia.com/bucket/key?X-Amz-Expires=3600&X-Amz-Signature=signature"

createdobject✻

Information about the creation of an entity.

Documentation

Properties

atstring✻

format: date-time

Documentation

Example
"2023-10-05T14:48:00.000Z"

byobject✻

Documentation

Properties

id✻

typestring✻

"app""system""user"

Documentation

updatedobject

Information about the update of an entity.

Documentation

Properties

atstring✻

format: date-time

Documentation

Example
"2023-10-05T14:48:00.000Z"

byobject✻

Documentation

Properties

id✻

typestring✻

"app""system""user"

Documentation

Security

Servers

    asset.hedia.comhttps://asset.hedia.com/api/v1