Edit a text or Q&A source
curl --request PATCH \
--url https://api.totebot.ai/v1/agents/{agentId}/knowledge/{sourceId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"validFrom": "2026-11-24T00:00:00.000Z",
"validUntil": "2026-11-30T23:59:59.000Z",
"title": "<string>",
"text": "<string>",
"question": "<string>",
"answer": "<string>"
}
'import requests
url = "https://api.totebot.ai/v1/agents/{agentId}/knowledge/{sourceId}"
payload = {
"validFrom": "2026-11-24T00:00:00.000Z",
"validUntil": "2026-11-30T23:59:59.000Z",
"title": "<string>",
"text": "<string>",
"question": "<string>",
"answer": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
validFrom: '2026-11-24T00:00:00.000Z',
validUntil: '2026-11-30T23:59:59.000Z',
title: '<string>',
text: '<string>',
question: '<string>',
answer: '<string>'
})
};
fetch('https://api.totebot.ai/v1/agents/{agentId}/knowledge/{sourceId}', 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.totebot.ai/v1/agents/{agentId}/knowledge/{sourceId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'validFrom' => '2026-11-24T00:00:00.000Z',
'validUntil' => '2026-11-30T23:59:59.000Z',
'title' => '<string>',
'text' => '<string>',
'question' => '<string>',
'answer' => '<string>'
]),
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.totebot.ai/v1/agents/{agentId}/knowledge/{sourceId}"
payload := strings.NewReader("{\n \"validFrom\": \"2026-11-24T00:00:00.000Z\",\n \"validUntil\": \"2026-11-30T23:59:59.000Z\",\n \"title\": \"<string>\",\n \"text\": \"<string>\",\n \"question\": \"<string>\",\n \"answer\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.totebot.ai/v1/agents/{agentId}/knowledge/{sourceId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"validFrom\": \"2026-11-24T00:00:00.000Z\",\n \"validUntil\": \"2026-11-30T23:59:59.000Z\",\n \"title\": \"<string>\",\n \"text\": \"<string>\",\n \"question\": \"<string>\",\n \"answer\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.totebot.ai/v1/agents/{agentId}/knowledge/{sourceId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"validFrom\": \"2026-11-24T00:00:00.000Z\",\n \"validUntil\": \"2026-11-30T23:59:59.000Z\",\n \"title\": \"<string>\",\n \"text\": \"<string>\",\n \"question\": \"<string>\",\n \"answer\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"source": {
"id": "clx1source",
"type": "DOC",
"status": "PENDING",
"processingError": "<string>",
"title": "<string>",
"question": "<string>",
"url": "<string>",
"parentSourceId": "<string>",
"managedByIntegration": true,
"characterCount": 123,
"lastCrawledAt": "2023-11-07T05:31:56Z",
"contentHash": "<string>",
"validFrom": "2023-11-07T05:31:56Z",
"validUntil": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"trainingRequired": true
}{
"status": "error",
"error": {
"code": "NotFoundException",
"message": "Agent not found",
"details": {}
},
"path": "/v1/agents/clx123",
"timestamp": "2026-11-24T10:00:00.000Z"
}{
"status": "error",
"error": {
"code": "NotFoundException",
"message": "Agent not found",
"details": {}
},
"path": "/v1/agents/clx123",
"timestamp": "2026-11-24T10:00:00.000Z"
}{
"status": "error",
"error": {
"code": "NotFoundException",
"message": "Agent not found",
"details": {}
},
"path": "/v1/agents/clx123",
"timestamp": "2026-11-24T10:00:00.000Z"
}{
"status": "error",
"error": {
"code": "NotFoundException",
"message": "Agent not found",
"details": {}
},
"path": "/v1/agents/clx123",
"timestamp": "2026-11-24T10:00:00.000Z"
}{
"status": "error",
"error": {
"code": "NotFoundException",
"message": "Agent not found",
"details": {}
},
"path": "/v1/agents/clx123",
"timestamp": "2026-11-24T10:00:00.000Z"
}{
"status": "error",
"error": {
"code": "NotFoundException",
"message": "Agent not found",
"details": {}
},
"path": "/v1/agents/clx123",
"timestamp": "2026-11-24T10:00:00.000Z"
}Knowledge
Edit a text or Q&A source
Adds the new version and retires the old one. The response holds the new source id. Both take effect on the next training run. Send only validFrom / validUntil to change the dates in place (no training needed); with content changes, omitted dates are kept.
PATCH
/
v1
/
agents
/
{agentId}
/
knowledge
/
{sourceId}
Edit a text or Q&A source
curl --request PATCH \
--url https://api.totebot.ai/v1/agents/{agentId}/knowledge/{sourceId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"validFrom": "2026-11-24T00:00:00.000Z",
"validUntil": "2026-11-30T23:59:59.000Z",
"title": "<string>",
"text": "<string>",
"question": "<string>",
"answer": "<string>"
}
'import requests
url = "https://api.totebot.ai/v1/agents/{agentId}/knowledge/{sourceId}"
payload = {
"validFrom": "2026-11-24T00:00:00.000Z",
"validUntil": "2026-11-30T23:59:59.000Z",
"title": "<string>",
"text": "<string>",
"question": "<string>",
"answer": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
validFrom: '2026-11-24T00:00:00.000Z',
validUntil: '2026-11-30T23:59:59.000Z',
title: '<string>',
text: '<string>',
question: '<string>',
answer: '<string>'
})
};
fetch('https://api.totebot.ai/v1/agents/{agentId}/knowledge/{sourceId}', 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.totebot.ai/v1/agents/{agentId}/knowledge/{sourceId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'validFrom' => '2026-11-24T00:00:00.000Z',
'validUntil' => '2026-11-30T23:59:59.000Z',
'title' => '<string>',
'text' => '<string>',
'question' => '<string>',
'answer' => '<string>'
]),
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.totebot.ai/v1/agents/{agentId}/knowledge/{sourceId}"
payload := strings.NewReader("{\n \"validFrom\": \"2026-11-24T00:00:00.000Z\",\n \"validUntil\": \"2026-11-30T23:59:59.000Z\",\n \"title\": \"<string>\",\n \"text\": \"<string>\",\n \"question\": \"<string>\",\n \"answer\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.totebot.ai/v1/agents/{agentId}/knowledge/{sourceId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"validFrom\": \"2026-11-24T00:00:00.000Z\",\n \"validUntil\": \"2026-11-30T23:59:59.000Z\",\n \"title\": \"<string>\",\n \"text\": \"<string>\",\n \"question\": \"<string>\",\n \"answer\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.totebot.ai/v1/agents/{agentId}/knowledge/{sourceId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"validFrom\": \"2026-11-24T00:00:00.000Z\",\n \"validUntil\": \"2026-11-30T23:59:59.000Z\",\n \"title\": \"<string>\",\n \"text\": \"<string>\",\n \"question\": \"<string>\",\n \"answer\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"source": {
"id": "clx1source",
"type": "DOC",
"status": "PENDING",
"processingError": "<string>",
"title": "<string>",
"question": "<string>",
"url": "<string>",
"parentSourceId": "<string>",
"managedByIntegration": true,
"characterCount": 123,
"lastCrawledAt": "2023-11-07T05:31:56Z",
"contentHash": "<string>",
"validFrom": "2023-11-07T05:31:56Z",
"validUntil": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"trainingRequired": true
}{
"status": "error",
"error": {
"code": "NotFoundException",
"message": "Agent not found",
"details": {}
},
"path": "/v1/agents/clx123",
"timestamp": "2026-11-24T10:00:00.000Z"
}{
"status": "error",
"error": {
"code": "NotFoundException",
"message": "Agent not found",
"details": {}
},
"path": "/v1/agents/clx123",
"timestamp": "2026-11-24T10:00:00.000Z"
}{
"status": "error",
"error": {
"code": "NotFoundException",
"message": "Agent not found",
"details": {}
},
"path": "/v1/agents/clx123",
"timestamp": "2026-11-24T10:00:00.000Z"
}{
"status": "error",
"error": {
"code": "NotFoundException",
"message": "Agent not found",
"details": {}
},
"path": "/v1/agents/clx123",
"timestamp": "2026-11-24T10:00:00.000Z"
}{
"status": "error",
"error": {
"code": "NotFoundException",
"message": "Agent not found",
"details": {}
},
"path": "/v1/agents/clx123",
"timestamp": "2026-11-24T10:00:00.000Z"
}{
"status": "error",
"error": {
"code": "NotFoundException",
"message": "Agent not found",
"details": {}
},
"path": "/v1/agents/clx123",
"timestamp": "2026-11-24T10:00:00.000Z"
}Authorizations
Headers
Body
application/json
Text sources only.
Maximum string length:
10000