Skip to content

[Confluence] ConfluenceCloud: add remove_content - #1709

Merged
gonchik merged 1 commit into
atlassian-api:masterfrom
LuisFigueroaG:fix/confluence-cloud-remove-content
Oct 28, 2026
Merged

gonchik merged 1 commit into
atlassian-api:masterfrom
LuisFigueroaG:fix/confluence-cloud-remove-content

Conversation

@LuisFigueroaG

Copy link
Copy Markdown
Contributor

docs/confluence.rst documents confluence.remove_content(content_id) ("Remove any content"), and the Server client has it. The Cloud client (Confluence(url="https://<site>.atlassian.net") / ConfluenceCloud) doesn't, so it fails with:

AttributeError: 'Cloud' object has no attribute 'remove_content'

This adds remove_content(content_id) to Cloud, with the same behaviour as the Server client:

  • sends DELETE /wiki/rest/api/content/{id}, the same v1 endpoint delete_content() and remove_page() already use;
  • returns the response of the request;
  • maps 403/404/409 to ApiPermissionError/ApiError/ApiConflictError like Server does.

I also added a line to the remove_content entry in docs/confluence.rst saying it works on Cloud.

Tests: added three test_remove_content_* tests to tests/confluence/test_confluence_cloud.py (default call, 404, and a call through Confluence(url="https://test.atlassian.net")); they fail on master with the error above. The full pytest suite, tox -e mypy, bandit and doc8 pass, and black and flake8 are clean on the changed files. I haven't run it against a real Confluence Cloud site.

docs/confluence.rst documents remove_content(content_id), and the Server
client has it, but the Cloud client does not, so
Confluence(url="https://<site>.atlassian.net") and ConfluenceCloud raise
"'Cloud' object has no attribute 'remove_content'".

Add remove_content to Cloud with the same behaviour as the Server client:
it sends DELETE to /wiki/rest/api/content/{id}, the endpoint
delete_content and remove_page already use, returns the response and
maps 403/404/409 to the same errors.
@gonchik
gonchik merged commit 785fc03 into atlassian-api:master Oct 28, 2026
4 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants