# REST API, webhooks and MCP

Source: https://helpcenterkit.com/docs/en/api-and-mcp

## API keys

Create keys in *Workspace → API & webhooks*. A **read** key can list, search and answer; a **write** key can also create and update articles. Send it as `Authorization: Bearer hk_…`. The key is shown once.

## Endpoints

The full, machine-readable description is at `/api/v1/openapi.json`. The main endpoints:

| Method and path | Purpose |
| --- | --- |
| `GET /api/v1/kbs` | Your knowledge bases |
| `GET /api/v1/kbs/{kb}/articles?updated_since=` | Published articles with Markdown |
| `GET /api/v1/kbs/{kb}/chunks?updated_since=` | Retrieval-ready sections for your own AI |
| `POST /api/v1/kbs/{kb}/search` | Keyword and typo-tolerant search |
| `POST /api/v1/kbs/{kb}/answer` | AI answer with citations |
| `POST /api/v1/kbs/{kb}/articles` | Create a draft (write key) |

```bash
curl -H "Authorization: Bearer $HELPCENTERKIT_KEY" \
  -X POST https://helpcenterkit.com/api/v1/kbs/your-kb/answer \
  -H "Content-Type: application/json" -d '{"question":"How do I reset my password?"}'
```

## Webhooks

Get a POST when an article is published, unpublished or deleted, when feedback arrives, or when the AI can't answer a question. Each request carries `X-HelpCenterKit-Signature: sha256=<HMAC of the body>` using the webhook's secret.

## MCP for AI agents

Point any Model Context Protocol client (Claude, Cursor, your own agent) at `/api/mcp` with your API key as a Bearer token. Tools: list knowledge bases, search articles, get an article, answer a question, and with a write key create or update drafts.

## For AI crawlers

Every public portal has `llms.txt` and `llms-full.txt`, and every article is available as Markdown by adding `.md` to its address.
