Automating creation of repositories in Bitbucket server

Out of curiosity, has anyone else gone about automating the creation of repositories within a Bitbucket project? I have a team which I support that frequently requests new repos, and I try to maintain a standard setup across all of them, at least initially. Manual process does not generally take long to do, but I have to stop what I’m doing to do it. I’d love to have a self-service mechanism for the team members that they would provide a couple of details and a bot of sorts would handle the repo creation, addition of standard set-up files (.gitignore, README, build.gradle/pom.xml, etc), configuration of branch permissions … common things that should be set for each repository. Not sure where to begin. Is this something that should be done via a server-side app, or would the REST API provide enough support for this where I can execute a handful of calls from a web portal? Has someone already done something similar and has available as open source that I can fork? Thanks

Unfortunately no, nothing exists. We have simply heavily scripted the REST API to set things up for us. It’s heavily tied to our internal process though, I cannot share it today. I will note, all the Permissions, Branch Permissions, and Pre/Post Receive, Merge Checks have REST API’s to use for this.