Skip to main content
POST
Start an upload

Authorizations

x-api-key
string
header
required

ROOTKey API key. A test key works on your organization's test data and a live key on its live data; both are used with the same API.

Headers

X-RootKey-Organization
string

The organization a personal access token acts in: the id of one of the organizations that GET /organizations lists. Required with a personal access token on every endpoint that works inside an organization; without it the request gets organization_header_required. Ignored with an API key, which belongs to exactly one organization.

x-test-mode
enum<string>
default:false

Whether a personal access token works on live data (false, the default) or on test data (true). Only this header decides, never a query string or a body field. An API key is itself a test or a live key and works on that data.

Available options:
true,
false

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