Skip to main content
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"
}'
{
  "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"
}'

Request Body

agent_id
string
required
The agent’s public ID (ag_*)
text
string
required
Raw text content to add
title
string
Display name for this source

Response 201

{
  "id": 1,
  "name": "Return Policy",
  "type": "text",
  "status": "processing",
  "created_at": "2026-03-07T14:00:00Z"
}
The source begins processing immediately. Check status via List Sources.

Errors

CodeDescription
401Missing or invalid authentication
404Agent not found
413Text too large

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request to add text content to knowledge base.

user_id
string
required
name
string
required
Maximum string length: 256
content
string
required
Maximum string length: 5000000

Response

Successful Response