Knowledge Bases
Upload Text
Creates a new knowledge base item from direct text input.
POST
/
v1
/
knowledge
/
learn
curl -X POST https://api.bland.ai/v1/knowledge/learn \
-H "authorization: Bearer YOUR_API_KEY" \
-H "content-type: application/json" \
-d '{
"type": "text",
"name": "Product Information",
"description": "Product specifications and features",
"text": "Our flagship product offers advanced AI capabilities with industry-leading accuracy. It supports multiple languages, real-time processing, and seamless integration with existing systems. The product includes comprehensive APIs, detailed documentation, and 24/7 support."
}'
{
"type": "text",
"name": "Company Policies",
"description": "Internal policies and procedures",
"text": "1. Work Hours: Standard work hours are 9 AM to 5 PM, Monday through Friday.\n2. Remote Work: Employees may work remotely up to 3 days per week with manager approval.\n3. Time Off: All employees accrue 15 days of PTO annually.\n4. Equipment: Company laptops must be returned within 30 days of termination."
}
{
"data": {
"id": "kb_01H8X9QK5R2N7P3M6Z8W4Y1V6U",
"name": "Product Information",
"description": "Product specifications and features",
"status": "PROCESSING",
"type": "TEXT",
"created_at": "2025-01-15T11:00:00Z",
"updated_at": "2025-01-15T11:00:00Z"
},
"errors": null
}
{
"data": null,
"errors": [
{
"error": "INVALID_INPUT",
"message": "Text content exceeds maximum size of 1MB"
}
]
}
Create a knowledge base item by providing text content directly in the request. This is ideal for when you have structured text content that you want to make searchable for your AI agents.
Docs for agents: llms.txt
Headers
Body Parameters
Response
The created knowledge base item object.
curl -X POST https://api.bland.ai/v1/knowledge/learn \
-H "authorization: Bearer YOUR_API_KEY" \
-H "content-type: application/json" \
-d '{
"type": "text",
"name": "Product Information",
"description": "Product specifications and features",
"text": "Our flagship product offers advanced AI capabilities with industry-leading accuracy. It supports multiple languages, real-time processing, and seamless integration with existing systems. The product includes comprehensive APIs, detailed documentation, and 24/7 support."
}'
{
"type": "text",
"name": "Company Policies",
"description": "Internal policies and procedures",
"text": "1. Work Hours: Standard work hours are 9 AM to 5 PM, Monday through Friday.\n2. Remote Work: Employees may work remotely up to 3 days per week with manager approval.\n3. Time Off: All employees accrue 15 days of PTO annually.\n4. Equipment: Company laptops must be returned within 30 days of termination."
}
{
"data": {
"id": "kb_01H8X9QK5R2N7P3M6Z8W4Y1V6U",
"name": "Product Information",
"description": "Product specifications and features",
"status": "PROCESSING",
"type": "TEXT",
"created_at": "2025-01-15T11:00:00Z",
"updated_at": "2025-01-15T11:00:00Z"
},
"errors": null
}
{
"data": null,
"errors": [
{
"error": "INVALID_INPUT",
"message": "Text content exceeds maximum size of 1MB"
}
]
}
Docs for agents: llms.txt
Was this page helpful?
⌘I
curl -X POST https://api.bland.ai/v1/knowledge/learn \
-H "authorization: Bearer YOUR_API_KEY" \
-H "content-type: application/json" \
-d '{
"type": "text",
"name": "Product Information",
"description": "Product specifications and features",
"text": "Our flagship product offers advanced AI capabilities with industry-leading accuracy. It supports multiple languages, real-time processing, and seamless integration with existing systems. The product includes comprehensive APIs, detailed documentation, and 24/7 support."
}'
{
"type": "text",
"name": "Company Policies",
"description": "Internal policies and procedures",
"text": "1. Work Hours: Standard work hours are 9 AM to 5 PM, Monday through Friday.\n2. Remote Work: Employees may work remotely up to 3 days per week with manager approval.\n3. Time Off: All employees accrue 15 days of PTO annually.\n4. Equipment: Company laptops must be returned within 30 days of termination."
}
{
"data": {
"id": "kb_01H8X9QK5R2N7P3M6Z8W4Y1V6U",
"name": "Product Information",
"description": "Product specifications and features",
"status": "PROCESSING",
"type": "TEXT",
"created_at": "2025-01-15T11:00:00Z",
"updated_at": "2025-01-15T11:00:00Z"
},
"errors": null
}
{
"data": null,
"errors": [
{
"error": "INVALID_INPUT",
"message": "Text content exceeds maximum size of 1MB"
}
]
}