Knowledge base
Knowledge Base API
Knowledge sources the AI agent learns from (text, Q&A, websites, files) and knowledge base articles.
List knowledge base articles
/v1/knowledge_base/articlesCursor-paginated articles, newest first.
Required scope: knowledge_base:read.
limitintegerPage size (1–100).
starting_afterstringCursor: the `id` of the last item from the previous page.
statusstringOne of: draft, published.
typestringOne of: public_article, internal_article.
curl "https://api.asks.app/v1/knowledge_base/articles" \
-H "Authorization: Bearer $ASKS_API_KEY"{
"object": "list",
"data": [
{
"object": "knowledge_base_article",
"id": "string",
"title": "string",
"content": "string",
"description": {},
"tags": [
"string"
],
"category": {},
"status": "draft",
"type": "public_article",
"is_public": true,
"ai_agent_enabled": true,
"indexed": true,
"created_at": {},
"updated_at": {}
}
],
"has_more": true,
"next_cursor": {}
}Retrieve a knowledge base article
/v1/knowledge_base/articles/{id}Required scope: knowledge_base:read.
curl "https://api.asks.app/v1/knowledge_base/articles/<id>" \
-H "Authorization: Bearer $ASKS_API_KEY"{
"object": "knowledge_base_article",
"id": "string",
"title": "string",
"content": "string",
"description": {},
"tags": [
"string"
],
"category": {},
"status": "draft",
"type": "public_article",
"is_public": true,
"ai_agent_enabled": true,
"indexed": true,
"created_at": {},
"updated_at": {}
}Summarize knowledge sources
/v1/knowledge_base/summaryCounts of knowledge sources by type and status, total size and the last time anything finished training.
Required scope: knowledge_base:read.
curl "https://api.asks.app/v1/knowledge_base/summary" \
-H "Authorization: Bearer $ASKS_API_KEY"{
"object": "knowledge_summary",
"total": 1,
"by_type": {},
"by_status": {},
"size_bytes": 1,
"last_trained_at": {}
}List knowledge sources
/v1/knowledge_base/sourcesEverything the AI agent learns from, newest first: text and Q&A sources, websites (with their crawled page count) and uploaded files. Pages crawled from a website are counted on the website, not listed. next_cursor is opaque. With status, a page can hold fewer than limit items (even none) while has_more is true — keep paging.
Required scope: knowledge_base:read.
limitintegerPage size (1–100).
starting_afterstringCursor: the `id` of the last item from the previous page.
typestringOne of: text, qna, website, document.
statusstringOne of: draft, disabled, training, trained, failed, syncing.
qstringCase-insensitive match on the source name.
curl "https://api.asks.app/v1/knowledge_base/sources" \
-H "Authorization: Bearer $ASKS_API_KEY"{
"object": "list",
"data": [
{
"object": "knowledge_source",
"id": "string",
"type": "text",
"name": "string",
"status": "draft",
"url": {},
"ai_enabled": true,
"origin": {},
"file_name": {},
"size_bytes": 1,
"page_count": {},
"error": {},
"last_trained_at": {},
"last_synced_at": {},
"created_at": {},
"updated_at": {}
}
],
"has_more": true,
"next_cursor": {}
}Create a knowledge source
/v1/knowledge_base/sourcesAdds knowledge and starts training it — there is no separate train step. text and qna sources are indexed as they are written and usually come back trained; a website is crawled in the background and comes back syncing — poll the source until it is trained or failed. Counts toward the plan's knowledge base limit. Files can only be uploaded in the dashboard.
Required scope: knowledge_base:write.
curl -X POST "https://api.asks.app/v1/knowledge_base/sources" \
-H "Authorization: Bearer $ASKS_API_KEY"{
"object": "knowledge_source",
"id": "string",
"type": "text",
"name": "string",
"status": "draft",
"url": {},
"ai_enabled": true,
"origin": {},
"file_name": {},
"size_bytes": 1,
"page_count": {},
"error": {},
"last_trained_at": {},
"last_synced_at": {},
"created_at": {},
"updated_at": {},
"content": "string",
"questions": {},
"answer": {},
"config": {
"url": {},
"include_urls": [
"string"
],
"exclude_paths": [
"string"
],
"max_pages": {},
"refresh": "never"
},
"recent_syncs": [
{
"status": "syncing",
"pages": 1,
"error": {},
"started_at": {},
"completed_at": {}
}
]
}Retrieve a knowledge source
/v1/knowledge_base/sources/{id}Includes the full text (text, Q&A), the questions and answer (Q&A), or the crawl settings and the last 5 syncs (website).
Required scope: knowledge_base:read.
curl "https://api.asks.app/v1/knowledge_base/sources/<id>" \
-H "Authorization: Bearer $ASKS_API_KEY"{
"object": "knowledge_source",
"id": "string",
"type": "text",
"name": "string",
"status": "draft",
"url": {},
"ai_enabled": true,
"origin": {},
"file_name": {},
"size_bytes": 1,
"page_count": {},
"error": {},
"last_trained_at": {},
"last_synced_at": {},
"created_at": {},
"updated_at": {},
"content": "string",
"questions": {},
"answer": {},
"config": {
"url": {},
"include_urls": [
"string"
],
"exclude_paths": [
"string"
],
"max_pages": {},
"refresh": "never"
},
"recent_syncs": [
{
"status": "syncing",
"pages": 1,
"error": {},
"started_at": {},
"completed_at": {}
}
]
}Update a knowledge source
/v1/knowledge_base/sources/{id}Text and Q&A: new content overwrites the source and retrains it immediately — the previous text is gone. Websites: change the page selection, exclusions, page cap or auto-refresh (the URL is immutable — delete and recreate). Files can only be changed in the dashboard.
Required scope: knowledge_base:write.
namestringcontentstringText sources: replaces the content.
questionsarray of stringQ&A sources.
answerstringQ&A sources.
ai_enabledbooleanText and Q&A: switch the source on/off for the AI agent.
include_urlsarray of stringexclude_pathsarray of stringmax_pagesintegerrefreshstringOne of: never, daily, weekly, monthly.
curl -X PATCH "https://api.asks.app/v1/knowledge_base/sources/<id>" \
-H "Authorization: Bearer $ASKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"content": "string",
"questions": [
"string"
],
"answer": "string",
"ai_enabled": true,
"include_urls": [
"string"
],
"exclude_paths": [
"string"
],
"max_pages": 1,
"refresh": "never"
}'{
"object": "knowledge_source",
"id": "string",
"type": "text",
"name": "string",
"status": "draft",
"url": {},
"ai_enabled": true,
"origin": {},
"file_name": {},
"size_bytes": 1,
"page_count": {},
"error": {},
"last_trained_at": {},
"last_synced_at": {},
"created_at": {},
"updated_at": {},
"content": "string",
"questions": {},
"answer": {},
"config": {
"url": {},
"include_urls": [
"string"
],
"exclude_paths": [
"string"
],
"max_pages": {},
"refresh": "never"
},
"recent_syncs": [
{
"status": "syncing",
"pages": 1,
"error": {},
"started_at": {},
"completed_at": {}
}
]
}Delete a knowledge source
/v1/knowledge_base/sources/{id}Removes the source and everything learned from it (a website takes its crawled pages with it). Immediate and permanent.
Required scope: knowledge_base:delete.
curl -X DELETE "https://api.asks.app/v1/knowledge_base/sources/<id>" \
-H "Authorization: Bearer $ASKS_API_KEY"{
"object": "knowledge_source",
"id": "string",
"type": "text",
"deleted": true
}Re-sync a website
/v1/knowledge_base/sources/{id}/syncRe-crawls a website source in the background and answers 202 with the source syncing. Re-syncs follow the plan's refresh frequency (PLAN_LIMIT_REACHED when synced too recently).
Required scope: knowledge_base:write.
curl -X POST "https://api.asks.app/v1/knowledge_base/sources/<id>/sync" \
-H "Authorization: Bearer $ASKS_API_KEY"{
"object": "knowledge_source",
"id": "string",
"type": "text",
"name": "string",
"status": "draft",
"url": {},
"ai_enabled": true,
"origin": {},
"file_name": {},
"size_bytes": 1,
"page_count": {},
"error": {},
"last_trained_at": {},
"last_synced_at": {},
"created_at": {},
"updated_at": {},
"content": "string",
"questions": {},
"answer": {},
"config": {
"url": {},
"include_urls": [
"string"
],
"exclude_paths": [
"string"
],
"max_pages": {},
"refresh": "never"
},
"recent_syncs": [
{
"status": "syncing",
"pages": 1,
"error": {},
"started_at": {},
"completed_at": {}
}
]
}