Create a document
curl --request POST \
--url https://api.sleekplan.com/v2/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"content": "<string>",
"document_type": "knowledge-base",
"tags": [
"<string>"
],
"status": "draft"
}
'import requests
url = "https://api.sleekplan.com/v2/documents"
payload = {
"title": "<string>",
"content": "<string>",
"document_type": "knowledge-base",
"tags": ["<string>"],
"status": "draft"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
content: '<string>',
document_type: 'knowledge-base',
tags: ['<string>'],
status: 'draft'
})
};
fetch('https://api.sleekplan.com/v2/documents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sleekplan.com/v2/documents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'content' => '<string>',
'document_type' => 'knowledge-base',
'tags' => [
'<string>'
],
'status' => 'draft'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sleekplan.com/v2/documents"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"content\": \"<string>\",\n \"document_type\": \"knowledge-base\",\n \"tags\": [\n \"<string>\"\n ],\n \"status\": \"draft\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sleekplan.com/v2/documents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"content\": \"<string>\",\n \"document_type\": \"knowledge-base\",\n \"tags\": [\n \"<string>\"\n ],\n \"status\": \"draft\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sleekplan.com/v2/documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"content\": \"<string>\",\n \"document_type\": \"knowledge-base\",\n \"tags\": [\n \"<string>\"\n ],\n \"status\": \"draft\"\n}"
response = http.request(request)
puts response.read_body{
"status": "<string>",
"data": {
"document_id": 42,
"title": "Q4 pricing rework",
"slug": "q4-pricing-rework",
"document_type": "spec",
"tags": [
"<string>"
],
"status": "draft",
"current_version": 3,
"content": "<string>",
"created": "2026-09-18 15:06:55",
"updated": "2026-09-18 15:07:36"
}
}{
"status": "<string>",
"data": {
"key": "validation_error",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"status": "error",
"data": {
"key": "<string>",
"message": "<string>"
}
}{
"status": "error",
"data": {
"key": "<string>",
"message": "<string>"
}
}{
"status": "error",
"data": {
"key": "<string>",
"message": "<string>"
}
}Document
Create a document
Creates a document and records version 1, so its history is complete from the start.
POST
/
documents
Create a document
curl --request POST \
--url https://api.sleekplan.com/v2/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"content": "<string>",
"document_type": "knowledge-base",
"tags": [
"<string>"
],
"status": "draft"
}
'import requests
url = "https://api.sleekplan.com/v2/documents"
payload = {
"title": "<string>",
"content": "<string>",
"document_type": "knowledge-base",
"tags": ["<string>"],
"status": "draft"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
content: '<string>',
document_type: 'knowledge-base',
tags: ['<string>'],
status: 'draft'
})
};
fetch('https://api.sleekplan.com/v2/documents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sleekplan.com/v2/documents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'content' => '<string>',
'document_type' => 'knowledge-base',
'tags' => [
'<string>'
],
'status' => 'draft'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sleekplan.com/v2/documents"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"content\": \"<string>\",\n \"document_type\": \"knowledge-base\",\n \"tags\": [\n \"<string>\"\n ],\n \"status\": \"draft\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sleekplan.com/v2/documents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"content\": \"<string>\",\n \"document_type\": \"knowledge-base\",\n \"tags\": [\n \"<string>\"\n ],\n \"status\": \"draft\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sleekplan.com/v2/documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"content\": \"<string>\",\n \"document_type\": \"knowledge-base\",\n \"tags\": [\n \"<string>\"\n ],\n \"status\": \"draft\"\n}"
response = http.request(request)
puts response.read_body{
"status": "<string>",
"data": {
"document_id": 42,
"title": "Q4 pricing rework",
"slug": "q4-pricing-rework",
"document_type": "spec",
"tags": [
"<string>"
],
"status": "draft",
"current_version": 3,
"content": "<string>",
"created": "2026-09-18 15:06:55",
"updated": "2026-09-18 15:07:36"
}
}{
"status": "<string>",
"data": {
"key": "validation_error",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"status": "error",
"data": {
"key": "<string>",
"message": "<string>"
}
}{
"status": "error",
"data": {
"key": "<string>",
"message": "<string>"
}
}{
"status": "error",
"data": {
"key": "<string>",
"message": "<string>"
}
}Authorizations
Authorization: Bearer YOUR_API_KEY. /v2 accepts no other method.
Body
application/json
The slug is derived from this and cannot be set directly.
Required string length:
3 - 500Markdown. Up to 2MB.
A type key defined in this workspace. Seeded with knowledge-base, prd, spec, plan, research, decision, summary, project — a workspace can add or rename them, so an unknown key is rejected with invalid_argument.
Maximum array length:
50Available options:
draft, published, archived Was this page helpful?
