Enabling unlicensed access to Confluence Cloud spaces via API
Platform Notice: Cloud Only - This article only applies to Atlassian apps on the cloud platform.
Summary
When Confluence Cloud and Jira Service Management are integrated, there will have an option to open "unlicensed" access for a space, allowing active users (without a Confluence license) to access the instance and view it. From the UI, this permissioncan only be enabled via the Jira Service Management project connected to a Confluence space.
Even without Jira Service Management integrated or a project linked to a space, an API call can be used in order to have such permissions enabled.
Solution
As a space administrator of Confluence, the following REST API call can be used:
Caution
Treat your API token like a password. Don't hardcode it into scripts that get shared or committed to version control — store it in a secrets manager or environment variable instead.
curl --request POST \
--url 'https://<INSTANCE>.atlassian.net/wiki/rest/knowledge-base/1.0/permissions/space/unlicensedview-v2' \
-u 'user_email@domain.com:<API-TOKEN>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
-d $'{
"enablePermission": true,
"spaceKey": "<SPACE-KEY>"
}'ℹ️ When successful, a message like the following should be displayed:
{"spacePermissions":{"spaceKey":"<SPACE-KEY>","unlicensedViewPermissionEnabled":true,"anonymousViewPermissionEnabled":false},"globalPermissions":{"unlicensedAuthenticatedAccessEnabled":true,"anonymousAccessEnabled":false}}% Verify it worked
Besides the JSON response confirming unlicensedViewPermissionEnabled: true, you can also confirm the setting from the UI at https://<INSTANCE>.atlassian.net/wiki/admin/permissions/global?tab=jsm, under Global Permissions > the JSM tab.
Notes
The unlicensedview value can be changed to anonymousView if the permission to be enabled is the Anonymous one.
The "API TOKEN" must be created from the Atlassian account settings: Manage API tokens for your Atlassian Account
It is necessary to enable the Use Confluence Global Permission under the JSM access tab so unlicensed users can access the instance: https://INSTANCE.atlassian.net/wiki/admin/permissions/global?tab=jsm
Differently from portal-only users, the accounts must have an Atlassian Account without product access, but active on the site: Manage Jira Service Management customer accounts
For example, this is how the configuration looks like for an "unlicensed" user:

Was this helpful?