500 Error appears when I try to login

firstly I manage to login to tawk.to api using this code snippet

window.Tawk_API.login({
hash : ‘’, // required
userId : ‘1234’, // required
name : ‘Name’
email : ‘email@email.com’,
phone : ‘09123456789’
}, function(error) {
// do something if error
});

but later it starts return 500 Server error when try to do the same

Hello there ny state of health@Dmytro,

Encountering a 500 Server Error can be quite troublesome, especially when it interrupts a previously working login function. The 500 error is a general HTTP status code that indicates something has gone wrong on the web server, but the server could not be more specific on what the exact problem is.

The first step should be to check the server logs for any specific error messages that could point to the root cause of the problem.
Ensure that Secure Mode is enabled for the Javascript API in your tawk.to Dashboard under Administration > Overview. If it’s not enabled, the API might reject the requests.
Verify that you are using the correct API key, which is located next to Secure Mode in the dashboard. This key is essential for authenticating requests when Secure Mode is enabled.
For the hash parameter, you need to use HMAC and Sha256, and pass it as a hex string. Make sure that the hash value is correctly generated and corresponds to the userId.
Review the code snippet for any syntax errors or missing parameters that might cause the server to return an error.

Best Regards,
ny state of health