Developer docs
Train your AI assistant via API
Push knowledge from your CMS, help center or internal tools straight into your owni.chat AI assistant. Three endpoints, one API key — that's it.
1. Get an API key
In the dashboard open your project and go to API in the sidebar. Create a key and copy it — for security reasons the full key is shown only once. Every key belongs to a single project and can be revoked at any time.
All requests are authenticated with the Authorization header:
Authorization: Bearer ak_live_your_api_key2. Add knowledge (text or URL)
Create a knowledge source. The assistant is retrained automatically — embeddings are rebuilt in the background within a minute.
Plain text or FAQ:
curl -X POST \
https://app.owni.chat/api/external/v1/projects/YOUR_PROJECT_ID/knowledge-sources \
-H "Authorization: Bearer ak_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"type": "text",
"name": "Shipping policy",
"raw_text": "We ship worldwide within 2-5 business days..."
}'Web page by URL:
curl -X POST \
https://app.owni.chat/api/external/v1/projects/YOUR_PROJECT_ID/knowledge-sources \
-H "Authorization: Bearer ak_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"type": "url",
"name": "Help center article",
"source_url": "https://example.com/help/returns"
}'Response 201:
{
"knowledge_source": {
"id": "6a1f...c2",
"type": "text",
"name": "Shipping policy",
"status": "pending",
"created_at": "2026-07-09T12:00:00.000Z"
}
}3. Upload files
PDF, DOCX, TXT and Markdown files are parsed and indexed automatically. Send them as multipart/form-data:
curl -X POST \
https://app.owni.chat/api/external/v1/projects/YOUR_PROJECT_ID/knowledge-sources/upload \
-H "Authorization: Bearer ak_live_your_api_key" \
-F "file=@product-manual.pdf" \
-F "name=Product manual"4. Re-index a source
Changed a URL's content? Trigger a rebuild of its embeddings without recreating the source:
curl -X POST \
https://app.owni.chat/api/external/v1/projects/YOUR_PROJECT_ID/knowledge-sources/SOURCE_ID/reindex \
-H "Authorization: Bearer ak_live_your_api_key"Errors & limits
| Status | Meaning |
|---|---|
| 401 | Missing, invalid, revoked or expired API key |
| 403 | Key does not belong to this project or lacks the scope |
| 400 | Validation error — check the response message |
| 429 | Rate limit exceeded (60 requests per minute) |
Keep your API key secret: use it only from your backend, never in client-side code. If a key leaks, revoke it in the dashboard and create a new one.
Ready to automate your AI training?
Create a free account, add your website and generate an API key in minutes.
Start free