The Spotify connection(s) are handled by Mopidy, clients have no control/visibility over backend availaibility and it’s not in our Core API.
By the time your computer has finished starting and you start using it, Mopidy should have had time to initialise and login all the backends but this is not guaranteed. You can run into problems if your computer is not configured to wait for its internet connection to become ready before starting other services. That could be your issue. People have run into this before, especially with Raspberry Pis.
Or your client could just be trying to talk to Mopidy before it’s finished starting. Clients using the websocket library can indeed avoid this problem by using the online/offline websocket events but these relate to the status of Mopidy’s Http server and not the Spotify (or other backed) connection status. Event for online/offline don’t make sense for the HTTP RPC API where there’s normally one connection per request and you have to handle the fact the connection might fail yourself.
I’m not totally sure what your actual problem here is but maybe this background info helps. Mopidy logs would be useful if it’s a startup problem. I can’t think why there’d be any connection issues once Mopidy has started and has been left idle for a while. Logs definitely needed in that case.