[GH-ISSUE #49] Confluence connector fails with 400 when using space key — v2 API requires numeric space ID #33

Open
opened 2026-10-18 21:13:38 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @satjak on GitHub (Jun 12, 2026).
Original GitHub issue: https://github.com/open-webui/oikb/issues/49

Confluence connector fails with 400 when using space key — v2 API requires numeric space ID

Summary

The oikb documentation and README show that a Confluence space should be configured using its key:

sources:
  - name: handbook
    source: confluence:ENG

This does not work. Confluence Cloud's v2 API rejects the space key with 400 Bad Request when it appears as a path parameter. The only workaround is to manually look up the numeric space ID and use that instead — which contradicts the documented behavior and is not mentioned anywhere in the docs.


Description

The Confluence connector passes the space key directly to the /wiki/api/v2/spaces/{id}/pages endpoint:

resp = self._http.get(
    f"/api/v2/spaces/{self.space_key}/pages",
    params=params,
)

Confluence Cloud's v2 API only accepts a numeric space ID in that path parameter — not a space key string like ENG or TECH. Passing a key returns 400 Bad Request.

The key format (confluence:ENG) works fine for the /api/v2/spaces?keys=ENG lookup endpoint, but not for /api/v2/spaces/{id}/pages.


Workaround

Look up the numeric ID for your space first:

curl -u "user@company.com:TOKEN" \
  "https://company.atlassian.net/wiki/api/v2/spaces?keys=ENG"

Then use the numeric id from the response in the source config:

source: confluence:9959866368  # numeric ID, not key

Expected Behaviour

confluence:ENG should work as documented. The connector should resolve the space key to a numeric ID via /api/v2/spaces?keys={key} before fetching pages.


Suggested Fix

Add a key→ID resolution step in ConfluenceConnector.__init__ or build_manifest:

resp = self._http.get("/api/v2/spaces", params={"keys": self.space_key})
resp.raise_for_status()
results = resp.json().get("results", [])
if results:
    self.space_key = results[0]["id"]

Environment

  • Confluence Cloud
  • oikb v0.3.5
Originally created by @satjak on GitHub (Jun 12, 2026). Original GitHub issue: https://github.com/open-webui/oikb/issues/49 ## Confluence connector fails with 400 when using space key — v2 API requires numeric space ID ### Summary The oikb documentation and README show that a Confluence space should be configured using its key: ```yaml sources: - name: handbook source: confluence:ENG ``` This does not work. Confluence Cloud's v2 API rejects the space key with `400 Bad Request` when it appears as a path parameter. The only workaround is to manually look up the numeric space ID and use that instead — which contradicts the documented behavior and is not mentioned anywhere in the docs. --- ### Description The Confluence connector passes the space key directly to the `/wiki/api/v2/spaces/{id}/pages` endpoint: ```python resp = self._http.get( f"/api/v2/spaces/{self.space_key}/pages", params=params, ) ``` Confluence Cloud's v2 API only accepts a **numeric space ID** in that path parameter — not a space key string like `ENG` or `TECH`. Passing a key returns `400 Bad Request`. The key format (`confluence:ENG`) works fine for the `/api/v2/spaces?keys=ENG` lookup endpoint, but not for `/api/v2/spaces/{id}/pages`. --- ### Workaround Look up the numeric ID for your space first: ```bash curl -u "user@company.com:TOKEN" \ "https://company.atlassian.net/wiki/api/v2/spaces?keys=ENG" ``` Then use the numeric `id` from the response in the source config: ```yaml source: confluence:9959866368 # numeric ID, not key ``` --- ### Expected Behaviour `confluence:ENG` should work as documented. The connector should resolve the space key to a numeric ID via `/api/v2/spaces?keys={key}` before fetching pages. --- ### Suggested Fix Add a key→ID resolution step in `ConfluenceConnector.__init__` or `build_manifest`: ```python resp = self._http.get("/api/v2/spaces", params={"keys": self.space_key}) resp.raise_for_status() results = resp.json().get("results", []) if results: self.space_key = results[0]["id"] ``` --- ### Environment - Confluence Cloud - oikb v0.3.5
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
open-webui/oikb#33
No description provided.