I would like to use the Confluence REST API to create a personal space for a user that is not me. However, the very straightforward JSON string of
-d '{"key":"~generic.user","name":"Generic User"}'
fails because of "Invalid space key". Obviously, both the tilde and the period are invalid, but I assumed that the _private option would account for that. Otherwise, why have a special URL just for personal spaces?
So, what am I doing wrong?
Hi @Robert Egan
You can use the legacy RPC API methods to create personal spaces.
There's addition information in this community post: https://community.atlassian.com/t5/Confluence-questions/Confluence-administration-Create-personal-space-for-new-users/qaq-p/765650
I hope that helps.
Kind regards,
Thiago Masutti
Thanks, but I have decided to write this one off, as the scenario it addresses does not justify the effort required to achieve it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Thiago Masutti I need REST API. can you please help me on it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Robert,
Per api documentation:
Create private space
Creates a new space that is only visible to the creator. This method is the same as the Create space method with permissions set to the current user only.
I believe to achieve what you want to do, you need to create a space and set the permissions only to the user you want it to be the personal space, see the example on https://developer.atlassian.com/cloud/confluence/rest/api-group-space/#api-api-space-post-example.
Also note that the Key and Name parameters are how you want the space to be identified, so there can not be an auto-handling to it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have no idea how Confluence does it, but clearly they do not use their own API, because they can have tilde and periods in the space name. I have decided to write this one off, as the scenario it addresses does not justify the effort required to achieve it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
https://developer.atlassian.com/cloud/confluence/rest/api-group-space/#api-api-space-post-example this link is not available.
I want to create persnal space using rest api
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Robert,
I don't believe that administrators can create a personal spaces for a users. This guide shows how a user can create one for themselves. Cheers!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So perhaps they should just remove that option from the REST API?
I have been tasked with testing changes to the "default personal space template". If the only personal space I can create is mine, it means I need to delete my existing personal space first. And I'd rather not do that.
In any other environment, I could create a "dummy" account, log into that account, and test it that way. But our system is "locked down" so that you cannot log into dummy accounts.
So my test plan was going to be, create the dummy account, create a personal space for it (without logging in, hence the REST API) and that navigating there by URL.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.