Create knowledge bases, connect sources and manage access.
{
"id": "kb_01j9x3k2m7",
"name": "ops-eu",
"description": "Operations policies, SOPs and supplier data",
"region": "eu-north-1",
"document_count": 4210,
"chunk_count": 12408,
"last_synced_at": "2026-09-19T08:12:04Z",
"created_at": "2026-03-20T09:00:00Z"
}
| Method | Path | Purpose |
|---|---|---|
GET | /knowledge-bases | List |
POST | /knowledge-bases | Create |
GET | /knowledge-bases/{id} | Retrieve |
PATCH | /knowledge-bases/{id} | Update name/description/settings |
DELETE | /knowledge-bases/{id} | Delete (and its documents) |
GET | /knowledge-bases/{id}/sources | List sources |
POST | /knowledge-bases/{id}/sources | Add a source |
POST | /knowledge-bases/{id}/sources/{source_id}/sync | Trigger a sync |
DELETE | /knowledge-bases/{id}/sources/{source_id} | Remove a source |
GET | /knowledge-bases/{id}/access | List grants |
PUT | /knowledge-bases/{id}/access | Replace grants |
curl -X POST https://api.brewmycode.com/v1/knowledge-bases \
-H "Authorization: Bearer $BMC_API_KEY" -H "Content-Type: application/json" \
-d '{ "name": "ops-eu", "description": "Operations policies, SOPs and supplier data" }'
Sources that need OAuth are authorised in the web app; the API can add sources for connectors that use stored credentials (databases, websites, API-key systems) and can manage scope for any source.
curl -X POST https://api.brewmycode.com/v1/knowledge-bases/kb_01j9x3k2m7/sources \
-H "Authorization: Bearer $BMC_API_KEY" -H "Content-Type: application/json" \
-d '{
"connector": "website",
"config": { "start_urls": ["https://help.example.com/"], "include_paths": ["/articles/"], "schedule": "daily" }
}'
curl -X PUT https://api.brewmycode.com/v1/knowledge-bases/kb_01j9x3k2m7/access \
-H "Authorization: Bearer $BMC_API_KEY" -H "Content-Type: application/json" \
-d '{
"users": ["marja@example.com"],
"groups": ["operations"],
"channels": ["slack:C0123ABC"],
"agents": ["agt_01j9…"]
}'