Skip to main content
POST
/
knowledge-bases
/
create-from-url
Create Knowledge Base From URL
curl --request POST \
  --url https://api.example.com/knowledge-bases/create-from-url

Request

Content-Type: application/x-www-form-urlencoded
curl -X POST "https://your-instance.agentflow.ai/api/v1/knowledge-bases/create-from-url" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "name=Product Docs" \
  -d "description=Public product documentation" \
  --data-urlencode "website_url=https://docs.example.com" \
  -d "chunk_size=1200" \
  -d "overlap_percentage=0.125" \
  -d "max_crawl_depth=2" \
  -d "max_crawl_pages=20" \
  --data-urlencode 'include_patterns=["/docs/*"]' \
  --data-urlencode 'exclude_patterns=["/blog/*"]'
FieldTypeRequiredDefaultDescription
namestringyesKB name
website_urlstringyesWebsite root URL to crawl
descriptionstringnoWhat the KB contains
tagsstringnoComma-separated tags
chunk_sizeintno1200Target chunk size
overlap_percentagefloatno0.125Overlap between chunks
chunking_strategystringnohtmlChunking strategy
vector_db_typestringnopgvectorVector database backend
max_crawl_depthintno3Maximum link depth to crawl
max_crawl_pagesintno20Maximum pages to crawl
include_patternsJSON-array stringnoOptional include patterns, for example ["/docs/*"]
exclude_patternsJSON-array stringnoOptional exclude patterns, for example ["/blog/*"]

Response

{
  "message": "Knowledge base 'Product Docs' created from website",
  "id": "kb_abc123",
  "name": "Product Docs",
  "website_url": "https://docs.example.com",
  "pages_crawled": 20,
  "status": "completed",
  "configuration": {
    "id": "kb_abc123",
    "name": "Product Docs",
    "description": "Public product documentation",
    "source_type": "website"
  },
  "source_type": "website"
}