Delete users from Atlassian Cloud using Postman and REST APIs


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

This document serves solely as a knowledge base resource. Please be aware that customization and development requests are not covered under Atlassian's support offerings. For assistance with such requests, we will refer customers to our developer network or partner network.

When to use this article

This article may be used any time there is a need to delete users in bulk from Atlassian Cloud. For example, after testing user migration to Atlassian Cloud, it may be necessary to delete many users from the organization to retest, or after a company merger, it may be necessary to delete old accounts.

This article assumes that Jira is available on the cloud site.

When not to use this article

This article will not work for organizations with users and groups provisioned with Atlassian Guard SCIM, as these groups will be recreated following the next update/synchronisation. Please refer to your identity provider administrator to make changes to users provisioned through SCIM.



Identify your organisation’s user management

  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 Product site.

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

Prepare data

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

  2. This step is different depending on your user management experience:
    - Original: Select the site's name and URL to open the Admin for that site, then select Users.
    - Centralized: Select Directory > Users.

  3. This step is different depending on your user management experience:
    - Original: Select Export users.
    - Centralized: At the top of the screen, select > Export users.

  4. Select the users that you’d like to export:

    • All users in your site/organization – Include all users in your site/organization, across all groups.

    • Users from selected groups only – Only includes users in the groups you select.

  5. Select "All users" to include all active, suspended and deactivated users.

  6. Select further options to include additional data in the download, which may assist with filtering the data:

    • Group membership – Includes groups a user belongs to. By default, multiple groups are formatted as a comma-separated list.

    • Product access – Includes the product and product roles a user has access to.

  7. Select Export users.

  8. An email will be sent when the CSV file is ready to download. Check your junk or spam folder if it’s taking awhile.

  9. Open the email and select Download CSV file. If you’re not logged in, you may need to log in before the download will begin.

  10. Using a spreadsheet program or text editor, remove all rows that should not be deleted, for example, organization administrators.

  11. Ensure that the user executing the deletion is removed.

  12. Ensure the column "User id" (the Atlassian account id) is not removed during cleanup.

  13. Save the csv, now containing a list of all users to be removed.

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 "Delete User from Atlassian Cloud".

  4. Change the method from GET  to DELETE .

  5. In the URL, paste:

    {{cloudUrl}}/rest/api/2/user?accountId={{User id}}
  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 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 - "Delete User from Atlassian Cloud".

  6. On the Functional tab, select Run manually.

  7. Click Data.

  8. Navigate to and select the previously prepared csv file.

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

    Deleting a user is a destructive and irreversible action. We strongly recommend testing with a single user and verifying results before systematically deleting all users.

  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 count has been reduced by one.

  14. Rerun Postman Runner following the previous steps, with the number of "Iterations" set to the number of rows in the csv file. One error may be expected as it is not possible to delete a user who has already been deleted.

References

There is an active feature request:

Feel free to add your vote to help us prioritise new developments based on our users' needs. 




Last modified on Jan 28, 2025

Was this helpful?

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