Block a deleted logged user to continue access to an API

If a user is logged to access to an API and delete the user from the keycloak Interface, the user logged continues having access to the API. How coud I block a user just after be deleted from keycloak?