Create github app from script

I am having some trouble using the github v3 api to create a new gitub app with a set of specific permissions.  I browsed through the available endpoints and there doesn’t seem to be an obvious way to do this.  I also looked at the article regarding creating github apps from a manifest, but the documentation is quite confusing.  A clear set of steps and explanation on what each request to an endpoint does would be appreciated.  

There isn’t a method to create a new GitHub App directly via either the REST or GraphQL APIs.

What is it you’re trying to get done? If you share some more information, we can probably help you find a better solution.