Bulk delete group memberships for Atlassian Cloud using Postman and REST APIs

Still need help?

The Atlassian Community is here for you.

Ask the community


Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.

When to use this article

This article may be used any time there is a need to bulk update and remove group memberships in Atlassian Cloud. Note that this article outlines how to update memberships, but does not update the usage of groups in Jira projects, Jira permission schemes, Confluence space permissions or Confluence page restrictions.

When not to use this article

This article will not work for organizations with users and groups provisioned with Atlassian Guard SCIM. Please refer to your identity provider administrator to make changes to group memberships provisioned through SCIM.



Identify your organisation’s user management UI experience

  1. Head to admin.atlassian.com. Select your organization if you have more than one.

Original

Centralized

As a site administrator or organization admin, Users is found under the Product site. If the Users

page is not present under the Directory tab, then you have the Original user admin UI

experience.

As an organization admin, Users is found under Directory tab.

Prepare data

This article assumes a list of users and group memberships to be removed is already available/has been pre-determined. This article will walk users through the steps to map user and group id's.

Export users and group memberships

  1. This step is different depending on your user management experience:
    - Original: Select Export users.
    - Centralized: At the top of the screen, select ... > Export users.
  2. Select the Users and User status options as required.
  3. Select the Additional data options to include the required data in the download:

    • Group membership – Includes groups the users belong to.

    • Pivot to column – Expands group data to generate a row for each group membership.

  4. Select Export users.

  5. An email will be sent when the CSV file is ready to download. Check your junk or spam folder if it’s taking longer than expected to receive the email.

  6. Open the email and select Download CSV file.

  7. Rename the file to groups.csv
  8. Rename "Group id"(column A) column heading to groupId - case sensitive
  9. Rename "User id"(column C) column heading to accountId - case sensitive
  10. Remove rows corresponding to group memberships that you wish to keep - any group memberships mapped in the CSV will be removed, i.e. the group memberships listed in the final CSV will be the memberships that will be deleted.
  11. Save the CSV.

Sample file - groups.csv

Notes:

  • It is important that the groupId and accountId column headers are exactly like this below example because Postman will be iterating through these columns to delete the group memberships of the users listed in the CSV
  • Technically speaking, only columns A and C are required, all other columns are not required. Your CSV may have more columns than what is shown in this example. The number of columns correspond to the number of products that exist on the site/organization and the number of columns in the CSV does not affect the API calls that Postman will be making
  • In this example, 6 users will be removed from the Engineering group, i.e. group membership to the Engineering  group will be revoked for 6 distinct users
  • The user "syncpolicytestuser3@domain.example" will be removed from 3 groups
  • The users' accounts will remain on the site/org. - only the group memberships will be removed
groupIdGroup nameaccountIdUser nameemailUser statusAdded to orgOrg roleLast seen in Confluence - site-test3Last seen in Confluence - site-test3-sandbox
​e7b24a95-307c-4179-b143-18071d986420​Engineering​712020:789cba25-bbe2-45c5-a2b6-3a81ca61ba74​SyncPolicy TestUser3​syncpolicytestuser3@domain.example​Active​1 Sep 2023​None​Never accessed​Never accessed
61cb3f2f-cc52-4458-8e0a-bf78ccd504bbSales712020:789cba25-bbe2-45c5-a2b6-3a81ca61ba74SyncPolicy TestUser3syncpolicytestuser3@domain.exampleActive1 Sep 2023None​Never accessed​Never accessed
685d588b-04ce-40c8-b8ca-00bc16a9e60aIT712020:789cba25-bbe2-45c5-a2b6-3a81ca61ba74SyncPolicy TestUser3syncpolicytestuser3@domain.exampleActive1 Sep 2023None​Never accessed​Never accessed
e7b24a95-307c-4179-b143-18071d986420Engineering63b6efaab790087ed712a5c1User Testusertest@domain.exampleActive5 Jan 2023None​Never accessed​Never accessed
942e2db7-0537-4296-9d59-3160c8433b9eFinance712020:67392043-03d0-4867-aa8f-a7de831c9123test usertest.user@domain.exampleInactive7 Mar 2024None​Never accessed​Never accessed
e7b24a95-307c-4179-b143-18071d986420Engineering6283b01fbd640f0068ad476dpruserpruser@domain.exampleActive5 Jan 2023None​Never accessed​Never accessed
e7b24a95-307c-4179-b143-18071d986420Engineering63b6efb248b367d78a18988dRachael1234@domain.exampleActive5 Jan 2023None​Never accessed​Never accessed
e7b24a95-307c-4179-b143-18071d986420Engineering712020:13d92893-a902-4936-8903-2abc4e7916d0Steve teststeve_test@domain.exampleActive30 Oct 2023None​Never accessed​Never accessed
e7b24a95-307c-4179-b143-18071d986420Engineering5fa522f08573800069c749actemp admintemp_admin@domain.exampleInactive26 Aug 2022None​Never accessed​Never accessed

Set up Postman

This section may be skipped if:

  • a collection named "Atlassian Cloud User Management" has previously been set up, and

  • an environment named "Atlassian Cloud" has previously been set up

Click here for instructions to set up Postman

Download Postman

  1. Download Postman from https://www.postman.com/downloads/

  2. Run Postman.

Create a new environment

  1. Click New, or type Ctrl + N (Windows/Linux) or Cmd + N (MacOS).

  2. Select “Environment”.

  3. Name the environment “Atlassian Cloud”.

  4. Set up the following variables:

    VariableTypeInitial value and Current valueComments

    cloudUrl

    default

    https://<yoursite>.atlassian.net

    Replace yoursite with your subdomain, e.g. acmecorp

    apiTokenEmailAddress

    default

    <youruser@yourdomain.com>

    Your Atlassian administrator account email

    apiToken

    secret

    From https://id.atlassian.com/manage-profile/security/api-tokens

    Manage API tokens for your Atlassian account

    Note that Postman variables are case-sensitive.

  5. Click Save towards the top right corner.

Create a new collection

  1. Click New, or type Ctrl + N (Windows/Linux) or Cmd + N (MacOS).

  2. Select “Collection”.

  3. Name the collection “Atlassian Cloud User Management”.

  4. Click the “Authorization” tab.
  5. Change Type to “Basic Auth”.

  6. Specify {{apiTokenEmailAddress}} as the Username. The text should be coloured orange, indicating that Postman has recognized a variable has been specified. This can be confirmed by hovering over the variable name.

  7. Specify {{apiToken}} as the Password. The text should be coloured orange, indicating that Postman has recognized a variable has been specified. This can be confirmed by hovering over the variable name.

  8. Click the “Tests” tab.

  9. Enter:

    pm.test("Request successful", function () {
        pm.expect(pm.response.code).to.be.oneOf([200,201,202,204]);
    });


    This allows us to ensure all REST APIs have been made successfully.

  10. Click Save towards the top right corner.

Set up REST API call

  1. Click New, or type Ctrl + N  (Windows/Linux) or Cmd  + N (MacOS).

  2. Select "HTTP".

  3. Name the request "Remove User from Group in Atlassian Cloud".

  4. Change the method from GET  to DELETE .

  5. In the URL, paste:

    {{cloudUrl}}/rest/api/latest/group/user?groupId={{groupId}}&accountId={{accountId}}

    (warning) Note that Postman variables are case-sensitive and must match what is supplied in the attached environment and spreadsheet.

  6. Click the "Authorization" tab.

  7. Ensure Type is "Inherit auth from parent".

  8. Click Save, saving into the "Atlassian Cloud User Management" collection.

Execute Postman Runner 

  1. Change the environment using the environment selector at the top right of Postman, selecting "Atlassian Cloud".

  2. Select Collections in the sidebar.

  3. Select the "Atlassian Cloud User Management" collection.

  4. On the Overview tab, select ▶️ Run towards the top right corner.

  5. Under Run order, ensure there is one and only REST API call - "Remove User from Group in Atlassian Cloud" - selected.

  6. On the Functional tab, select Run manually.

  7. Click Data.

  8. Navigate to and select the previously prepared csv file from "Map data".

  9. Reduce the number of "Iterations" under Run configuration to 1.

  10. Leave Advanced settings as is.

  11. Click Run Atlassian Cloud User Management.

  12. Check Postman to ensure the runner collection has passed all tests. The run results should show:

    1. "Iterations" and "All tests" to be equivalent in count

    2. Passed (n) where n is the number of iterations

    3. Failed (0)

    4. Skipped (0)

  13. Check admin.atlassian.com to ensure the user in row 2 of the exported list has been made a member of the expected group.

  14. Rerun Postman Runner following the previous steps, with the number of "Iterations" set to the number of rows in the csv file.

References


Last modified on May 27, 2025

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.