Skip to main content

Create Document

Create a new document with blocks. Requires the documents:write role.

Request

Headers

HeaderRequiredDescription
X-API-KeyYesYour API key
Content-TypeYesapplication/json

Body

FieldTypeRequiredDescription
titlestringYesDocument title (max 500 characters)
blocksarrayYesArray of content blocks
blocks[].typestringYesBlock type: heading, paragraph, code, list, quote, table, image, divider
blocks[].contentstringYesBlock content
blocks[].metadataobjectNoBlock metadata (e.g., level for headings)
folder_idstringNoTarget folder ID. Uses root folder if omitted.
content_typestringNoDefault: "markdown"
visibilitystringNo"private" (default) or "public"
metadataobjectNoDocument-level metadata

Example

Response

Status: 201 Created

Quota Headers

Responses include document quota information:
HeaderDescription
X-Quota-UsedDocuments created this month
X-Quota-LimitMonthly document limit
X-Quota-ResetDate when quota resets (YYYY-MM-DD)