# Get User Last Failed Login

**URL:** <https://devforum.okta.com/t/get-user-last-failed-login/13412>\
**Category:** Questions\
**Created:** [March 18, 2021, 8:13am UTC](https://devforum.okta.com/t/get-user-last-failed-login/13412 "2021-03-18T08:13:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![userone](https://avatars.discourse-cdn.com/v4/letter/u/848f3c/32.png) [@userone](https://devforum.okta.com/u/userone)\
**Post date:** [March 18, 2021, 8:13am UTC](https://devforum.okta.com/t/get-user-last-failed-login/13412/1 "2021-03-18T08:13:28Z")

</div>

Hello there,

My company is looking to store a user’s last successful and last failed login attempts.  
Based on the user API it’s simple enough to retrieve the last login but there doesn’t seem to be a way to retrieve the last failed login.

Any help would be appreciated!

---

<div class="post-metadata">

**Author:** ![kevintparker](https://avatars.discourse-cdn.com/v4/letter/k/3da27b/32.png) [@kevintparker](https://devforum.okta.com/u/kevintparker)\
**Post date:** [March 18, 2021, 2:48pm UTC](https://devforum.okta.com/t/get-user-last-failed-login/13412/2 "2021-03-18T14:48:46Z")

</div>

Use the Okta System Log API: [System Log | Okta Developer](https://developer.okta.com/docs/reference/api/system-log/)

I think this should get you what you want.

–All failures  
/api/v1/logs?filter=outcome.result+eq+%22FAILURE%22+and+outcome.reason+eq+%22INVALID\_CREDENTIALS%22

–Failure of a user who’s ID is abcdefghijklmnopq123  
/api/v1/logs?filter=outcome.result+eq+%22FAILURE%22+and+outcome.reason+eq+%22INVALID\_CREDENTIALS%22+and+actor.id+eq+%22abcdefghijklmnopq123%22

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [February 6, 2024, 11:20pm UTC](https://devforum.okta.com/t/get-user-last-failed-login/13412/3 "2024-02-06T23:20:44Z")

</div>

Closed on February 6, 2024, 11:20pm UTC


