Skip to main content
POST
Upload a file

Authorizations

x-api-key
string
header
required

API key for authentication. You can find your API key in the Creem dashboard under Settings > API Keys.

Body

application/json
purpose
enum<string>
required

What the file is for. product_file: a file a product delivers to its buyers.

Available options:
product_file
Example:

"product_file"

filename
string
required

The name buyers download the file under. Path segments and control characters are removed, and it is cut to 255 bytes of UTF-8.

Maximum string length: 1024
Example:

"ebook.epub"

content_type
string
required

The media type of the file, without parameters. Any type is accepted; the file is not inspected, and it always downloads rather than opens in the browser. The upload must send the same Content-Type.

Maximum string length: 255
Example:

"application/epub+zip"

size
integer<int64>
required

The size of the file in bytes, at most 5 GB (5368709120 bytes). The upload must be exactly this size.

Required range: 1 <= x <= 5368709120
Example:

52000

sha256
string
required

The SHA-256 of the file, base64-encoded (44 characters). Storage refuses bytes that hash to anything else, and the confirmed file returns it as sha256.

Example:

"n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg="

Response

Where and until when to upload the file

id
string
required

The id of the upload. Confirm it with POST /v1/files/{id}/confirm; the file keeps this id once confirmed.

Example:

"file_4dGTkmBdnTnU9vV3KZ2Hcz"

upload_url
string
required

Where to upload the file: a multipart/form-data POST with every upload_fields entry first and the file last, in a field named file.

Example:

"https://creem-files.s3.eu-west-1.amazonaws.com/"

upload_fields
object
required

The form fields to send with the upload, unchanged and before the file.

Example:
expires_at
string<date-time>
required

When the upload expires (ISO 8601). Upload and confirm the file before then.

Example:

"2026-11-17T11:00:00.000Z"