> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.simplified.com/api-reference/platform/documents/create-document/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.simplified.com/_mcp/server. # API · Docs · Create a long-form document POST https://api.simplified.com/api/v1/documents Content-Type: application/json Create a new long-form document rendered in the Quill editor. Content is stored as Quill Delta JSON (ops array). Used by AI-writer skills (Essay Writer, Article Writer) to persist generated markdown content into an editable document. The returned document is immediately openable at `/ai-writer/document/{space_or_organization}/{id}` in the Simplified web app. To convert markdown content into the required Quill Delta shape, call `markdown_to_quill_delta` from the writers toolkit before passing to this endpoint. Reference: https://docs.simplified.com/api-reference/platform/documents/create-document ## Authentication - `Authorization` header (required) (prefixed with ` Api-Key `) — Header authentication of the form `Api-Key ` - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## Request ### Body (application/json) This endpoint expects a CreateDocumentRequest. - `title` (string, required) — Document title shown in the editor and the document list. For AI-writer skills, use the essay/article title from the originating show_article tool call. - `form` (integer, required) — Document form type enum. Use 1 for LONG_FORM (Quill-editor-backed documents — the standard for essays, articles, and any rich-text content). 0 = SHORT_FORM (AI templates, not used by these skills). - `content` (CreateDocumentRequestContent, required) — Quill Delta JSON representing the document body. Contains an `ops` array of operations. Each op is a dict with `insert` (string or embed object) and optional `attributes` (formatting like bold, italic, header, list, link, code-block, blockquote). For markdown-sourced content, call `markdown_to_quill_delta` to produce a compliant Delta before passing to this field. - `payload` (CreateDocumentRequestPayload, optional) — Optional document metadata. Can be left empty (). Supported fields: description, tone, keywords, voice\_id, output. Used for AI template context — not required for skill-generated content. - `parent` (string, optional) — Optional parent document id for creating a sub-document. Not used by AI-writer skills in v1. ## Response ### 201 Document created — returns document id plus workspace context - `any` ## Errors ### 400 Bad Request Error Invalid payload (missing title, content, or malformed Delta) - `any` ### 401 Unauthorized Error Unauthorized - `any` ## Types ### CreateDocumentRequestContent Quill Delta JSON representing the document body. Contains an `ops` array of operations. Each op is a dict with `insert` (string or embed object) and optional `attributes` (formatting like bold, italic, header, list, link, code-block, blockquote). For markdown-sourced content, call `markdown_to_quill_delta` to produce a compliant Delta before passing to this field. - `ops` (list of CreateDocumentRequestContentOpsItems, required) — Delta operations array ### CreateDocumentRequestPayload Optional document metadata. Can be left empty (). Supported fields: description, tone, keywords, voice\_id, output. Used for AI template context — not required for skill-generated content. ### CreateDocumentRequestContentOpsItems ## Examples **Request** ```json { "title": "How to Build a Content Calendar That Actually Ships", "form": 1, "content": { "ops": [ { "insert": "How to Build a Content Calendar" }, { "attributes": { "header": 1 }, "insert": "\n" }, { "insert": "Most content calendars fail in the first 30 days.\n" } ] } } ``` **SDK Code** ```python Documents_createDocument_example import requests url = "https://api.simplified.com/api/v1/documents" payload = { "title": "How to Build a Content Calendar That Actually Ships", "form": 1, "content": { "ops": [{ "insert": "How to Build a Content Calendar" }, { "attributes": { "header": 1 }, "insert": " " }, { "insert": "Most content calendars fail in the first 30 days. " }] } } headers = { "Authorization": "Api-Key ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Documents_createDocument_example const url = 'https://api.simplified.com/api/v1/documents'; const options = { method: 'POST', headers: {Authorization: 'Api-Key ', 'Content-Type': 'application/json'}, body: '{"title":"How to Build a Content Calendar That Actually Ships","form":1,"content":{"ops":[{"insert":"How to Build a Content Calendar"},{"attributes":{"header":1},"insert":"\n"},{"insert":"Most content calendars fail in the first 30 days.\n"}]}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Documents_createDocument_example package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.simplified.com/api/v1/documents" payload := strings.NewReader("{\n \"title\": \"How to Build a Content Calendar That Actually Ships\",\n \"form\": 1,\n \"content\": {\n \"ops\": [\n {\n \"insert\": \"How to Build a Content Calendar\"\n },\n {\n \"attributes\": {\n \"header\": 1\n },\n \"insert\": \"\\n\"\n },\n {\n \"insert\": \"Most content calendars fail in the first 30 days.\\n\"\n }\n ]\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Api-Key ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Documents_createDocument_example require 'uri' require 'net/http' url = URI("https://api.simplified.com/api/v1/documents") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Api-Key ' request["Content-Type"] = 'application/json' request.body = "{\n \"title\": \"How to Build a Content Calendar That Actually Ships\",\n \"form\": 1,\n \"content\": {\n \"ops\": [\n {\n \"insert\": \"How to Build a Content Calendar\"\n },\n {\n \"attributes\": {\n \"header\": 1\n },\n \"insert\": \"\\n\"\n },\n {\n \"insert\": \"Most content calendars fail in the first 30 days.\\n\"\n }\n ]\n }\n}" response = http.request(request) puts response.read_body ``` ```java Documents_createDocument_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.simplified.com/api/v1/documents") .header("Authorization", "Api-Key ") .header("Content-Type", "application/json") .body("{\n \"title\": \"How to Build a Content Calendar That Actually Ships\",\n \"form\": 1,\n \"content\": {\n \"ops\": [\n {\n \"insert\": \"How to Build a Content Calendar\"\n },\n {\n \"attributes\": {\n \"header\": 1\n },\n \"insert\": \"\\n\"\n },\n {\n \"insert\": \"Most content calendars fail in the first 30 days.\\n\"\n }\n ]\n }\n}") .asString(); ``` ```php Documents_createDocument_example request('POST', 'https://api.simplified.com/api/v1/documents', [ 'body' => '{ "title": "How to Build a Content Calendar That Actually Ships", "form": 1, "content": { "ops": [ { "insert": "How to Build a Content Calendar" }, { "attributes": { "header": 1 }, "insert": "\\n" }, { "insert": "Most content calendars fail in the first 30 days.\\n" } ] } }', 'headers' => [ 'Authorization' => 'Api-Key ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Documents_createDocument_example using RestSharp; var client = new RestClient("https://api.simplified.com/api/v1/documents"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Api-Key "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"title\": \"How to Build a Content Calendar That Actually Ships\",\n \"form\": 1,\n \"content\": {\n \"ops\": [\n {\n \"insert\": \"How to Build a Content Calendar\"\n },\n {\n \"attributes\": {\n \"header\": 1\n },\n \"insert\": \"\\n\"\n },\n {\n \"insert\": \"Most content calendars fail in the first 30 days.\\n\"\n }\n ]\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Documents_createDocument_example import Foundation let headers = [ "Authorization": "Api-Key ", "Content-Type": "application/json" ] let parameters = [ "title": "How to Build a Content Calendar That Actually Ships", "form": 1, "content": ["ops": [["insert": "How to Build a Content Calendar"], [ "attributes": ["header": 1], "insert": " " ], ["insert": "Most content calendars fail in the first 30 days. "]]] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.simplified.com/api/v1/documents")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```