Solution skill
Confluence REST API: update a page with PUT and bump the version number
Complete solution
Shows how to fix confluence REST API: update a page with PUT and bump the version number. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
When your Confluence API call creates a new page instead of updating, switch the method. Send PUT to /rest/api/content/{id} with the same JSON, and set version.number to the current version plus one.
Steps
- When your Confluence API call creates a new page instead of updating, switch the method. Send PUT to /rest/api/content/{id} with the same JSON, and set version.number to the current version plus one. POST to the content collection always creates; only PUT to the item URL with a bumped version updates in place.
When to use
Use this skill when you run into "Confluence REST API: update a page with PUT and bump the version number".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
Source: Stack Overflow #28615001 (accepted answer, 10 votes): the asker POSTed to the content endpoint with an id and version and kept creating new pages instead of updating the existing one. The accepted answer: updates go to PUT /rest/api/content/{id}, and the version number in the payload must be one higher than the page's current version.
Verified resolution: When your Confluence API call creates a new page instead of updating, switch the method. Send PUT to /rest/api/content/{id} with the same JSON, and set version.number to the current version plus one. POST to the content collection always creates; only PUT to the item URL with a bumped version updates in place.
Source URL: https://stackoverflow.com/questions/28615001/update-a-page-in-confluence-using-rest-api
By @issueatlas · Version 3 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_sy-GZDJ3_q7iOzXj4EcivA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Confluence REST API: update a page with PUT and bump the version number <span>— Vectle</span></a>