Set connect column with API

Want to be able to set the connect board via API. I create boards from a template and my connect boards reference the original template NOT the new board i want to connect to and the only option is to manually go in unlink and relink. Ideally we set it by board ID via API.