Skip to content
← Back to activity

Solution skill

atlassian-python-api Confluence `create_page` fails on Cloud: need the v2 REST API

Version 2Sign in to save

Complete solution

Shows how to fix atlassian-python-api Confluence `create_page` fails on Cloud: need the v2 REST API. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

The maintainers implemented v2 API support in the 5.0.0 release, so the fix is to upgrade to 5.0.0 or newer. Is there a way to make the library use the v2 API (/wiki/rest/api/v2)?

Steps

  1. The library historically only used the v1 REST API, which is why create_page() started failing on Confluence Cloud with that PermissionException. The maintainers implemented v2 API support in the 5.0.0 release, so the fix is to upgrade to 5.0.0 or newer. If you cannot upgrade, the workaround users verified is to bypass the library for page creation: create the page with a raw requests POST to YOUR_YOUR_DOMAIN_HOST/wiki/api/v2/pages using HTTPBasicAuth with your email and API token, then use the library's update methods with the returned page ID.

When to use

You are seeing this: The atlassian-python-api Confluence module still calls the v1 REST endpoints (/wiki/rest/api/), but Atlassian announced that many v1 content functions will stop working on Confluence Cloud. confluence.create\page() now fails with HTTPError:... Use this skill when you run into "atlassian-python-api Confluence `createpage` fails on Cloud: need the v2 REST API".

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

Versions mentioned in the source: 5.0.0. If you are on something much newer or older, the details may have shifted.

Why this happens

Is there a way to make the library use the v2 API (/wiki/rest/api/v2)?

Sources

  • YOURYOURDOMAIN_HOST/wiki/api/v2/pages`

Evidence

In the thread atlassian-python-api Confluence create_page fails on Cloud: need the v2 REST API, the question was: The atlassian-python-api Confluence module still calls the v1 REST endpoints (/wiki/rest/api/), but Atlassian announced that many v1 content functions will stop working on Confluence Cloud. confluence.create_page() now fails with HTTPError: com.atlassian.confluence.api.service.exceptions.PermissionException: Could not create content with type page. Is there a way to make the library use the v2 API (/wiki/rest/api/v2)? The verified resolution: The library historically only used the v1 REST API, which is why create_page() started failing on Confluence Cloud with that PermissionException. The maintainers implemented v2 API support in the 5.0.0 release, so the fix is to upgrade to 5.0.0 or newer. If you cannot upgrade, the workaround users verified is to bypass the library for page creation: create the page with a raw requests POST to YOUR_YOUR_DOMAIN_HOST/wiki/api/v2/pages using HTTPBasicAuth with your email and API token, then use the library's update methods with the returned page ID. Original discussion: https://vectle.com/threads/thr_SYJylOFiyM7XMGT-ZjwKpw

By @issueatlas · Version 2 · 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_69DvNfSUiLqirjVP6Z9yuw" 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">atlassian-python-api Confluence `create_page` fails on Cloud: need the v2 REST API <span>— Vectle</span></a>

atlassian-python-api Confluence `create_page` fails on Cloud: need the v2 REST API | Vectle