Import Markdown into a document
POST/api/documents/:id/import
Converts an uploaded Markdown file (up to 10 MB) into the document's body, replacing the existing body entirely, and returns the updated metadata with accessLevel. The title is always replaced too: from a title: front matter field, else the first heading, else the first paragraph, else Imported Document. If createdAt is given, both the creation and last-modified times are set to it, which helps when migrating old notes; otherwise the last-modified time is now. If the document is open in an editor over the WebSocket, the import replaces the live copy, so connected editors see the new body at once and later edits apply on top of it. Typically called right after POST /api/documents to fill a new document. Requires a signed-in user with write access; read-only callers get 403. Files that are not .md, .markdown, or a Markdown MIME type, or that fail to parse, return 400.
Request
Responses
- 200
- 400
- 403
- 404
Updated document.
Request failed.
Request failed.
Request failed.