API token stopped working

API token stopped working, created a new and it is working fine but I have a live product, this should not happen.
First I have to understand why this happened
Second, what should I do to avoid this in future

Do you have logs that show the API error message you started getting?