Hi, I’m trying to call Confluence Cloud REST API as an app / add-on (JWT’s iss is the app key), to create a custom content with restrictions applied.
The custom content is in the app descriptor with apiSupport
, the app scope includes WRITE
and I’ve granted the app user the permission to Add/Delete Restricions in Space Settings. The payload to POST /wiki/rest/api/content
is something like this:
{
type: <custom content key>,
title: <title>
space: {
key: <space key>
},
body: {
raw: {
value: <body raw value>,
representation: 'raw'
}
},
restrictions: {
update: {
restrictions: {
user: [
{accountId: '<app user accountId>'},
{accountId: '<user accountId>'}
]
}
}
}
}
However, I keep getting HTTP 403, with the error: com.atlassian.confluence.api.service.exceptions.PermissionException: Not enough permissions to alter ContentRestrictions on a content with ContentId
unless I remove restrictions
in the payload, does anyone has an idea what I did wrong or there is a bug on the REST API?
I’ve spent a huge amount of time on this so I would really appreciate any tips / helps / clues / guides, thank you!