> Source: https://builder.ema.ai/v2/integrations-data/data-connectors-confluence
> Title: Confluence Connector

# Confluence Connector

The Confluence connector syncs pages and their attachments from Confluence Cloud into a [Knowledge base](/builder/v2/integrations-data/data-connectors) so an AI Employee (AIE) can search and cite that content. It reaches Confluence through the Atlassian Confluence REST API and supports two authentication modes: **OAuth2** (sign in with Atlassian) and **Basic auth** (account email plus a scoped API token).

You set up a Confluence connection from the **Data sources** tab of the Integrations page. Creating a connection is admin-only — builders never see credentials; they reference the resulting Knowledge base when configuring a workflow.

## What it ingests

The connector syncs whole **spaces** and/or **page subtrees** (a root page plus all its descendants). For each page it fetches the export-view HTML body and records the page title, its hierarchical folder path (reconstructed from the page's ancestor chain, e.g. `/ENG/Getting Started/Installation/`), and its version number for incremental sync. It then fetches each page's **attachments** in parallel and ingests those too.

The connector also follows **in-space cross-references**: it scans each page's HTML for links to other pages in the same space and pulls those pages (and their subtrees) in as well, within bounded crawl caps. Pages and attachments are deduplicated by ID, so a page reachable through both a space and a root-page scope is ingested once. Everything flows through the shared ingestion pipeline (extract → chunk → embed → store) described in [Data Connectors](/builder/v2/integrations-data/data-connectors).

## How to connect

Open the **Data sources** tab, select the Confluence tile, and choose an authentication mode. Both modes ask for a connection **name** and an optional **description**. When OAuth2 is configured on your platform it is selected by default; Basic auth is always available.

### OAuth2 (sign in with Atlassian)

OAuth2 uses the Atlassian authorization-code flow — no credentials to store or rotate yourself. This mode is available only when Confluence OAuth2 is configured on your Ema platform; the option is disabled with a notice when it isn't. To connect:

1.  Enter a connection **name** and select **Connect with Atlassian**.
2.  Ema redirects you to Atlassian's authorization screen. Select the Confluence Cloud site to connect and approve the requested read scopes.
3.  Atlassian redirects back to Ema's callback, which resolves the site's cloud ID, stores the access and refresh tokens encrypted, and creates the connection.

The scopes requested are read-only:

`read:content:confluence`, `read:content-details:confluence`, `read:space-details:confluence`, `read:page:confluence`, `read:attachment:confluence`, `read:user:confluence`, `read:space:confluence`, `read:content.metadata:confluence`, and `offline_access`.

> [INFO]
> **Token refresh.** Ema reads the access token's expiry from its JWT and refreshes it with the stored refresh token before — and, on a 401/403, during — a sync. Because Atlassian rotates the refresh token on each use, Ema persists the new one so syncs keep working across restarts.

### Basic auth (email + API token)

Basic auth uses your Atlassian account email and a scoped API token. The setup form collects:

Field

What it is

Connection name

A display name for this connection.

Description

Optional note.

Base URL

Your Atlassian site root, e.g. `https://yourorg.atlassian.net`. Do not include `/wiki` or any trailing path.

Email

The Atlassian account email tied to the API token.

API token

A scoped API token (stored encrypted).

Generate the token at Atlassian's API-tokens page using **Create API token with scopes**, enabling the same read scopes listed above (excluding `offline_access`), and set the longest expiry available to avoid frequent rotation. The authenticating account must have at least **Viewer** access to the spaces you want to sync.

## Sync configuration

Scope and schedule are set on the Knowledge base built from the connection. One connection can feed several Knowledge bases scoped to different spaces or pages.

### Space and page scope

In the Knowledge base's **Confluence scope** card, paste Confluence URLs for the spaces and/or pages to index. Ema resolves them into:

-   **Space keys** — sync every page in the space.
-   **Root page IDs** — sync that page and all of its descendants.

If no scope is set, the sync has nothing to pull — set at least one space or page. The authenticating account must have at least **Viewer** access to whatever you scope.

### Schedule

In the Knowledge base's **Sync configuration**, set:

-   **Sync enabled** — turn syncing on or off.
-   **Schedule** — **Interval** (sync automatically, in minutes) or **Manual** (only on demand).
-   **Sync now** — trigger a one-off sync at any time.

Syncs are **incremental**: the connector compares each page's or attachment's version number against the stored content hash and skips unchanged items.

## Limits and behavior

-   **Confluence Cloud.** The connector targets Confluence Cloud sites (`*.atlassian.net`).
-   **Read-only.** Both modes request read scopes only — the connector never writes to Confluence.
-   **Scope is required.** Unlike folder connectors, Confluence syncs only what you scope by space key or root page ID; it does not sync the whole instance by default.
-   **Pages and attachments.** Page bodies are ingested as HTML; attachments are ingested only when their type is supported (PDF; Office documents; text, Markdown, CSV, HTML, JSON; and images via a vision model). Trashed or non-current attachments are skipped.
-   **Cross-reference crawl is bounded.** In-space cross-reference discovery is capped (page and API-call limits) to prevent runaway fan-out on heavily linked spaces.
-   **Rate limits** from Confluence (HTTP 429/503) are retried with `Retry-After` back-off, capped at five minutes per wait, up to three attempts.

## What's next

-   [Data Connectors](/builder/v2/integrations-data/data-connectors) — the connection model, the ingestion pipeline, and how connectors compare to Tools.
-   [SharePoint Connector](/builder/v2/integrations-data/data-connectors-sharepoint), [Google Drive Connector](/builder/v2/integrations-data/data-connectors-google-drive), [Box Connector](/builder/v2/integrations-data/data-connectors-box) — the other source connectors.
