Add Knowledge Source
POST
/api/v1/knowledgeAdd a text snippet or a URL to the bot's knowledge base. URL sources are fetched and indexed automatically.
Required scope: write
URL sources may take a few seconds to process. Check the
status field via List Knowledge Sources to confirm indexing completed.Request body
typestringbodyrequired"text" to add raw text, or "url" to crawl and index a web page.
contentstringbodyrequiredFor "text": the text content to add (max 50,000 chars).
For "url": the fully-qualified URL to crawl (must start with https://).
titlestringbodyOptional human-readable label. Defaults to the URL or the first 80 characters of text.
Response
idstringUUID of the newly created source.
statusstring"ready" for text sources; "processing" for URL sources until indexed.messagestringConfirmation message.
Examples
curl -X POST \
"https://api.personaliai.com/api/v1/knowledge" \
-H "Authorization: Bearer chatty_sk_your_key" \
-H "Content-Type: application/json" \
-d '{
"type": "text",
"title": "Return Policy",
"content": "We offer a 30-day money-back guarantee on all purchases. To request a refund, email support@acme.com with your order number."
}'curl -X POST \
"https://api.personaliai.com/api/v1/knowledge" \
-H "Authorization: Bearer chatty_sk_your_key" \
-H "Content-Type: application/json" \
-d '{ "type": "url", "content": "https://acme.com/docs/faq" }'201 Created:
{
"id": "ks-uuid-003",
"status": "processing",
"message": "URL queued for indexing"
}