Confluence

Connect Confluence spaces via API token

Sync Confluence pages and spaces to Twig.

Prerequisites

  • Confluence Cloud account

  • Read access to target spaces

  • Ability to generate API tokens

Setup Steps

1. Get Confluence Domain

  1. Open your Confluence space in browser

  2. Copy domain from URL:

    https://yourcompany.atlassian.net/wiki/...
             ^^^^^^^^^^^^^^^^^^^^^^^^
             Copy this domain
  3. Format: yourcompany.atlassian.net

2. Get Space Key

  1. Open target space in Confluence

  2. Click Space Settings (gear icon)

  3. Copy Space Key (e.g., "PROD", "ENG", "DOCS")

Expected format: 2-10 uppercase letters

3. Generate API Token

  1. Click profile icon (top right) → Manage Account

  1. Click Security tab

  1. Click Create and manage API tokens

  1. Click Create API token

  1. Enter:

    • Label: "Twig Integration"

    • Expires: Select date (recommended: 90 days)

  2. Click Create

  3. Copy token (format: 24-character alphanumeric)

Token shown once: Store securely

4. Connect in Twig

You need:

  • Domain: yourcompany.atlassian.net

  • Space Key: e.g., "PROD"

  • Email: Your Confluence email

  • API Token: From step 3

Steps:

  1. Twig → Data → Add Data Source → Confluence

  1. Fill form:

    • Name: e.g., "Product Docs Space"

    • Domain: yourcompany.atlassian.net

    • Space Key: PROD

    • API Token: Paste token

    • Lookback Period: e.g., "90 days" (optional, imports pages modified in last N days)

  2. Click Test Config

Expected result: "Connection successful, found X pages"

  1. Click Save

  1. Processing starts automatically

Expected timeline: 10-30 min for 100 pages

How to Verify

  1. Data → [Confluence Source] → status "Active" (green)

  2. Shows "X pages indexed" (e.g., "245 pages → 1,200 chunks")

  3. Playground → Query about Confluence content → Check citations reference Confluence pages

Common Mistakes

Symptom: "401 Unauthorized" error

Cause: Invalid API token or email

Fix:

  1. Verify email matches Confluence account

  2. Regenerate API token in Confluence

  3. Update token in Twig (Edit → paste new token)


Symptom: "Space not found"

Cause: Wrong space key or no access

Fix:

  1. Verify space key exact match (case-sensitive)

  2. Check you have read access to space in Confluence

  3. Try different space if needed

When This Doesn't Apply

Confluence Server/Data Center (self-hosted): Requires Personal Access Token instead of API token. Contact support for configuration.

Multiple spaces: Create separate data source per space (no multi-space support in single connector).

Last updated