Grist Octri Preview
POST/docs

Create a document

A unified endpoint for creating documents. Can create an empty document, copy an existing document, or import a file.

  • To create an empty unsaved document: provide no parameters
  • To create an empty saved document: provide workspaceId
  • To copy an existing document: provide sourceDocumentId, workspaceId, and documentName
  • To import a file: use multipart/form-data with a file upload and optional workspaceId
  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

5 body fields

settings for the document

asTemplatebooleanoptional
When copying, if true, copy structure only without data
documentNamestringoptional
Name for the new document (required when copying)
sourceDocumentIdstringoptional
ID of document to copy from. Requires workspaceId and documentName.
timezonestringoptional
Timezone for the document
workspaceIdintegeroptional
The workspace to save the document in. If omitted, creates an unsaved document.

1 status code
200The document id