Page MenuHomePhabricator

Expose temporary account expiration status in the Action API
Open, In Progress, MediumPublicFeature

Description

Feature summary (what you would like to be able to do and where):
When doing action=query&list=users, add a way to retrieve whether the account is an expired temporary account, similar to the creator_is_expired_temp_account field in action=pagetriagelist.

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):
I am working on a script that identifies users by type, but there is no way exposed by the current API to determine whether an account is a current or expired account other than retrieving the creation time, adding 90 days, comparing it to the current time, and hoping that the math is accurate. Scripts that leave messages for users would also benefit from being able to warn the user that the account they're leaving a message for has been deactivated, the same way it would notify about an account that does not exist.

Benefits (why should this be implemented?):
Any script or external tool that identifies users by type or leaves messages or notices on user talk pages needs to know whether the account is currently expired or not. Having the script do the math based on the registration date is a fragile system that requires extra code overhead and would break if the expiration time is changed or any other changes are made such as allowing renewal or early expiration.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

+1 This seems like an obvious thing that should happen, and I assume trivial to implement.

Please avoid noisy "+1"/"me too" comments; feel free to use tokens or such - thanks.

aaron triaged this task as Low priority.Nov 5 2025, 7:43 AM
aaron moved this task from Incoming (Needs Triage) to Bugs & Chores on the MW-Interfaces-Team board.
mszwarc changed the task status from Open to In Progress.Dec 1 2025, 9:51 AM
mszwarc claimed this task.
mszwarc subscribed.

Apart from implementing it for action=query&list=users, I think we should also do it for action=query&list=allusers for parity

Change #1213958 had a related patch set uploaded (by Mszwarc; author: Mszwarc):

[mediawiki/core@master] Add expiration status to API: query+users, query+allusers

https://gerrit.wikimedia.org/r/1213958

Change #1213958 merged by jenkins-bot:

[mediawiki/core@master] Add expiration status to API: query+users, query+allusers

https://gerrit.wikimedia.org/r/1213958

@mszwarc what is the best way to test this with the Action API ? can you help provide the testing steps?

Test Status: QA PASS

This was tested with a temp account that is:

  • not expired
  • not available
  • null ( account that is not a temp account)
  • temp account is not expired