Skip to main content
POST
Create a file in Drive in one request. Supply content for text, Markdown or CSV, or content_base64 for a prepared file such as a PDF or Word document. Supply exactly one of these fields. Required scope: drive:write
These endpoints require the Drive document creation API to be deployed to the selected environment. Existing read or download keys do not gain write access automatically; create a key with drive:write when it is available.

Choose a format

content is stored as UTF-8. content_base64 must contain strict base64-encoded file bytes without a data URL prefix. Other supported Drive file formats can also use content_base64, with a matching extension and MIME type. This endpoint stores the supplied format; it does not convert text into Word or PDF. Omit parent_id or set it to null for the Drive root. Otherwise, supply the destination folder’s ID. Association-wide keys must also specify chapter_id; chapter-bound keys may omit it. The key owner must have Drive view permission and permission to create at the root or contribute to the selected folder. File type, signature, size and storage quota checks apply. Successful creation is recorded in the chapter’s activity log.
The response contains file metadata. Use its id with Download a Drive File when you need the bytes; downloads require the separate drive:download scope.

Size limits and retries

The configured Drive upload limit applies to decoded bytes (100 MiB by default). Base64 adds request overhead, and HTTP request limits may be lower. Use Start a Drive Upload for larger files. An existing file with the same name in the selected folder causes 409; it is never overwritten. Requests are not idempotent. After an uncertain response, check List Drive Items before retrying (requires drive:read).

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.

content
string
required

UTF-8 content for text/plain, text/markdown, or text/csv.

Minimum string length: 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
content_base64
string<byte>

Strict base64-encoded file bytes, without a data URL prefix.

Minimum string length: 1

Response

Created

status
enum<string>
Available options:
success
data
object