Create new user group API for confluence is throwing 405 method not allowed

Hi,

I am hitting confluence rest endpoint to create new user group but getting method not allowed 405 error code. I am using the POST method and “/api/group”.
Body : {“name”: “abc”}. Same endpoint is working with GET method to fetch all groups.
Please help me with this.

Hi @vsangwan,

Unfortunately, Connect apps aren’t capable of creating user groups. Note this sentence in the documentation of the endpoint:

Connect apps cannot access this REST resource.

Cheers,
Sven

1 Like

Hi @SvenSchatter ,

Thanks for your reply.
Sven, If I will take write scope access then can I hit this endpoint.
Can you please throw some light on connect apps, whats are these and if I can access this endpoint after write scope access.
And can you please confirm that if I can get this access from my organisations confluence admin.

Thanks,
Vikas

Hi @vsangwan,

Connect is one of the frameworks you can use for building apps for the Atlassian Cloud. Since you’re talking about adding the WRITE scope to your app, I suppose that’s what you’re using.

And no, for Connect apps, there’s simply no way to use this endpoint. I’m not 100% sure if the other frameworks / ways of authentication (forge, 3LO, auth tokens) can, you’ll have to try.

Cheers,
Sven

1 Like

@SvenSchatter
Also, I was able to hit this API : https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-groups/#api-rest-api-3-group-post
Same is mentioned for this one also that connect apps can not access it but I have created the group using this.

That sounds like you’re using a different way of authentication and you’ll need to share that with us so we can help you figure out what’s going wrong. :slight_smile:

Cheers,
Sven

1 Like

Hi @SvenSchatter,

Thanks for your reply.
We are using data centre version of confluence and not the cloud one.
So below rest calls are available for data centre server apis.
https://docs.atlassian.com/ConfluenceServer/rest/7.11.6/#api/group
and in this doc we dont have any create new group api. Thats why I am not able to create new group.

Sven is there any other way to create group using api.
Let me know if you need any other details. Really appreciate your help.

Thanks,
Vikas

Alright, that’s where the confusion came from. In that case I’d recommend to have a look at this community post: Solved: How to create or deactive or delete group via Rest...

If the suggested app in that thread is not a good solution for you, you could also write your own P2 plugin and expose your own custom rest endpoint that way. Alternatively, you could also try to look at what mechanism the standard Confluence interface uses by tracing requests in your browsers developer tools.

Cheers,
Sven