Script disable users with api

Hello everyone,

I’m looking for a script that allows me to disable all users who haven’t logged in for X amount of time.
Ysers have been added via api from a csv file.

Can you help me?

Users