Skip to navigation

Create Encrypted File Upload

View as Markdown

Step 1 of a file share. Reserves an upload slot for exactly ciphertext_size bytes of KNF1 ciphertext and returns a presigned URL. Step 2: PUT the ciphertext to upload_url with exactly upload_headers. Step 3: call POST /api/v1/files/{fileKey}/complete to receive the download URL. The file name and MIME type are encrypted inside the ciphertext and never sent in plaintext.

Authentication

AuthorizationBearer

Konfidant API key (kf_live_... or kf_test_...), created by an organization admin in the dashboard.

Request

This endpoint expects an object.
ciphertext_sizeintegerRequired>=1

Exact size in bytes of the KNF1 ciphertext that will be uploaded. Checked against the plan’s file size limit (allowing for KNF1 overhead) and the monthly storage quota.

ttl_hoursintegerOptional>=1

Lifetime of the share link in hours. Optional; defaults to the maximum allowed by the organization’s plan. Values above the plan maximum are rejected with 400.

Response

Created
upload_urlstringformat: "uri"

Presigned URL for a single PUT of the ciphertext. Do not send your API key to it.

file_keystringformat: "^[0-9a-f]{64}$"

Identifier of the upload; pass it to the complete endpoint.

upload_headersmap from strings to strings

Headers that must be sent with the PUT, exactly as returned.

upload_expires_ininteger

Seconds until upload_url expires.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
429
Too Many Requests Error