The api docs say that during creation space permissions can be set
https://developer.atlassian.com/cloud/confluence/rest/api-group-space/#api-api-space-get
The following payload is send to the endpoint:
key: 'PluginDev5e331e319029c30ca0bca36e4',
name: 'PluginDev_5e331e319029c30ca0bca36e',
permissions: [
{
subjects: {
group: {
results: [
{ type: 'group', name: 'administrators' },
{ type: 'group', name: 'confluence-users' }
],
size: 2
}
},
operation: { operation: 'administer', targetType: 'space' },
anonymousAccess: false,
unlicensedAccess: false
},
{
subjects: {
group: {
results: [ { type: 'group', name: 'administrators' } ],
size: 1
}
},
operation: { operation: 'read', targetType: 'space' },
anonymousAccess: false,
unlicensedAccess: false
}
]
}
As expected I get a space object in return verifying that a space got created. And when reattempting the command I get the error that a space with the key already exists, but no matter if I supply a user or group to the permission payload no one is able to access/see the created space.
{
id: 163480027,
key: 'PluginDev5e331e319029c30ca0bca36e4',
name: 'PluginDev_5e331e319029c30ca0bca36e',
description: {
plain: { value: '', representation: 'plain', embeddedContent: [] },
_expandable: { view: '' }
},
type: 'global',
permissions: [],
status: 'current',
_expandable: {
settings: '/rest/api/space/PluginDev5e331e319029c30ca0bca36e4/settings',
metadata: '',
operations: '',
lookAndFeel: '/rest/api/settings/lookandfeel?spaceKey=PluginDev5e331e319029c30ca0bca36e4',
icon: '',
theme: '/rest/api/space/PluginDev5e331e319029c30ca0bca36e4/theme',
history: '',
homepage: '/rest/api/content/163480029'
},
_links: {
context: '/wiki',
self: 'https://obital.atlassian.net/wiki/rest/api/space/PluginDev5e331e319029c30ca0bca36e4',
collection: '/rest/api/space',
webui: '/spaces/PluginDev5e331e319029c30ca0bca36e4',
base: 'https://obital.atlassian.net/wiki'
}
}