curl -X POST https://api.thinnest.ai/knowledge/add-text \
-H "Authorization: Bearer $THINNESTAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "ag_c47e7c97_b2f2",
"text": "Our return policy allows returns within 30 days of purchase. Items must be unused and in original packaging. Refunds are processed within 5-7 business days.",
"title": "Return Policy"
}'
import requests
url = "https://api.thinnest.ai/knowledge/add-text"
headers = {
"Authorization": "Bearer " + "YOUR_THINNESTAI_API_KEY",
"Content-Type": "application/json",
}
payload = {
"agent_id": "ag_c47e7c97_b2f2",
"text": "Our return policy allows returns within 30 days of purchase. Items must be unused and in original packaging. Refunds are processed within 5-7 business days.",
"title": "Return Policy"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
const response = await fetch("https://api.thinnest.ai/knowledge/add-text", {
method: "POST",
headers: {
"Authorization": "Bearer " + "YOUR_THINNESTAI_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
"agent_id": "ag_c47e7c97_b2f2",
"text": "Our return policy allows returns within 30 days of purchase. Items must be unused and in original packaging. Refunds are processed within 5-7 business days.",
"title": "Return Policy"
}),
});
const data = await response.json();
console.log(data);
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
payload := []byte(`{
"agent_id": "ag_c47e7c97_b2f2",
"text": "Our return policy allows returns within 30 days of purchase. Items must be unused and in original packaging. Refunds are processed within 5-7 business days.",
"title": "Return Policy"
}`)
req, _ := http.NewRequest("POST", "https://api.thinnest.ai/knowledge/add-text", bytes.NewBuffer(payload))
req.Header.Set("Authorization", "Bearer YOUR_THINNESTAI_API_KEY")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
{
"id": 1,
"name": "Return Policy",
"type": "text",
"status": "processing",
"created_at": "2026-03-07T14:00:00Z"
}
Knowledge
Add Text
Add raw text content to an agent’s knowledge base.
POST
/
knowledge
/
add-text
curl -X POST https://api.thinnest.ai/knowledge/add-text \
-H "Authorization: Bearer $THINNESTAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "ag_c47e7c97_b2f2",
"text": "Our return policy allows returns within 30 days of purchase. Items must be unused and in original packaging. Refunds are processed within 5-7 business days.",
"title": "Return Policy"
}'
import requests
url = "https://api.thinnest.ai/knowledge/add-text"
headers = {
"Authorization": "Bearer " + "YOUR_THINNESTAI_API_KEY",
"Content-Type": "application/json",
}
payload = {
"agent_id": "ag_c47e7c97_b2f2",
"text": "Our return policy allows returns within 30 days of purchase. Items must be unused and in original packaging. Refunds are processed within 5-7 business days.",
"title": "Return Policy"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
const response = await fetch("https://api.thinnest.ai/knowledge/add-text", {
method: "POST",
headers: {
"Authorization": "Bearer " + "YOUR_THINNESTAI_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
"agent_id": "ag_c47e7c97_b2f2",
"text": "Our return policy allows returns within 30 days of purchase. Items must be unused and in original packaging. Refunds are processed within 5-7 business days.",
"title": "Return Policy"
}),
});
const data = await response.json();
console.log(data);
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
payload := []byte(`{
"agent_id": "ag_c47e7c97_b2f2",
"text": "Our return policy allows returns within 30 days of purchase. Items must be unused and in original packaging. Refunds are processed within 5-7 business days.",
"title": "Return Policy"
}`)
req, _ := http.NewRequest("POST", "https://api.thinnest.ai/knowledge/add-text", bytes.NewBuffer(payload))
req.Header.Set("Authorization", "Bearer YOUR_THINNESTAI_API_KEY")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
{
"id": 1,
"name": "Return Policy",
"type": "text",
"status": "processing",
"created_at": "2026-03-07T14:00:00Z"
}
curl -X POST https://api.thinnest.ai/knowledge/add-text \
-H "Authorization: Bearer $THINNESTAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "ag_c47e7c97_b2f2",
"text": "Our return policy allows returns within 30 days of purchase. Items must be unused and in original packaging. Refunds are processed within 5-7 business days.",
"title": "Return Policy"
}'
import requests
url = "https://api.thinnest.ai/knowledge/add-text"
headers = {
"Authorization": "Bearer " + "YOUR_THINNESTAI_API_KEY",
"Content-Type": "application/json",
}
payload = {
"agent_id": "ag_c47e7c97_b2f2",
"text": "Our return policy allows returns within 30 days of purchase. Items must be unused and in original packaging. Refunds are processed within 5-7 business days.",
"title": "Return Policy"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
const response = await fetch("https://api.thinnest.ai/knowledge/add-text", {
method: "POST",
headers: {
"Authorization": "Bearer " + "YOUR_THINNESTAI_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
"agent_id": "ag_c47e7c97_b2f2",
"text": "Our return policy allows returns within 30 days of purchase. Items must be unused and in original packaging. Refunds are processed within 5-7 business days.",
"title": "Return Policy"
}),
});
const data = await response.json();
console.log(data);
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
payload := []byte(`{
"agent_id": "ag_c47e7c97_b2f2",
"text": "Our return policy allows returns within 30 days of purchase. Items must be unused and in original packaging. Refunds are processed within 5-7 business days.",
"title": "Return Policy"
}`)
req, _ := http.NewRequest("POST", "https://api.thinnest.ai/knowledge/add-text", bytes.NewBuffer(payload))
req.Header.Set("Authorization", "Bearer YOUR_THINNESTAI_API_KEY")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
Request Body
The agent’s public ID (ag_*)
Raw text content to add
Display name for this source
Response 201
{
"id": 1,
"name": "Return Policy",
"type": "text",
"status": "processing",
"created_at": "2026-03-07T14:00:00Z"
}
Errors
| Code | Description |
|---|---|
401 | Missing or invalid authentication |
404 | Agent not found |
413 | Text too large |
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
Successful Response
⌘I

