Forums

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

Cannot create confluence space using rest API

Yuliyan Serbezki November 5, 2024

I'm just trying to create a space, but I can't figure out the right request. The endpoint I'm using is https://<my-company>.atlassian.net/wiki/api/v2/spaces and I'm using a POST request.

My first request had the following body:

Body = @{ 

key = "YTST"

name = "YuliTest"

} | ConvertTo-Json

and that resulted in a 404. The documentation says that 404 means the user does not have permissions, but I then logged in with the user whose token I'm using and created a space through the portal, so I guess it's not a permissions issue. 

Anyone have any ideas? I also tried adding a description, but that also resulted in a 404:

 

Body = @{

key = "YTST"

name = "YuliTest"

description = @{

value = "created by automation"

representation = "plain"

}

} | ConvertTo-Json

 

1 answer

1 vote
Tansu Akdeniz
Community Champion
November 6, 2024

Hi @Yuliyan Serbezki 

Can you please check this REST API page?

It seems URL seems a bit different.

POST - Create space

Also, see this Manage API tokens for your Atlassian account.

 

Yuliyan Serbezki November 6, 2024

Isn't that the v1 version of the API? I was trying to use the newer API and followed the schema described here: https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-space/#api-spaces-post.

Regarding the tokens I authenticate successfully when I do a get request so I believe my auth headers are okay, it's something else that doesn't work.

Tansu Akdeniz
Community Champion
November 6, 2024

Okay, you use v2 and auth is done in correct way if you can do get request. (Create Space is still in experimental status in v2)

Like Yuliyan Serbezki likes this
Yuliyan Serbezki
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!
November 6, 2024

Yes, I guess my question is - is there a way to get the new API to work or should I just use the old one? I can't find any working example with the new one.

Will Stampley
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 10, 2024

The v2 creation API is for members of the RBAC Early Access Program. It only exposes role-based configuration options, and not the current granular space permission configuration body. If you're just trying to make a space programatically, and you're not in the RBAC early access program, please use the v1 API that was linked above.

Like Yuliyan Serbezki likes this
Matthew Martin
Contributor
October 26, 2025

@Will Stampley - Please confirm if the V2 create space API is still restricted access?

Will Stampley
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 27, 2025

Hey @Matthew Martin - It is still only for sites that have one of the RBAC variants enabled for their site - today this basically means Open Beta enrolled customers only.

Eventually, more sites will be getting RBAC automatically (new tenants soon, and then all tenants a little later as we continue to improve the tooling and support for existing tenants and their conversion to roles). At that time, the v2 endpoint will be available for use to those sites as well.

Currently, the only intentional difference between v1 and v2 for space creation is permissions vs. roles - so moving to v2 should be trivial.

There's also a public endpoint available for scripting / app use that will tell you if a given tenant is in an RBAC mode or not - and let you dynamically pick the endpoint that works best for your use case.

Hope that helps.

Matthew Martin
Contributor
October 27, 2025

Thanks @Will Stampley - however, that leads me to my next point.

Yesterday I spent a few hours trying to use it because your public REST API documentation documents it with the only caveat being "Experimental" with no information on what experimental means.

After a few hours where the API simply responses with 404 (for which the API tells me relates to "the calling user does not have permission to create spaces"), I found this thread which suggests the underlying reason is because we clearly don't have RBAC enabled.

Could you please, please add some language to the REST documentation to document this, or even better, create an error response from the API that does the same thing? 

Will Stampley
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 29, 2025

Makes total sense @Matthew Martin - We'll get an update into the spec for the RBAC only endpoints to try and make that more clear here soon.

Sorry about the lost time.

Will Stampley
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 19, 2025

@Matthew Martin - Took longer than I thought it would due to a problem with the doc pipeline - but all the RBAC-only APIs should be clearly marked in the docs now.

Suggest an answer

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

Atlassian Community Events