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

# BookStack

> Configure the mAItion BookStack connector to ingest shelves, books, chapters, and pages from a BookStack instance.

Use the BookStack Connector to ingest content from [BookStack](https://www.bookstackapp.com/) into the mAItion knowledge base.

## What It Does

* fetches shelves, books, chapters, and pages from a BookStack instance via its REST API
* converts page content to Markdown for indexing, preferring BookStack's native Markdown and falling back to converted HTML
* resolves each item's owning shelf, even for books, chapters, and pages where the API doesn't return `shelf_id` directly
* runs ingestion on configurable schedules

## Required Environment Variables

Set these in `.env.rag`:

* `BOOKSTACK1_BASE_URL`: base URL of your BookStack instance (example: `https://wiki.example.com`)
* `BOOKSTACK1_TOKEN_ID`: API token ID
* `BOOKSTACK1_TOKEN_SECRET`: API token secret
* `BOOKSTACK1_SCHEDULES`: ingestion interval in seconds (default: `3600`)

Generate an API token from your BookStack user profile page (**Edit Profile → API Tokens**). The token owner must have the **Access System API** permission, otherwise BookStack rejects API requests.

## `config.yaml` Example

```yaml theme={null}
sources:
  - type: "bookstack"
    name: "bookstack1"
    config:
      base_url: "${BOOKSTACK1_BASE_URL}"
      token_id: "${BOOKSTACK1_TOKEN_ID}"
      token_secret: "${BOOKSTACK1_TOKEN_SECRET}"
      item_types:              # optional, default: pages
        - "shelves"
        - "books"
        - "chapters"
        - "pages"
      schedules: "${BOOKSTACK1_SCHEDULES}"
      #request_delay: 0        # optional, delay in seconds between items (default: 0)
```

## `.env.rag` Example

```dotenv theme={null}
BOOKSTACK1_BASE_URL=https://wiki.example.com
BOOKSTACK1_TOKEN_ID=your-token-id
BOOKSTACK1_TOKEN_SECRET=your-token-secret
BOOKSTACK1_SCHEDULES=3600
```

## Configuration Reference

| Field | Required | Default | Description |
| - | - | - | - |
| `base_url` | yes | — | Base URL of your BookStack instance |
| `token_id` | yes | — | API token ID |
| `token_secret` | yes | — | API token secret |
| `item_types` | no | `pages` | Item types to ingest: any subset of `shelves`, `books`, `chapters`, `pages` |
| `schedules` | no | `3600` | Ingestion interval in seconds |
| `request_delay` | no | `0` | Seconds to wait after each successfully ingested item. Increase to avoid rate-limiting (e.g. `0.1`) |

## Multiple BookStack Sources

Add more `sources` entries (`bookstack2`, `bookstack3`, etc) with separate env vars per source.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.