# Looking for a way to callback my API after user logs out

**URL:** <https://forum.keycloak.org/t/looking-for-a-way-to-callback-my-api-after-user-logs-out/9246>\
**Category:** Getting advice\
**Created:** [May 26, 2021, 2:12pm UTC](https://forum.keycloak.org/t/looking-for-a-way-to-callback-my-api-after-user-logs-out/9246 "2021-05-26T14:12:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![milicar](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@milicar](https://forum.keycloak.org/u/milicar)\
**Post date:** [May 26, 2021, 2:12pm UTC](https://forum.keycloak.org/t/looking-for-a-way-to-callback-my-api-after-user-logs-out/9246/1 "2021-05-26T14:12:01Z")

</div>

Hi, I am new with Keycloak. I have a question regarding logout event. Is there a way to send a callback to my API after user logs out? I need to set some values in my DB before user logs out. Also, does someone has a proposition on what should I do if user token expires or user closes the tab or the browser? In that case, user wouldn’t click the logout button, and I cannot track these events, so I can send this callback to change values in my DB.

Maybe there is a solution where Keycloak can call API when the user token expires?

Thanks in advance
