# Confluence Connector - Technical Manual

The Confluence Connector is a Node.js-based service that synchronizes page content and file attachments from Confluence to the Unique platform. It supports both Confluence Cloud and Confluence Data Center deployments.

**Core Capabilities:**

- Discovers pages via Confluence Query Language (CQL) label searches
- Fetches page content in HTML (Confluence storage representation) and downloads file attachments (including embedded images)
- Computes per-space file diffs against previously ingested state to detect new, updated, and deleted items
- Ingests content into the Unique knowledge base via the Unique API
- Manages scope hierarchies automatically (root scope plus one child scope per Confluence space)
- Operates on a configurable cron schedule (default: every 15 minutes)

## Documentation

| Document | Description |
| --- | --- |
| [Architecture](https://docs.unique.ai/it-operators/integrations-connectors/confluence-connector/confluence-connector-technical-manual/confluence-connector-architecture) | System components, multi-tenancy, connectivity |
| [Flows](https://docs.unique.ai/it-operators/integrations-connectors/confluence-connector/confluence-connector-technical-manual/confluence-connector-flows) | Content sync, file diff mechanism, discovery, ingestion |
| [Permissions](https://docs.unique.ai/it-operators/integrations-connectors/confluence-connector/confluence-connector-technical-manual/confluence-connector-permissions) | Confluence API and Unique platform permissions |
| [Security](https://docs.unique.ai/it-operators/integrations-connectors/confluence-connector/confluence-connector-technical-manual/confluence-connector-security) | Security practices, data handling |

## Key Concepts

### Pull-Based Architecture

The Confluence Connector **pulls** content from Confluence on a scheduled basis:

- The connector queries the Confluence REST API for labeled pages using CQL
- Content is fetched, diffed, and ingested into Unique
- Scheduling is controlled via a per-tenant cron expression (default: `*/15 * * * *`)

### Label-Driven Page Discovery

Pages are not automatically synced. Users must apply configurable Confluence labels to mark individual pages or entire page trees for synchronization:

### File Diff Mechanism

The connector maintains state to detect changes:

- **New items**: Labeled pages and attachments not previously synced
- **Updated items**: Items with changed metadata since last sync
- **Deleted items**: Previously synced items no longer labeled or deleted from Confluence

## Standard References

- [Confluence Cloud REST API](https://developer.atlassian.com/cloud/confluence/rest/v1/intro/) 
- [Confluence Data Center REST API](https://developer.atlassian.com/server/confluence/rest/)  
- [Confluence Query Language (CQL)](https://developer.atlassian.com/cloud/confluence/advanced-searching-using-cql/)
