Skip to content

Confluence — Overview

The @forge-clients/confluence package provides type-safe clients for the Confluence Cloud REST API, generated from Atlassian’s official OpenAPI specifications.

ModuleImport pathEndpointsDescription
Confluence v2@forge-clients/confluence/v2213Current Confluence REST API (recommended)
Confluence v1@forge-clients/confluence/v1130Legacy Confluence REST API

Use Confluence v2 for new development. It is the current, actively developed API with improved pagination (cursor-based), cleaner resource modelling, and better consistency. Confluence v1 is maintained for backwards compatibility.

// ✅ Recommended — v2 is the default export
import { getPages, getPageById } from '@forge-clients/confluence';
import { getPages, getPageById } from '@forge-clients/confluence/v2'; // explicit
// ⚠️ Legacy v1 — use only if you need endpoints not yet in v2
import { getContentById, createContent } from '@forge-clients/confluence/v1';

The root @forge-clients/confluence import defaults to v2. It also re-exports v1 as the ConfluenceV1 namespace for cases where you need both APIs in the same file:

import {
getPages, // v2 function (default)
ConfluenceV1, // v1 namespace
} from '@forge-clients/confluence';
// Use v2
const pages = await getPages(client, { spaceId: ['123'] });
// Use v1 via namespace
const content = await ConfluenceV1.getContentById(client, { path: { id: '456' } });

Function names match the operationId from the OpenAPI spec, converted to camelCase:

REST endpointFunction name
GET /wiki/api/v2/pagesgetPages
GET /wiki/api/v2/pages/{id}getPageById
POST /wiki/api/v2/pagescreatePage
GET /wiki/api/v2/spacesgetSpaces
GET /wiki/api/v2/attachmentsgetAttachments
REST endpointFunction name
GET /wiki/rest/api/content/{id}getContentById
POST /wiki/rest/api/contentcreateContent
GET /wiki/rest/api/spacegetSpaces
GET /wiki/rest/api/searchsearch
GET /wiki/rest/api/user/currentgetCurrentUser

All types are individually exported from each module:

import { ForgeFunctionAdapter, asApp } from '@forge-clients/core';
import { getPageById } from '@forge-clients/confluence/v2';
import type { PageSingle } from '@forge-clients/confluence/v2';
const adapter = new ForgeFunctionAdapter({ product: 'confluence' });
const page: PageSingle = await getPageById(asApp(adapter), {
path: { id: '123456' },
});
console.log(page.title);