Skip to content

Direct Upload

POST
/api/v1/upload/direct
UploadRequest

The main request model for uploading a file, containing the blob details.

object
blob
required
BlobDetails

An object containing all necessary metadata about the file blob.

object
filename
required
Filename

The original name of the file being uploaded.

string
content_type
required
Content Type

The MIME type of the file (e.g., ‘image/png’ or ‘application/pdf’).

string
byte_size
required
Byte Size

The size of the file in bytes.

integer
checksum
required
Checksum

A cryptographic checksum (e.g., Base64 encoded SHA-256 hash) for data integrity verification.

string

Successful Response

FileUploadResponse

The complete response model for a successful file record creation or lookup.

object
id
required
Id

The unique database ID of the file record.

integer
key
required
Key

The unique key used by the storage service (e.g., S3 key or Active Storage key).

string
filename
required
Filename

The original name of the file.

string
content_type
required
Content Type

The MIME type of the file.

string
metadata
required
Metadata

An object containing additional, service-specific metadata (currently empty).

object
key
additional properties
any
service_name
required
Service Name

The name of the storage service used (e.g., ‘amazon’).

string
byte_size
required
Byte Size

The size of the file in bytes.

integer
checksum
required
Checksum

The content hash (e.g., Base64 SHA-256) for data integrity.

string
created_at
required
Created At

Timestamp when the file record was created.

string format: date-time
signed_id
required
Signed Id

A globally unique, signed identifier for the file record.

string
direct_upload
Any of:
DirectUploadDetails

Details for a direct upload, typically containing a pre-signed URL and necessary headers.

object
url
required
Url

The pre-signed URL to upload the file directly to the storage service (e.g., AWS S3).

string
headers
required
DirectUploadHeaders

A dictionary of required headers for the PUT request to the upload URL.

object
Content-Type
required
Content-Type

The MIME type of the content (e.g., image/png).

string
Content-MD5
required
Content-Md5

The Base64 encoded MD5 hash of the file content for integrity check.

string
Content-Disposition
required
Content-Disposition

Suggested filename for saving the content.

string

Direct upload or common resource creation failed upstream

ErrorResponse
object
detail
Any of:
string
error
Any of:
string
error_code
Any of:
string

Not Found

ErrorResponse
object
detail
Any of:
string
error
Any of:
string
error_code
Any of:
string

Validation Error

HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string

Internal Server Error

ErrorResponse
object
detail
Any of:
string
error
Any of:
string
error_code
Any of:
string