Confluence Search REST Pagination Compatibility Boundary Between Cloud and Data Center
0 reputation · 07 Jan 2024, 18:48 UTC
0 reputation · 07 Jan 2024, 18:48 UTC
Confluence search REST endpoints accept limit and start parameters to bound result sets, but the enforced maximum page size varies by endpoint and deployment type. Cloud instances commonly cap generic REST pagination at 250 items per request, while some search endpoints impose lower effective caps. Data Center and Server instances expose similar parameters, yet the maximum page size and offset behavior are governed by instance configuration, creating a compatibility boundary for shared integration code.
Offset-based deep paging remains unstable because the underlying search index updates asynchronously. Concurrent content changes can cause duplicates or gaps across pages, and responses do not always include a reliable total count for large result sets. Although newer Atlassian APIs have moved toward cursor-based or keyset pagination, the primary Confluence search REST API still relies on offset semantics, leaving an unresolved decision about stable deep paging for large datasets. Cloud and Data Center behavior may diverge after version upgrades, so integration tests should run against the target deployment.
Before committing to a pagination strategy, verify the current parameter limits and semantics for the specific endpoint and deployment target.
What is the recommended pattern for bounding a large Confluence search query when the same integration must run on both Cloud and Data Center? Should code assume the documented 250-item limit applies uniformly across all search endpoints, or must the effective cap be discovered per endpoint? Is there a documented server-side mechanism that provides a stable total or cursor for deep paging without relying on large start offsets?
37275 reputation · 08 Jan 2024, 04:25 UTC
For an integration that must run on both Confluence Cloud and Data Center, do not assume a single page-size limit. Use a conservative page size—typically 50–100 items—and iterate with the start offset. Treat the enforced maximum as an endpoint-specific value discovered at runtime rather than a hardcoded constant. The primary CQL search REST API still uses offset-based pagination; there is no documented server-side cursor or stable total-count mechanism for deep paging in either deployment type. For very large result sets, partition queries by time or metadata ranges instead of chasing deep offsets.
Cloud instances commonly cap generic REST pagination at 250 items, but search endpoints can impose lower effective caps. Data Center and Server instances expose similar limit and start parameters, yet the maximum page size and offset behavior are governed by instance configuration. Assuming a uniform 250 limit can cause silent truncation or HTTP 400 errors when a search endpoint enforces a lower cap. Because Cloud and Data Center behavior may diverge after version upgrades, hardcoding limits risks breakage.
start, advancing by the number of items actually returned.limit until the API rejects or clamps the value.lastmodified date ranges or other metadata to create bounded, stable slices.limit = 50
start = 0
while True:
resp = search(cql, limit=limit, start=start)
results = resp.get("results", [])
if not results:
break
process(results)
start += len(results)
if len(results) < limit:
break
Offset-based deep paging remains unstable because concurrent content changes can produce duplicates or gaps across pages. Although newer Atlassian APIs have moved toward cursor-based or keyset pagination, the primary Confluence search REST API still relies on offset semantics. There is no documented server-side mechanism that provides a stable total or cursor for deep paging without relying on large start offsets in either Cloud or Data Center.
limit to find the effective per-endpoint maximum.Confirm the exact Data Center version and endpoint path in use (for example, the generic search endpoint versus a content-specific search endpoint). Pagination caps and offset semantics can diverge after upgrades, and the endpoint path determines whether an administrative limit applies. Without that detail, the conservative 50–100 page size remains the safest default.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.