Create a knowledge document
curl --request POST \
--url https://core-api.getaptly.com/api/knowledge/create \
--header 'Content-Type: application/json' \
--header 'x-token: <api-key>' \
--data '
{
"name": "Lease Addendum Policy",
"html": "<p>This policy applies to all lease agreements...</p>",
"accessType": "private"
}
'import requests
url = "https://core-api.getaptly.com/api/knowledge/create"
payload = {
"name": "Lease Addendum Policy",
"html": "<p>This policy applies to all lease agreements...</p>",
"accessType": "private"
}
headers = {
"x-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Lease Addendum Policy',
html: '<p>This policy applies to all lease agreements...</p>',
accessType: 'private'
})
};
fetch('https://core-api.getaptly.com/api/knowledge/create', 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://core-api.getaptly.com/api/knowledge/create",
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([
'name' => 'Lease Addendum Policy',
'html' => '<p>This policy applies to all lease agreements...</p>',
'accessType' => 'private'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-token: <api-key>"
],
]);
$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://core-api.getaptly.com/api/knowledge/create"
payload := strings.NewReader("{\n \"name\": \"Lease Addendum Policy\",\n \"html\": \"<p>This policy applies to all lease agreements...</p>\",\n \"accessType\": \"private\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-token", "<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(string(body))
}HttpResponse<String> response = Unirest.post("https://core-api.getaptly.com/api/knowledge/create")
.header("x-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Lease Addendum Policy\",\n \"html\": \"<p>This policy applies to all lease agreements...</p>\",\n \"accessType\": \"private\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://core-api.getaptly.com/api/knowledge/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Lease Addendum Policy\",\n \"html\": \"<p>This policy applies to all lease agreements...</p>\",\n \"accessType\": \"private\"\n}"
response = http.request(request)
puts response.read_body{
"_id": "<string>",
"name": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Knowledge
Create a knowledge document
Creates a new knowledge document scoped to your company. Optionally associates the
document with a board (aptletUuid), a card (aptletInstanceId), or a parent
document (parentId).
HTML or Markdown content is accepted and stored internally as a structured document
format. Provide either html or markdown, not both.
POST
/
api
/
knowledge
/
create
Create a knowledge document
curl --request POST \
--url https://core-api.getaptly.com/api/knowledge/create \
--header 'Content-Type: application/json' \
--header 'x-token: <api-key>' \
--data '
{
"name": "Lease Addendum Policy",
"html": "<p>This policy applies to all lease agreements...</p>",
"accessType": "private"
}
'import requests
url = "https://core-api.getaptly.com/api/knowledge/create"
payload = {
"name": "Lease Addendum Policy",
"html": "<p>This policy applies to all lease agreements...</p>",
"accessType": "private"
}
headers = {
"x-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Lease Addendum Policy',
html: '<p>This policy applies to all lease agreements...</p>',
accessType: 'private'
})
};
fetch('https://core-api.getaptly.com/api/knowledge/create', 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://core-api.getaptly.com/api/knowledge/create",
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([
'name' => 'Lease Addendum Policy',
'html' => '<p>This policy applies to all lease agreements...</p>',
'accessType' => 'private'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-token: <api-key>"
],
]);
$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://core-api.getaptly.com/api/knowledge/create"
payload := strings.NewReader("{\n \"name\": \"Lease Addendum Policy\",\n \"html\": \"<p>This policy applies to all lease agreements...</p>\",\n \"accessType\": \"private\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-token", "<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(string(body))
}HttpResponse<String> response = Unirest.post("https://core-api.getaptly.com/api/knowledge/create")
.header("x-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Lease Addendum Policy\",\n \"html\": \"<p>This policy applies to all lease agreements...</p>\",\n \"accessType\": \"private\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://core-api.getaptly.com/api/knowledge/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Lease Addendum Policy\",\n \"html\": \"<p>This policy applies to all lease agreements...</p>\",\n \"accessType\": \"private\"\n}"
response = http.request(request)
puts response.read_body{
"_id": "<string>",
"name": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
ApiKeyHeaderDelegateTokenPartnerBearer
Body
application/json
Document title.
Initial HTML content for the document body. Mutually exclusive with markdown.
Initial Markdown content for the document body. Mutually exclusive with html.
UUID of the board to associate this document with.
Card ID to link this document to. Creates a reference on the card.
ID of a parent knowledge document (for nested pages).
Access level. Defaults to public.
Available options:
public, private ⌘I