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

# Connect GitBook

> | Field | Example | Where to get it | |-------|---------|-----------------| | Space ID | abc123xyz | Open the space in GitBook — the ID is in the URL after /space/ or findable via the GitBook API.

<Tip>
  Configure the source at [**AI Training → Data Sources**](https://platform.open.cx/data-sources).
</Tip>

## Set up the sync

<Steps>
  <Step title="Open Data Sources">
    Go to [**AI Training → Data Sources**](https://platform.open.cx/data-sources).
  </Step>

  <Step title="Add a GitBook source">
    Click **Add source → GitBook**.

    | Field            | Example     | Where to get it                                                                                                                                            |
    | ---------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | **Space ID**     | `abc123xyz` | Open the space in GitBook — the ID is in the URL after `/space/` or findable via the GitBook API.                                                          |
    | **Access Token** | `gb_…`      | [Create a personal access token](https://developer.gitbook.com/gitbook-api/authentication) in your GitBook account. It must have read access to the space. |
  </Step>

  <Step title="Start the sync">
    Click **Connect**. The first run pulls all pages in the space, typically in seconds to a minute.
  </Step>

  <Step title="Verify in AI Instructions">
    Open [**AI Training → AI Instructions**](https://platform.open.cx/ai-instructions). Content appears under **GitBook**, linked to the page URLs in your GitBook space.
  </Step>
</Steps>

## What gets synced

<AccordionGroup>
  <Accordion title="Content pages" icon="file-lines">
    Every page in the space, with title and body. Nested pages flattened into the index but keep their GitBook URL.
  </Accordion>

  <Accordion title="Workspace metadata" icon="users">
    Users, organizations, insights, and org members sync as context. The AI uses these sparingly — they're not the main driver for answers.
  </Accordion>

  <Accordion title="Visibility" icon="eye">
    * Published content → **public**
    * Unpublished content → **internal**

    Toggle visibility in GitBook; it flips on the next sync.
  </Accordion>
</AccordionGroup>

## Limits

|                       | Value                                                           |
| --------------------- | --------------------------------------------------------------- |
| **Streams synced**    | `content`, `users`, `organizations`, `insights`, `org_members`  |
| **Sync mode**         | `full_refresh_append`                                           |
| **Sync cadence**      | Airbyte polling — typically every few hours                     |
| **Credential type**   | Personal access token                                           |
| **Multi-space**       | One space per connection (add more connections for more spaces) |
| **Selective scoping** | None — hide pages in GitBook to keep them out                   |

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="GitBook overview" icon="book" href="/knowledge/sources/gitbook/overview">
    Scope and behavior.
  </Card>

  <Card title="Troubleshooting" icon="wrench" href="/knowledge/sources/gitbook/troubleshooting">
    Auth, wrong space, empty content.
  </Card>

  <Card title="Website crawler" icon="globe" href="/knowledge/sources/website/overview">
    Fallback for public GitBook sites.
  </Card>

  <Card title="Connect a knowledge source" icon="brain" href="/knowledge/sources/overview">
    All sources.
  </Card>
</CardGroup>
