wix-crm-backend emailContact Error

My backend code has been working for quite a while now to send emails and then today, it decided to not work anymore. I keep getting this error in site monitoring -
:“[“Error: server responded with - {"message":"Invalid identity","details":{"errorcode":"-5002"}} (401)”]”

I didn’t change anything and when I call getContactById() with the id saved in the database for the contact, it does return the correct contact. It happens for new and not new contacts. I also made sure that before the email was attempted to be sent, it logs the contact ID and it looks fine.

It would be nice if there was a section that had what different errors meant in the API. Does anyone at Wix know what the error message means so I can more easily debug my code?


#bug ?

They haven’t got the specific API error list, all they have is the Wix Support live issues page which gives you the 401 (Unauthorized) error.
https://support.wix.com/en/article/live-site-error-error-401-unauthorized

Try using the search function top right of this forum to see if others have posted same or similar questions about it.

Yeah I thought it was an unauthorized access error since it was 401 but it never did that before to me. It worked with both non-users, members, admins, etc before but now it doesn’t want to. I tried with all of the different types of users and got the same result.

I searched before I posted and only one but no response from Wix on what it means for the wix-crm-backend.

Same issue here. It will start happening with some users and it will stop randomly and resume working as expected. Sometimes weird things like changing a contact’s First and last names will remove the error for somet time