Trying to remove users from product groups via API

Hi

I am trying to do do a clean up of users and their licenses on Jira Cloud, not deactivating their Jira accounts. Using this endpoint https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-groups/#api-rest-api-2-group-user-delete (as I have seen on Solved: Is there an admin API(organisation level) to revok...):

https://qqqqq.atlassian.net/rest/api/2/group/user?accountId=123abc&groupId=456def

But getting either “Specified user does not exist or you do not have required permissions” or “The group ID and group name can not be empty.” errorMessages.

I have tried the group ID, group name, user account ID and username …

Please advise ASAP if anyone has gotten this working?

Thank you
Yatish

Hi ,

Please try
`curl --request DELETE
–url ‘https://your-domain.atlassian.net/rest/api/2/group/user?groupId={groupId}&accountId={useraccountid}
–user ‘email@example.com:<api_token>’

Thanks

1 Like

Thanks so much @RitupurnaBISWAL - that worked! And now that I look back, it seems I just did not look at the documentation properly! Yeesh!

Thanks so much! This worked:

curl --request DELETE -url ‘https://aaa.atlassian.net/rest/api/2/group/user?groupId=bbb&accountId=ccc’ -u ‘email@domain.com:apitoken’

1 Like