> ## Documentation Index
> Fetch the complete documentation index at: https://help.hoopai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Knowledge Base Overview

> Create and manage knowledge bases, train content from website URLs, and manage FAQs using the HoopAI Knowledge Base REST API.

The Knowledge Base API lets you programmatically create and manage knowledge bases that power AI features across the HoopAI platform. Train your knowledge bases with website content via URL crawling, add FAQ entries, and manage all trained data — giving your AI agents and conversation bots the context they need to deliver accurate responses.

## Base URL

```
https://services.leadconnectorhq.com
```

## Authentication

All endpoints require a Bearer token and an API version header.

```bash theme={null}
Authorization: Bearer <access_token>
Version: 2021-07-28
```

See [OAuth 2.0](/api-reference/oauth/authorization) to obtain an access token.

## OAuth scopes

| Scope                     | Access                                                   |
| ------------------------- | -------------------------------------------------------- |
| `knowledge-base.readonly` | Read knowledge bases, URLs, and FAQs                     |
| `knowledge-base.write`    | Create, update, delete knowledge bases and train content |

## Quick start

Create a knowledge base and train it with a website:

```bash theme={null}
# 1. Create a knowledge base
curl -X POST https://services.leadconnectorhq.com/knowledge-base/ \
  -H "Authorization: Bearer <access_token>" \
  -H "Version: 2021-07-28" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Product Documentation",
    "locationId": "ve9EPM428h8vShlRW1KT"
  }'

# 2. Discover URLs from a website
curl -X POST https://services.leadconnectorhq.com/knowledge-base/kb_abc123/discover-website \
  -H "Authorization: Bearer <access_token>" \
  -H "Version: 2021-07-28" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://www.example.com"
  }'

# 3. Train the discovered URLs
curl -X POST https://services.leadconnectorhq.com/knowledge-base/kb_abc123/train-urls \
  -H "Authorization: Bearer <access_token>" \
  -H "Version: 2021-07-28" \
  -H "Content-Type: application/json" \
  -d '{
    "urls": [
      "https://www.example.com/about",
      "https://www.example.com/faq"
    ]
  }'
```

## Endpoints

### Knowledge bases

| Method   | Path                                | Description                             |
| -------- | ----------------------------------- | --------------------------------------- |
| `POST`   | `/knowledge-base/`                  | Create a knowledge base                 |
| `GET`    | `/knowledge-base/`                  | List all knowledge bases for a location |
| `GET`    | `/knowledge-base/{knowledgeBaseId}` | Get a knowledge base by ID              |
| `PUT`    | `/knowledge-base/{knowledgeBaseId}` | Update a knowledge base                 |
| `DELETE` | `/knowledge-base/{knowledgeBaseId}` | Delete a knowledge base                 |

### Web crawler

| Method   | Path                                                 | Description                      |
| -------- | ---------------------------------------------------- | -------------------------------- |
| `POST`   | `/knowledge-base/{knowledgeBaseId}/discover-website` | Discover URLs from a website     |
| `POST`   | `/knowledge-base/{knowledgeBaseId}/train-urls`       | Train discovered URLs            |
| `GET`    | `/knowledge-base/{knowledgeBaseId}/crawling-status`  | Get crawling and training status |
| `GET`    | `/knowledge-base/{knowledgeBaseId}/urls`             | Get all website URL data         |
| `DELETE` | `/knowledge-base/{knowledgeBaseId}/urls`             | Delete trained URLs              |

### FAQs

| Method   | Path                                             | Description          |
| -------- | ------------------------------------------------ | -------------------- |
| `POST`   | `/knowledge-base/{knowledgeBaseId}/faqs`         | Create a FAQ entry   |
| `GET`    | `/knowledge-base/{knowledgeBaseId}/faqs`         | List all FAQ entries |
| `PUT`    | `/knowledge-base/{knowledgeBaseId}/faqs/{faqId}` | Update a FAQ entry   |
| `DELETE` | `/knowledge-base/{knowledgeBaseId}/faqs/{faqId}` | Delete a FAQ entry   |

## Related

* [Conversation AI API](/api-reference/conversation-ai/overview) — Manage bots that use knowledge bases
* [Agent Studio API](/api-reference/agent-studio/overview) — Execute agents that reference knowledge base content
* [Contacts API](/api-reference/contacts/overview) — Look up contacts for context in AI conversations
