What API(s) to use to achieve this goal?

We need to create a repo under a new user account. And this repo is created from an existing repo. What API(s) shall be used? What are related repo settings?