Forums

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

How can we add the user into confluence cloud space with permission via rest api

d.b.kumar.chauhan December 4, 2024 edited

Hi All,

I am trying to add the user into confluence cloud space and want to give some space permission to that user via Rest Api. But getting below error. Can anyone help me on the same.

API : 
https://{Site - URL}/wiki/rest/api/space/TESTDIP/permission

body


 

{
  "subject": {
    "type""user",
    "identifier""XXXXXXX6965f434"
  },
  "operation": {
    "key""administer",
    "target""page"
  },
  "_links": {}
}



error :


 

{
    "statusCode"400,
    "data": {
        "authorized"true,
        "valid"true,
        "errors": [],
        "successful"true
    },
    "message""com.atlassian.confluence.api.service.exceptions.BadRequestException: Operation not supported for target OperationCheckResult{operation=administer, targetType=page}"
}

2 answers

1 accepted

2 votes
Answer accepted
Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 4, 2024

Hi @d.b.kumar.chauhan 

You API call should contain target "space".

If a user doesn't have permission on space, you can't gran rights to a page?

The page target is only for pages that have restrictions set.

d.b.kumar.chauhan December 4, 2024

Thanks @Marc - Devoteam ,

Its working now. Thanks, lot :) 

Like Marc - Devoteam likes this
d.b.kumar.chauhan December 20, 2024

Hi @Marc - Devoteam ,

In confluence cloud there is any api to give multiple space permission to user in one shot.

Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 23, 2024

HI @d.b.kumar.chauhan 

No the API call is baed on a single space.

You could built a script using a list where you would specify the space id's and have the script to do multiple API calls based on the space id's in the list

Like d.b.kumar.chauhan likes this
1 vote
Nikola Perisic
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 4, 2024

Hello @d.b.kumar.chauhan ,

You cannot add the user with API to Confluence space since there is no endpoint for this. As for adding the space permissions to them you can use this endpoint: /wiki/rest/api/space/{spaceKey}/permission

d.b.kumar.chauhan December 4, 2024 edited

Thanks @Nikola Perisic

But while I am trying to use "/wiki/rest/api/space/{spaceKey}/permission" then I am getting below error:

 

{
    "statusCode"400,
    "data": {
        "authorized"true,
        "valid"true,
        "errors": [],
        "successful"true
    },
    "message""com.atlassian.confluence.api.service.exceptions.BadRequestException: Operation not supported for target OperationCheckResult{operation=administer, targetType=page}"
}

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
atlassian, atlassian government cloud, fedramp, webinar, register for webinar, atlassian cloud webinar, fedramp moderate offering, work faster with cloud

Unlocking the future with Atlassian Government Cloud ☁️

Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.

Register Now
AUG Leaders

Atlassian Community Events