How to automate search template creation?

I am using search templates. How to manage the versioning of my templates and execute them . I am exposing search templates via microservice backed by springboot . Thanks

How do we manage the life cycle of search scripts from an application ?