Skip to main content
POST
Start an upload

Authorizations

x-api-key
string
header
required

ROOTKey API key (rk_live_... for production, rk_test_... for the test network).

Body

application/json
ownerVault
string
required

Address of the vault that will own the file. ownerWallet is accepted as an alias.

Example:

"0xdf67CA8286510997567685c0385ECeAb11C23C92"

fileName
string
required

The file's name, with its extension. This is the name the file shows in the vault.

Maximum string length: 255
Example:

"contract.pdf"

size
integer
required

The file's size in bytes. The bytes you upload must be exactly this long.

Required range: x >= 0
Example:

2621440

sha256
string
required

The SHA-256 of the whole file, as 64 hexadecimal characters. This is the hash that gets anchored.

Pattern: ^[0-9a-fA-F]{64}$
Example:

"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"

contentType
string
required

The file's media type. ROOTKey keeps it for types that browsers do not execute (PDF, images, plain text, CSV, JSON, archives, office documents, audio and video) and stores anything else as application/octet-stream. The Content-Type in the response says which.

Example:

"application/pdf"

parentId
string

Upload a new version of this file instead of a new file. The file must be in the same vault.

expirationDate
string<date-time>

Optional expiry date-time for the smart contract

Response

Upload started. mode says how to send the bytes: single carries one signed URL, multipart carries a part plan.

uploadId
string
Example:

"upl_3f2b8c1e5a7d4e9b9c2a1d6e8f0a4b7c"

fileId
string

The id the file will have once the upload is completed.

mode
enum<string>
Available options:
single
expiresAt
string<date-time>

You can complete the upload until this time.

upload
object