What is the difference between user_id and sub in the Userinfo endpoint?

The user_id field is the identifier of the employee associated with the user. If the user is linked to multiple companies, user_id can vary across them. On the other hand, the sub field contains the unique identifier associated with the user account and remains constant across companies. Check API documentation for more details.