curl --request POST \
--url https://api.orbit.devotel.io/api/v1/knowledge-bases/{id}/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Refund policy",
"type": "markdown",
"content": "# Refund policy\n\nCustomers can request a refund within 30 days of purchase."
}
'import requests
url = "https://api.orbit.devotel.io/api/v1/knowledge-bases/{id}/documents"
payload = {
"name": "Refund policy",
"type": "markdown",
"content": "# Refund policy
Customers can request a refund within 30 days of purchase."
}
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({
name: 'Refund policy',
type: 'markdown',
content: '# Refund policy\n\nCustomers can request a refund within 30 days of purchase.'
})
};
fetch('https://api.orbit.devotel.io/api/v1/knowledge-bases/{id}/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.orbit.devotel.io/api/v1/knowledge-bases/{id}/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([
'name' => 'Refund policy',
'type' => 'markdown',
'content' => '# Refund policy
Customers can request a refund within 30 days of purchase.'
]),
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.orbit.devotel.io/api/v1/knowledge-bases/{id}/documents"
payload := strings.NewReader("{\n \"name\": \"Refund policy\",\n \"type\": \"markdown\",\n \"content\": \"# Refund policy\\n\\nCustomers can request a refund within 30 days of purchase.\"\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.orbit.devotel.io/api/v1/knowledge-bases/{id}/documents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Refund policy\",\n \"type\": \"markdown\",\n \"content\": \"# Refund policy\\n\\nCustomers can request a refund within 30 days of purchase.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.orbit.devotel.io/api/v1/knowledge-bases/{id}/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 \"name\": \"Refund policy\",\n \"type\": \"markdown\",\n \"content\": \"# Refund policy\\n\\nCustomers can request a refund within 30 days of purchase.\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"knowledge_base_id": "<string>",
"name": "<string>",
"type": "<string>",
"source_url": "<string>",
"status": "<string>",
"chunk_count": 123,
"size_bytes": 123,
"is_public": true,
"slug": "<string>",
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docs_url": "<string>"
}
}Upload a document
Upload a document into a knowledge base. Accepts either a JSON body with inline text content, or a multipart/form-data file upload (PDF, DOCX, or image — extracted via OCR). The document is queued for asynchronous chunking and embedding, so it is returned in processing status; poll the document list until it reaches ready. Requires the knowledge:write scope (admin / owner / developer).
curl --request POST \
--url https://api.orbit.devotel.io/api/v1/knowledge-bases/{id}/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Refund policy",
"type": "markdown",
"content": "# Refund policy\n\nCustomers can request a refund within 30 days of purchase."
}
'import requests
url = "https://api.orbit.devotel.io/api/v1/knowledge-bases/{id}/documents"
payload = {
"name": "Refund policy",
"type": "markdown",
"content": "# Refund policy
Customers can request a refund within 30 days of purchase."
}
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({
name: 'Refund policy',
type: 'markdown',
content: '# Refund policy\n\nCustomers can request a refund within 30 days of purchase.'
})
};
fetch('https://api.orbit.devotel.io/api/v1/knowledge-bases/{id}/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.orbit.devotel.io/api/v1/knowledge-bases/{id}/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([
'name' => 'Refund policy',
'type' => 'markdown',
'content' => '# Refund policy
Customers can request a refund within 30 days of purchase.'
]),
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.orbit.devotel.io/api/v1/knowledge-bases/{id}/documents"
payload := strings.NewReader("{\n \"name\": \"Refund policy\",\n \"type\": \"markdown\",\n \"content\": \"# Refund policy\\n\\nCustomers can request a refund within 30 days of purchase.\"\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.orbit.devotel.io/api/v1/knowledge-bases/{id}/documents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Refund policy\",\n \"type\": \"markdown\",\n \"content\": \"# Refund policy\\n\\nCustomers can request a refund within 30 days of purchase.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.orbit.devotel.io/api/v1/knowledge-bases/{id}/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 \"name\": \"Refund policy\",\n \"type\": \"markdown\",\n \"content\": \"# Refund policy\\n\\nCustomers can request a refund within 30 days of purchase.\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"knowledge_base_id": "<string>",
"name": "<string>",
"type": "<string>",
"source_url": "<string>",
"status": "<string>",
"chunk_count": 123,
"size_bytes": 123,
"is_public": true,
"slug": "<string>",
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docs_url": "<string>"
}
}Authorizations
Dashboard JWT token from Clerk
Path Parameters
Knowledge base ID (kb_…).
Body
Document title.
200The document body (inline text). Max 10 MB via this JSON path.
Source type / extension (e.g. text, markdown, pdf, html). Defaults to text.
Optional origin URL the content was fetched from.
Optional arbitrary metadata to store alongside the document.
Response
The document was accepted and queued for indexing (returned in processing status).