Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Confluence API creates pages in old editor

Ellen Su
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 1, 2020

I have been using the REST API in Python to create pages programmatically, but I have found that the pages created by the API show "This page can converted to the new editor" at the bottom indicating that they were created with the old editor.  

Is there a way to use the API to create pages with the new interface?  

I have tried entering my User-Agent, but it does not appear to make a difference.

2 answers

2 votes
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 9, 2020

Hello @Ellen Su and @Joshua Sneed Contegix ,

This is a known issue tracked as:

 

In the workaround section (as well as in the comments) it is explained how to create a page using the new editor via REST API:

Workaround

It's possible to simply add the following metadata to the request's payload, so the page will be created using the new editor:

"metadata": {
    "properties": {
        "editor": {
            "key": "editor",
            "value": "v2"
        }
    }
}

Here's a complete example;

fetch("https://INSTANCE.atlassian.net/wiki/rest/api/content", {
    "credentials": "include",
    "headers": {
        "content-type": "application/json",
    },
    "body": `{
  "title": "Test new page (API)",
  "type":"page",
  "status":"current",
  "space":{
   "key":"TS"
  },
  "body": {
   "storage": {
    "value": "<p>Created through the REST API</p>",
    "representation": "storage"
   }
  },
  "metadata": {
          "properties": {
             "editor": {
                "key": "editor",
                "value": "v2"
             }
          }
        }
 }`,
    "method": "POST",
});

 

Please vote for the above bug ticket and set yourself as a watcher so that you will be notified in case of any update/progress. The bug will be addressed according to the Atlassian Cloud bug fixing policy.

 

Cheers,
Dario

0 votes
Joshua Sneed Contegix
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 1, 2020

Hi Ellen,

Like all of Atlassian's Cloud products, Confluence's API may be updated without notification. The endpoint likely changed. Check out Atlassian's Confluence Cloud API Reference and Developer API Reference. Cheers!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events