Template instance not created if board is made using template id via the API

We have come across an annoying problem. If a board exists as a managed template, and you create an instance of the board via the API, that created board is not recognised as an instance of the template. If you do it by hand, the instance is recognised fine. Thanks