POST
/
v1
/
knowledge
/
learn
curl -X POST https://api.bland.ai/v1/knowledge/learn \
  -H "authorization: YOUR_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "type": "web",
    "name": "Documentation",
    "description": "Complete product documentation",
    "urls": [
      "https://docs.example.com/overview",
      "https://docs.example.com/api-reference",
      "https://docs.example.com/tutorials"
    ]
  }'
{
  "data": {
    "id": "kb_01H8X9QK5R2N7P3M6Z8W4Y1V7V",
    "name": "Documentation",
    "description": "Complete product documentation",
    "status": "PROCESSING",
    "type": "WEB_SCRAPE",
    "source_urls": "https://docs.example.com/overview,https://docs.example.com/api-reference,https://docs.example.com/tutorials",
    "base_url": "https://docs.example.com",
    "created_at": "2025-01-15T12:00:00Z",
    "updated_at": "2025-01-15T12:00:00Z"
  },
  "errors": null
}
Create a knowledge base by scraping content from one or more web URLs. This is perfect for creating knowledge bases from documentation sites, blog posts, or other web-based content.

Headers

authorization
string
required
Your API key for authentication.
content-type
string
required
Must be application/json for web scraping knowledge bases.

Body Parameters

type
string
default:"web"
required
Must be "web" for web scraping knowledge bases.
name
string
required
Name for the knowledge base.
description
string
Optional description of the knowledge base content.
urls
string[]
required
Array of URLs to scrape (maximum 100 URLs).

Response

data
object
The created knowledge base object.
data.id
string
Unique identifier for the knowledge base.
data.name
string
Name of the knowledge base.
data.description
string
Description of the knowledge base (if provided).
data.status
string
Current status: "PROCESSING", "COMPLETED", "FAILED", or "DELETED".
data.type
string
Will be "WEB_SCRAPE" for web scraping knowledge bases.
data.source_urls
string
Source URLs that were scraped (comma-separated).
data.base_url
string
Base URL derived from the provided URLs.
data.created_at
string
ISO timestamp of creation.
data.updated_at
string
ISO timestamp of last update.
data.error_message
string
Error message if status is "FAILED".
errors
null
Will be null on successful creation.
curl -X POST https://api.bland.ai/v1/knowledge/learn \
  -H "authorization: YOUR_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "type": "web",
    "name": "Documentation",
    "description": "Complete product documentation",
    "urls": [
      "https://docs.example.com/overview",
      "https://docs.example.com/api-reference",
      "https://docs.example.com/tutorials"
    ]
  }'
{
  "data": {
    "id": "kb_01H8X9QK5R2N7P3M6Z8W4Y1V7V",
    "name": "Documentation",
    "description": "Complete product documentation",
    "status": "PROCESSING",
    "type": "WEB_SCRAPE",
    "source_urls": "https://docs.example.com/overview,https://docs.example.com/api-reference,https://docs.example.com/tutorials",
    "base_url": "https://docs.example.com",
    "created_at": "2025-01-15T12:00:00Z",
    "updated_at": "2025-01-15T12:00:00Z"
  },
  "errors": null
}