Skip to main content
POST
Use this flow for large files or to avoid base64 encoding. The file appears in Drive after you upload its bytes and commit the upload. Required scope: drive:write
This endpoint requires the Drive document creation API to be deployed to the selected environment, with Drive enabled.

1. Start the upload

Send the file name, matching MIME type and exact byte size in declared_size. Omit parent_id or use null for the Drive root. Association-wide keys must also specify chapter_id. The key owner’s current Drive permissions and the chapter’s storage quota apply.

2. Upload the bytes

PUT the raw file bytes to the returned upload_url, adding the x-ms-blob-type: BlockBlob header:
Set UPLOAD_URL to the exact URL returned by the API. Treat it as a temporary secret, and do not send your Transparency Hub API key to storage. The upload URL lasts 30 minutes. The session’s expires_at is the commit deadline, with a further 10 minutes of grace; it does not extend the upload URL’s lifetime.

3. Commit the upload

Call Commit a Drive Upload using upload_session_id and the original API key. Association-wide keys must specify the same chapter again. Until commit succeeds, the uploaded bytes are not a Drive item. For small documents, Create a Drive Document completes these steps in one request.

Authorizations

X-API-Key
string
header
required

Query Parameters

chapter_id
integer

Required for association-wide keys; must match the key's chapter for chapter-bound keys.

Body

application/json
file_name
string
required
Required string length: 1 - 255
content_type
string
required

A supported Drive MIME type matching file_name.

declared_size
integer
required

Exact file size in bytes.

Required range: x >= 1
chapter_id
integer

Required for association-wide keys; otherwise the key chapter is used.

Required range: x >= 1
parent_id
integer | null

Omit or use null for the Drive root.

Required range: x >= 1

Response

Created

status
enum<string>
Available options:
success
data
object