Create repository from private repository template via API?

How can I create a new repository from private repository template via API?

I have tried it with https://api.github.com/repos/:template_owner/:template_repo/generate
and Authentication token but it does not work.

“message”: “Invalid request.\n\nFor ‘links/7/schema’, nil is not an object.”

Can you help me.

Hi there @patriceckhart! Just wanting to throw a quick response your way, to find out if you’re still having trouble.

It would be really fantastic to see the full request being made (obscuring any token values you might have) to best assist.

If you found your solution already, would you mind posting back and letting us know?

Either way, I hope you keep well in the meantime!

At the moment I am creating a new repository in the Docker container, committing and pushing it as a private repository. Then I transfer the repository to a Docker container in the Kubernetes Engine and get it when the container is created. That’s how it works right now.

Thanks for the breakdown of your flow @patriceckhart! Helpful to visualize, but curious if you’re still seeing that error?

It sounds like you’re still seeing that error, after the create action, from K8s, after a successful transfer.

Though the explicit usage of the API call would be interesting to know. Are you able to provide some more detail around the query being used that kicks out the error message?

I think the API call for creating templates from a template is not suitable for private repositories? Only for public? That is the “mistake”.

You should be able to use the template API for private repositories, but your auth must include the repo scope, per:

…does your auth include that scope?