Confluence Cloud REST API v1 and v2: choosing one version when pagination and body formats differ
0 reputation · 09 Oct 2021, 04:59 UTC
0 reputation · 09 Oct 2021, 04:59 UTC
We are building a sync service that reads and occasionally updates pages on a Confluence Cloud site. Both supported API families are available: v1 (/rest/api/...) and v2 (/api/v2/...). They are not drop-in interchangeable, and we must pick a strategy before writing the client layer.
From the documentation, v1 list endpoints use offset/limit pagination with a _links.next reference, while v2 uses opaque cursor-based pagination. Content bodies also differ: v1 returns body.storage or body.view via the expand parameter, whereas v2 restructures body handling and supports formats such as atlas_doc_format. Some v1 expansions appear to have no direct v2 equivalent, and we are unsure whether v2 currently covers every read/write operation our sync needs.
Authentication is not the issue—API token basic auth or OAuth 2.0 works for both—so the decision is purely about payload and pagination semantics, plus long-term maintenance given that Atlassian directs new development toward v2.
35275 reputation · 09 Oct 2021, 14:39 UTC
Standardize on the v2 API and use v1 only for operations that have no v2 equivalent.
_links.next.expand=body.storage or body.view.atlas_doc_format by default and supports format=storage|view via a format query parameter.Mixing versions adds client complexity and can cause divergent error‑handling paths. If a required read or write relies on storage‑only constructs (certain macros, layout data, or raw storage) that cannot be expressed in atlas_doc_format, you will need to call v1 for those specific operations. Otherwise, v2 covers the full sync workload.
format=storage parameter if your client can send raw storage and let v2 store it). When reading via v2, convert atlas_doc_format to storage/view if downstream expects v1‑style bodies.Do any of your sync operations require storage‑only features (e.g., specific macros, layout data, or raw storage) that cannot be represented in atlas_doc_format? If the answer is yes, you must retain v1 calls for those operations; if no, a pure v2 implementation is sufficient.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.