In order to invoke MetaApi Websocket API you have to provide an authorization token via auth-token query parameter on connection. An API request will produce error 401 if for some reason the token specified turned out to be invalid and the authorization failed.
Alternatively you can use authorization token stored in
accessToken field of the MetatraderAccount model. This token is permitted to access single account.