Creating space using REST API creates it with "old" editor ?
Asked by Xe Co:

Hello,  

Recently I've noticed that if you create for example Blank or Personal space in Confluence Cloud manually, i.e through **Create space** dialog it will create new space with "modern/new" editor (probably it's called ++editor-v2++ ).  

However I am wondering, when creating new space using REST API it will still create space with "old" editor - is that by default ++or there's some parameter which needs to be specified in API request in order to get new editor when creating space using REST API ?++

```
curl --user user@name.net:someAPIToken --request POST --url 'https://myConfluenceInstance.atlassian.net/wiki/rest/api/space' --header 'Accept: application/json' --header 'Content-Type: application/json' --data { 
? ? ?"key":"My New Space",
? ? ?"name":"test 123",
? ? ?"description":{ 
? ? ? ? "plain":{ 
? ? ? ? ? ? "value":"some value",
? ? ? ? ? ? "representation":"some representation"
? ? ? ?}
? ? }
}
```

<br />

Here's an example where you can see the difference between "old" and "new" editor:  

**Old editor**

![editor_old.png](https://community.atlassian.com/t5/image/serverpage/image-id/79627i04B03A73107DDC89/image-size/large?v=v2&px=999 "editor_old.png")

**New editor** ![editor_new.png](https://community.atlassian.com/t5/image/serverpage/image-id/79628i61E3E6B1B25055D0/image-size/large?v=v2&px=999 "editor_new.png")  


Answers:
author: Leonid Sokolovskiy
body: you need to define metadata

something like this

```
"body": {
    "storage": {
      "value": "<h1>Test page</h1>",
      "representation": "storage"
    },
"metadata": {
    "properties": {
      "editor" : {
         "value" : "V2"
       }
     }
   }

you can search in the forum and you will get more details.
```

comments: author: Abhishek Parmar
body: The value should be **v2**


author: Robin Stocker
body: Here's a complete and cleaned-up example for creating a new-style page:

```
curl -u 'user:apitoken' -H 'content-type: application/json' \
  'https://hello.atlassian.net/wiki/rest/api/content' \
  -d '{
  "type": "page",
  "title": "Page created via API",
  "space": {
    "key": "TEST"
  },
  "body": {
    "storage": {
      "value": "<h1>Test page</h1>",
      "representation": "storage"
    }
  },
  "metadata": {
    "properties": {
      "editor": {
        "value": "v2"
      }
    }
  }
}'
```

comments: author: Matt Casey
body: Thank you! This would be great to have in the REST documentation.


author: Sinu John
body: What is the equivalent of this for the new v2 api \`wiki/api/v2/pages\`? I'm not able to get this to work with the new API. Please point me to the documentation.


author: Suyash Rane
body: [@Robin Stocker](/t5/user/viewprofilepage/user-id/502302) Thanks but since we are not supposed to use the old API now. Is there a way to do this in new API?  


author: Brett Barrett
body: [@Robin Stocker](/t5/user/viewprofilepage/user-id/502302) - Hey, following up on this also. I can't seem to find a way to do this with the API v2.


author: Jim Caldarise
body: [@Shannon S](/t5/user/viewprofilepage/user-id/510046) - I see you were active on this thread a few years back and are on the Atlassian Team. I have the same question as the folks above: is there an equivalent for the v2 API to select the new editor experience?


author: Shannon S
body: Hello there,

Welcome to Atlassian Community! It's nice to have you.

Right now I believe this depends on the Cloud site itself, so it's something we'll need to take a look at in support for your instance. Can you see if you're able to [create a support ticket](http://support.atlassian.com/contact), and if not, let me know and I can take care of that for you?

Regards,

Shannon

comments: author: Xe Co
body: Hello, Shannon !  

I've created support ticket and hopefully it will get resolved.  

Thank you for your help.  

Best regards,  
A.L  


author: Shannon S
body: You're welcome! Let us know what you find out!

Regards,

Shannon


author: Lukas Gotter _ Meetical
body: Hi @\[deleted\] could you solve this issue? I'm dealing with a similar problem. Any pages created via REST API show up with the old editor experience. Is there any parameter to set in the request?

Here is an example REST request.

```
POST {{host}}/rest/api/content
Accept: application/json
Content-Type: application/json
Authorization: Basic {{basic-auth-token}}

{
  "title": "Test page 1",
  "type": "page",
  "space": {
    "key": "MCT"
  },
  "status": "current",
  "ancestors": [
    {
      "id": "54755348"
    }
  ],
  "body": {
    "storage": {
      "value": "<h1>Test page</h1>",
      "representation": "storage"
    }
  }
}
```

I tried to set both "storage" to "editor2" but that did not change anything. When the user edits the page, the old editor is showing up. How can the new editor be used for pages created via REST API?


author: Shannon S
body: Hi Lukas, [@Waldemar Reusch](/t5/user/viewprofilepage/user-id/525557), [@Pete Dunham](/t5/user/viewprofilepage/user-id/1254435),

Xe was able to log a case with support, where we had a look at their site and determined that this was caused by the following bug:

* [CONFCLOUD-68057](https://jira.atlassian.com/browse/CONFCLOUD-68057) *Creating a page via API doesn't load the New Editing Experience*

Currently, there is no workaround for this. Please make sure to click **This affects my team** so you can be updated in the future if that changes.

Take care,

Shannon


author: naveenkumar_dp
body: I'm also facing the same issue.

comments: author: Shannon S
body: Hello [@naveenkumar_dp](/t5/user/viewprofilepage/user-id/3665014) ,

Thank you for following-up here! I'm not sure if you saw, but this has been logged as the following bug:

* [CONFCLOUD-68057](https://jira.atlassian.com/browse/CONFCLOUD-68057) *Creating a page via API doesn't load the New Editing Experience*

There's a workaround explained on that case.

If you have any trouble with it, can you let us know?

Thank you,

Shannon


author: Lars Stuber
body: [@Shannon S](/t5/user/viewprofilepage/user-id/510046) all those answers are not answering the question of the ticket creator. How do I select the new editor v2 when creating a completely new **SPACE**. When I tried to add meta data, still the "Overview" page of the created space is in v1 editor. Do you have also a workaround for this?


author: Shannon S
body: Hi Lars,

Thank you for pointing that out. The same applies in both situations, whether you're creating a single page or a space, thus creating multiple new pages at once. When there's a difference in the editor used, it's specific to the Cloud site and will require a support ticket to determine.

I know of a bug where when someone creates a Jira space, the overview page is on the legacy editor. There may be similar cases for other types of spaces, but I'm not yet aware of those. I'll share my example below.

* [CONFCLOUD-69729](https://jira.atlassian.com/browse/CONFCLOUD-69729) *Creating new space associated with the project through JSD has Overview page in the old editor*

If you encounter a similar issue but not with a JSD space, can you send that to support using [the support contact form](https://support.atlassian.com/contact)? If you have a free account or are on an account type that doesn't allow for that, create a new question here on Community, tag me on it, and I'll help report that to the Cloud team.

Thank you, and take care!

Shannon


author: Waldemar Reusch
body: I'm also interested in a solution.


author: Pete Dunham
body: [@Xe Co](/t5/user/viewprofilepage/user-id/3714147) did you find a solution path?

I am dealing with the same issue.


Tags: atl-adm

confluence-cloud