Forums

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

How to automate account deactivation via API

Juan Felipe Garcia
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 4, 2025

Hello Atlassian team, you've been very helpful in the past so we want to share this problem with you and ask if you have a solution for it.

 

Context

We manage a pretty big organization (thousands of licences), and to keep our account count clean we would like to implement a way to automate the licence clean up. Basically the steps would be:

1. Getting a list of all the users with their last active date.

2. Filtering that list to leave only the ones that have not been active for the last 90 days

3. Deactivating the accounts within the filtered list 

 

We were thinking of using a Python script within a Git repo integrated with our Jira to run this. But this would be a new field for us thus we've been doing it manually for the last couple of months (but believe automation is feasable)

 

If you need any clarification please let us know.

 

Thank you and regards,

1 answer

0 votes
Prachi Bolar
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 4, 2025

Hello,

Welcome to community :) 

Please find details below 

1. Getting a list of all the users with their last active date.

Kindly refer to this https://developer.atlassian.com/cloud/admin/organization/user-last-active-dates/ and https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-users/#api-rest-api-3-user-search-get

  • GET /rest/api/3/user/search?query=&maxResults=1000

This will return user details such as accountId, displayName, emailAddress, etc.

2. Filtering that list to leave only the ones that have not been active for the last 90 days

There is no direct way but you can export the list of yours as per this https://support.atlassian.com/organization-administration/docs/export-users-from-a-site/ and then filter out the inactive or active users

3.Deactivating the accounts within the filtered list 

Please check this : https://support.atlassian.com/jira/kb/disable-or-remove-inactive-jira-users-in-bulk-in-jira-cloud/

Thank You,

Prachi

 

Juan Felipe Garcia
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 7, 2025

Hello @Prachi Bolar 

 

Will try this and let you know, thank you for the swift response.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
ENTERPRISE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events