Edit knowledge base content
curl --request PUT \
--url https://api.zeroruntime.ai/v1/knowledge-bases/{knowledgeId}/markdown \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"markdown": "# Refunds\n\nItems can be returned within 30 days of delivery.",
"note": "Updated refund window to 30 days"
}
'import requests
url = "https://api.zeroruntime.ai/v1/knowledge-bases/{knowledgeId}/markdown"
payload = {
"markdown": "# Refunds
Items can be returned within 30 days of delivery.",
"note": "Updated refund window to 30 days"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
markdown: '# Refunds\n\nItems can be returned within 30 days of delivery.',
note: 'Updated refund window to 30 days'
})
};
fetch('https://api.zeroruntime.ai/v1/knowledge-bases/{knowledgeId}/markdown', 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.zeroruntime.ai/v1/knowledge-bases/{knowledgeId}/markdown",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'markdown' => '# Refunds
Items can be returned within 30 days of delivery.',
'note' => 'Updated refund window to 30 days'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.zeroruntime.ai/v1/knowledge-bases/{knowledgeId}/markdown"
payload := strings.NewReader("{\n \"markdown\": \"# Refunds\\n\\nItems can be returned within 30 days of delivery.\",\n \"note\": \"Updated refund window to 30 days\"\n}")
req, _ := http.NewRequest("PUT", 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(string(body))
}HttpResponse<String> response = Unirest.put("https://api.zeroruntime.ai/v1/knowledge-bases/{knowledgeId}/markdown")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"markdown\": \"# Refunds\\n\\nItems can be returned within 30 days of delivery.\",\n \"note\": \"Updated refund window to 30 days\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zeroruntime.ai/v1/knowledge-bases/{knowledgeId}/markdown")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"markdown\": \"# Refunds\\n\\nItems can be returned within 30 days of delivery.\",\n \"note\": \"Updated refund window to 30 days\"\n}"
response = http.request(request)
puts response.read_body{
"knowledgeId": "k7x2m",
"name": "Return policy",
"type": "txt",
"status": "processing",
"statusReason": null,
"failureCode": null,
"sizeInBytes": null,
"pageCount": null,
"sectionCount": null,
"charCount": null,
"folderId": null,
"currentVersion": 1,
"latestVersion": 2,
"createdAt": "2026-10-13T09:30:00.000Z",
"updatedAt": "2026-10-13T10:02:00.000Z"
}{
"message": "Invalid payload",
"errors": {
"formErrors": [
"<string>"
],
"fieldErrors": {}
}
}{
"error": "<string>"
}{
"message": "Knowledge base not found"
}{
"message": "Knowledge base is still processing and cannot be edited yet"
}Knowledge bases
Edit knowledge base content
Replaces the content with your edited text as a new version. Get the current text from Get knowledge base, change it and send the whole text back.
The edited version is selected automatically once indexing completes. Until then, agents read the previous version. If indexing fails, the previous version stays current.
PUT
/
v1
/
knowledge-bases
/
{knowledgeId}
/
markdown
Edit knowledge base content
curl --request PUT \
--url https://api.zeroruntime.ai/v1/knowledge-bases/{knowledgeId}/markdown \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"markdown": "# Refunds\n\nItems can be returned within 30 days of delivery.",
"note": "Updated refund window to 30 days"
}
'import requests
url = "https://api.zeroruntime.ai/v1/knowledge-bases/{knowledgeId}/markdown"
payload = {
"markdown": "# Refunds
Items can be returned within 30 days of delivery.",
"note": "Updated refund window to 30 days"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
markdown: '# Refunds\n\nItems can be returned within 30 days of delivery.',
note: 'Updated refund window to 30 days'
})
};
fetch('https://api.zeroruntime.ai/v1/knowledge-bases/{knowledgeId}/markdown', 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.zeroruntime.ai/v1/knowledge-bases/{knowledgeId}/markdown",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'markdown' => '# Refunds
Items can be returned within 30 days of delivery.',
'note' => 'Updated refund window to 30 days'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.zeroruntime.ai/v1/knowledge-bases/{knowledgeId}/markdown"
payload := strings.NewReader("{\n \"markdown\": \"# Refunds\\n\\nItems can be returned within 30 days of delivery.\",\n \"note\": \"Updated refund window to 30 days\"\n}")
req, _ := http.NewRequest("PUT", 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(string(body))
}HttpResponse<String> response = Unirest.put("https://api.zeroruntime.ai/v1/knowledge-bases/{knowledgeId}/markdown")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"markdown\": \"# Refunds\\n\\nItems can be returned within 30 days of delivery.\",\n \"note\": \"Updated refund window to 30 days\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zeroruntime.ai/v1/knowledge-bases/{knowledgeId}/markdown")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"markdown\": \"# Refunds\\n\\nItems can be returned within 30 days of delivery.\",\n \"note\": \"Updated refund window to 30 days\"\n}"
response = http.request(request)
puts response.read_body{
"knowledgeId": "k7x2m",
"name": "Return policy",
"type": "txt",
"status": "processing",
"statusReason": null,
"failureCode": null,
"sizeInBytes": null,
"pageCount": null,
"sectionCount": null,
"charCount": null,
"folderId": null,
"currentVersion": 1,
"latestVersion": 2,
"createdAt": "2026-10-13T09:30:00.000Z",
"updatedAt": "2026-10-13T10:02:00.000Z"
}{
"message": "Invalid payload",
"errors": {
"formErrors": [
"<string>"
],
"fieldErrors": {}
}
}{
"error": "<string>"
}{
"message": "Knowledge base not found"
}{
"message": "Knowledge base is still processing and cannot be edited yet"
}Authorizations
Your API token, sent raw (no Bearer prefix).
Path Parameters
Body
application/json
Response
The knowledge base, describing the new version while it's indexed.
Status and size fields describe the current version.
5 characters
Example:
"k7x2m"
Example:
"pricing.pdf"
Available options:
pdf, txt, csv, json, docx, md, url processing: being parsed and indexed. Not available to agents yet.ready: indexed and available to agents.failed: processing stopped.statusReasonsays why.
Available options:
processing, ready, failed Why processing failed.
For example upload_failed or job_not_scheduled.
0 for website knowledge bases.
null when it's at the top level.
The version agents read from.
The newest version. It may still be processing