Confluence Connector
The Confluence Connector integrates C3 AI applications with your Confluence content and provides secure, read-only access to Confluence knowledge assets. You can retrieve Confluence content such as pages, spaces, labels, attachments, blog posts, custom content, and tasks.
Prerequisites
To connect Confluence to C3 AI applications, ensure you have the following:
- An active Confluence account with permission to view the spaces or pages you intend to query.
- API token for that account. See Generate a Confluence API Token section.
Note Access to Confluence is enforced by the API. If your account cannot view an object in Confluence, you will not be able to fetch it via the API.
Authentication & Configuration
Authenticate and configure the Confluence connector using a Confluence API endpoint, username, and API token. This configuration provides read‑only access to Confluence content from C3 AI applications.
Generate a Confluence API Token
- Open Confluence and navigate to Account settings.
- Select Security → API tokens.
- Click Create and manage API tokens.
- Click Create API token. Give the token a recognizable name and set a custom expiry of up to one year.
- Copy the generated token and store it securely.
Note
You will not see the generated API token again after closing the dialog box. Keep the API token accessible only until you enter it during setup; once the configuration is complete, you can safely discard it.
Gather Required Fields
- Endpoint: The endpoint of the Confluence API server you want to access, example:
https://<your-domain>.atlassian.net/wiki/api/v2/ - Username: The username (email) of the account used to access the server. This must match the account used to generate the token.
- API Token: Token used for authentication. See Generate a Confluence API Token section.
Configure Confluence Credentials
To enable the Confluence Connector, configure the Confluence API endpoint together with the username and API token associated with your Confluence account. These values are used to construct a Base64‑encoded Basic Authentication header that is registered at the application level.
After you configure the connector, all subsequent API calls authenticate against the specified Confluence instance and use the permissions of the configured user.
// Setting credentials for Confluence
const endpoint = "https://<your-domain>.atlassian.net/wiki/api/v2/"; // API endpoint
const username = "<your-email>@example.com"; // Atlassian account email
const token = "<api-token>"; // API token from Confluence
// You can also set credentials at environment level if you want all applications to have access via the same account
// Same could apply to cluster level, assuming user has corresponding credentials
const credentials = `${username}:${token}`;
const auth = Base64.encodeString(credentials);
// Register the endpoint and auth for subsequent calls
Confluence.setApiUrlAndAuth(endpoint, `Basic ${auth}`, ConfigOverride.APP);Authorization Behavior
- Only content visible to the authenticated user is retrievable.
- If the user lacks access to a space, page, or resource, the API returns an authorization error or an empty result set.
Common Configuration Issues
| Issue | Likely Cause | Resolution |
|---|---|---|
| 401 Unauthorized | Invalid or expired API token | Generate a new token and update configuration |
| 403 Forbidden | API token is valid but the Confluence account does not have access to view the space or page | Grant access to required spaces or pages |
| Empty results | User cannot view requested content | Verify access in the Confluence UI |
| 404 Not Found | Incorrect API endpoint | Update credentials if the endpoint is incorrect. Confirm the base URL includes /wiki/api/v2/ |
| 429 Too Many Requests | Connector temporarily exceeded Confluence's API limits | Try again after waiting a minute |
Usage Patterns & Examples
The following read‑only retrieval APIs are available for Confluence:
- Pages
- Spaces
- Labels
- Attachments
- Blog Posts
- Custom Content
- Tasks
You can validate your Confluence credentials independently of the connector by making a direct REST API call using curl. See the Independent Credential Verification section for more information.
1. Pages
Description: Retrieve visible pages within a given space.
Parameters
| Name | Type | Description |
|---|---|---|
| id | int | Page ID |
| sort | string | Sort direction for the results. Supported values are "asc" (ascending) and "desc" (descending). Defaults to ascending order. |
APIs
getPagesBySpace(id)— Retrieves all visible pages in a given space.getPages(id, sort)— Retrieves all visible pages, optionally filtered by IDs and sorted.getPagesByLabel(id)— Retrieves pages associated with a specific label.
Examples
// List all visible pages
ConfluenceService.listPages()
// Retrieve pages for a space using space ID and you can limit the number of pages too
// getPagesBySpace(spaceId: int, limit: int)
Confluence.getPagesBySpace(5228003328, 150)
// Filter listPages by the pageIds
ConfluenceService.listPages([139956775, 1186234406])API Output
![]() |
| Confluence Connector API Output for List Pages |
2. Spaces
Description: Retrieve visible spaces by their space ID.
Parameters
| Name | Type | Description |
|---|---|---|
| ids | array | Filter by space IDs. |
| keys | array | Filter by space keys (e.g., "ENG"). |
| sort | string | Sort direction for the results. Supported values are "asc" and "desc". Defaults to ascending order. |
APIs
getSpaces(ids, keys, sort)— Retrieves all visible spaces, with optional filtering by ID or key and sorting.getSpaceById(id)— Retrieves a space by its ID.
Examples
// List all visible spaces
ConfluenceService.listSpaces()
// Filter the listed spaces by the space IDs and the keys. You can also limit the number of results
// listSpaces(ids: [int], keys: [string], limit: int)
ConfluenceService.listSpaces(null, ["ENG", "SCS"])
// Can list all available spaces by increasing the limit to 100
ConfluenceService.listSpaces(null, null, 100)API Output
![]() |
| Confluence Connector API Output for List Spaces |
3. Labels
Description: Retrieve visible labels associated with a specific space ID or page ID.
Parameters
| Name | Type | Description |
|---|---|---|
| id | int | Page ID |
| prefix | string | Filter labels by leading text |
| sort | string | Sort direction for the results. Supported values are "asc" (ascending) and "desc" (descending). Defaults to ascending order. |
APIs
getLabels(prefix, sort)— Retrieves all visible labels, filtered by prefix and sorted.getLabelsByPage(id, prefix)— Retrieves labels associated with a specific page.getLabelsBySpace(id, prefix)— Retrieves labels associated with a specific space.
Examples
// List all visible labels
ConfluenceService.listLabels()
// Filter labels based on their spaceId, pageId as well as the value of the prefix.
// listLabels(select: string, id: int, prefix: [string], limit: int)
ConfluenceService.listLabels(null, null, 'team', 100)
// Retrieve labels for a particular space by its ID.
ConfluenceService.listLabels('space', 5228003328)
// Retrieve labels for a particular page by its ID.
ConfluenceService.listLabels('page', 192479460)
// Retrieve all the pages which consist of a particular label by using the label ID.
Confluence.getPagesByLabel(2654210)4. Attachments
Description: Retrieve visible attachments across Confluence, with optional filtering and sorting.
Parameters
| Name | Type | Description |
|---|---|---|
| filename | string | Filter by filename (exact or prefix depending on backend). |
| mediaType | string | Filters attachments by MIME type (for example, image/png, application/pdf). |
| sort | string | Sort direction for the results. Supported values are "asc" and "desc". Defaults to ascending order. |
APIs
getAttachments(filename, mediaType, sort)— Retrieves all visible attachments, filtered and sorted as needed.getAttachmentById(id)— Retrieves a specific attachment by its ID.getAttachmentsByPage(id, filename, mediaType, sort)— Retrieves attachments belonging to a specific page.
Examples
// List all visible attachments
ConfluenceService.listAttachments()
// Filter listed attachments based on filename and mediaType.
// listAttachments(filename: string, mediaType: string, limit: int)
ConfluenceService.listAttachments(null, "image/png", 10)
// List all attachments for a page, given the page ID.
ConfluenceService.listAttachmentsByPage(139956775)5. Blog Posts
Description: Retrieve visible blog posts, with optional filtering and sorting.
Parameters
| Name | Type | Description |
|---|---|---|
| id | string | Filter by blogpost IDs |
| title | string | Filter by title (exact/contains depending on backend) |
| sort | string | Sort direction for the results. Supported values are "asc" and "desc". Defaults to ascending order. |
APIs
getBlogPosts(id, title, sort)— Retrieves all visible blogposts, with filtering and sorting options.getBlogPostById(id)— Retrieves a specific blogpost by its ID.getBlogPostsBySpace(id, limit)— Retrieves blogposts from a specific space, limited in number.
Examples
// List visible blog posts
ConfluenceService.listBlogPosts()
// List blog posts for a particular space
ConfluenceService.listBlogPostsBySpace(1857814531)
// Filter blog posts by their IDs or title
// listBlogPosts(ids: [int], title: string, limit: int)
ConfluenceService.listBlogPosts(null, "Enterprise Digital Transformation")6. Custom Content
Description: Retrieve custom content entries (excludes pages, blog posts, and attachments).
Parameters
| Name | Type | Description |
|---|---|---|
| type | string | Content type key (e.g., com.atlassian.confluence.extra.teamcalendars:calendar-content-type). |
| spaceId | int | Restrict to a space. |
| id | int | Restrict to specific content IDs. |
| sort | string | Sort direction for the results. Supported values are "asc" and "desc". Defaults to ascending order. |
APIs
getCustomContent(type, spaceId, id, sort)— Retrieves custom content types (e.g., calendars), excluding pages, blogposts, attachments.
Examples
// List visible custom content
ConfluenceService.listCustomContent()
// Filter custom content by type, spaceIds, and IDs.
// listCustomContent(type: string, spaceIds: [int], ids: [int], limit: int)
// Filter custom content by type
ConfluenceService.listCustomContent("com.atlassian.confluence.extra.teamcalendars:calendar-content-type")
// Filter custom content by spaceIds, and IDs.
ConfluenceService.listCustomContent(null, [1036517645, 8369864908])
7. Tasks
Description: Retrieve visible tasks with optional filters.
Parameters
| Name | Type | Description |
|---|---|---|
| dueDate | DateTime | Filters tasks by due date. Only tasks due on or before the specified date are returned. |
| spaceId | int | Restrict to a space. |
| assignedTo | string | Filters tasks by assignee identifier. |
| status | string | Filters tasks by status (for example, open or complete). |
APIs
getTasks(dueDate, spaceId, assignedTo, status)— Retrieves all visible tasks with optional filters (e.g., due date, assignee, space).getTaskById(id)— Retrieves a specific task by its ID.
Examples
ConfluenceService.listTasks()
// We can filter tasks based on due date, spaceIds, assignedTo and status
// listTasks: function(dueDateFrom: DateTime, dueDateTo: DateTime, spaceIds: [int], assignedTo: [string], status: string, limit: int)
ConfluenceService.listTasks(null, null, null, null, "complete", 5)
// Filter by a single assignee (accountId)
ConfluenceService.listTasks(null, null, null, "557058:2595e098-374e-409c-9bbb-b749a5abfe1f")
// Filter by date range with a higher limit
const dueAtFrom = DateTime.fromString("2017-06-20T00:00:00.000Z");
const dueAtTo = DateTime.fromString("2017-06-25T07:00:00.000Z");
ConfluenceService.listTasks(dueAtFrom, dueAtTo, null, null, null, 250);Verification
After configuring the Confluence Connector and applying credentials, verify the connection by performing a list test.
Run the following command:
// listSpaces(ids: [int] | null, keys: [string] | null, limit: int)
ConfluenceService.listSpaces(null, null, 10)
When the connection is configured correctly, the command returns a list of spaces visible to the user.
Note
The recommended approach is to use ConfluenceService APIs (c3 convenience functions). Users can call Confluence REST endpoints directly via Confluence.c3typ such as Confluence.getPagesBySpace
Independent Credential Verification
Validate your Confluence credentials independently of the connector by making a direct REST API call using curl. This verification step confirms that the account and API token are valid and have the required permissions before you troubleshoot connector behavior further. See Basic auth for REST APIs for configuration details and examples.

