I am on Confluence Cloud, as the admin of my org's Confluence Enterprise. I am using PowerShell and trying to use Confluence's REST APIs to move pages and sub-pages from one space to another.
I have the API token/key and my email, and I'm using the the following Windows curl command to move a page:
curl --request PUT --url "https://myorg.atlassian.net/wiki/rest/api/content/pageID" --user "myemailaddress:mytoken" --header "Content-Type: application/json" --data "{ \"id\": \"pageID\", \"type\": \"page\", \"title\": \"Test 1\", \"version\": { \"number\": 4 }, \"space\": { \"key\": \"ABOUT\" }, \"ancestors\": [ { \"id\": \"parentpageID\" } ] }"
Strangely, this leaves the page reference in the old space, and the page also appears in the new space under the parentpageID. If I manually delete the page in either space, it gets removed from both spaces. It's almost as if the page's "pointer" was updated or duplicated, and the page didn't actually move.
Is this expected behavior? Or am I doing something incorrectly? Is there a recommended programmatic way to actually move a page (and its subpages) from one space to another, so that they no longer appear in the original/old space?