<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D50Z00008C3jaTSAROkta Classic EngineIntegrationsAnswered2024-04-30T09:18:25.000Z2018-02-19T14:11:29.000Z2022-06-27T13:56:06.000Z
Find Users not logged in since certain date
Is there a way for me to search for user that have not logged in since timestamp xxx

 

eg.

 

https://{my-okta-domain}.com/api/v1/users?search=lastLogin gt "2018-01-01T00:00:00.000Z"

 

I am getting an "errorSummary": "Invalid search attribute." error back when trying find use the above search criteria and the documentation suggests that the only top level attributes I can search for are

 

id, status, created, activated, statusChanged and lastUpdated

 

http://developer.okta.com/docs/api/resources/users.html#list-users-with-search

 

What is the best way to find these users, if I have a very large user base and dont want to retrieve ALL users from okta?

  • f5eci (f5eci)

    The support team got back to me with the below. So it is NOT possible, to search based on lastLogin.

     

    "As an alternative that would provide you the same result would be to do in Reports> Okta Password Health report and that will give you the last login as well. 

    If you want to go with API call instead you can use "List Active Users". The call in the result will also provide you with the lastLogin field, but there is no API that will give you that specific result directly as a search."

     

    I really hope though that this will become a searchable attribute some day, why would lastUpdated by searchable and lastLogin not?

    Expand Post
  • j5v7c (j5v7c)

    Hello,

     

    Thanks for posting your inquiry in Okta Community Portal.

     

    ​If you receive a great answer to your question(s), please help readers find it by marking it the best answer. Hover over the answer and click "Best Answer." 

     

    Thank you,

     

    ​Dylann Fezeu

    OHC Team
    Expand Post
  • grwgl (grwgl)

    Searching and/or Filtering by lastLogin via the API is, or would be, a killer feature for automated job-based user analysis and cleanup. Can it be added to the API? Seems like a very easy addition given that lastUpdated is already there (can't imagine what one would use that for, however.) Thanks much.

  • StevenB.94699 (Customer)

    I agree this is an absolute MUST ADD to the platform

    I have many requests for this functionality related to HIPAA and SOC 2 TYPE 2 accredidations.

    PLEASE ADD THIS AS SOON AS POSSIBLE!!

This question is closed.
Loading
Find Users not logged in since certain date