Skip to main content
POST
Create a file

Authorizations

Authorization
string
header
required

Workspace-scoped API key, sent as a bearer token. The recommended header. The workspace is implicit in the key and never appears in a URL.

Body

application/json

Create the file at an absolute path. Missing parent folders are created on the way.

path
string
required

Where to create the file. Absolute, and ends in .md. A path already holding a file is a conflict, never an overwrite.

Example:

"/support/policies/refunds.md"

content
string
required

Markdown or plain text.

Maximum string length: 51200
Example:

"# Refunds\n\nRefunds are processed within 14 days."

Response

Created. The file is in the live files.

object
enum<string>
required

Type discriminator. Always file.

Available options:
file
id
string
required

Stable id. Survives a rename or a move.

Example:

"doc_9f2k1x8b3m7q0v"

path
string
required

Live file location. Changes when the file moves.

Example:

"/support/policies/refunds.md"

name
string
required

Leaf name, including its extension, without any part of the path.

Example:

"refunds.md"

parentId
string | null
required

The containing folder, or null when the file sits at the root. Send it back to move a file.

Example:

"dir_4k1n8p2v5m7q0x"

parentPath
string
required

Path of the containing folder. / at the root.

Example:

"/support/policies"

protected
boolean
required

When true, a change to this file goes to review instead of being accepted automatically.

lastChangeId
string
required

The last change to this file (update, rename or move). Pass it back as baseChangeId on a write.

Example:

"chg_7t4p2w9c1n6s8k"

createdAt
string<date-time>
required

When the file was created.

Example:

"2026-07-01T09:12:00.000Z"

updatedAt
string<date-time>
required

When the file last changed, including a rename or a move.

Example:

"2026-08-01T14:03:00.000Z"