Skip to content

Instantly share code, notes, and snippets.

@jmassardo
Created January 12, 2023 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmassardo/3a42c88f91fb5a2b39662fdab6a5c9f9 to your computer and use it in GitHub Desktop.
Save jmassardo/3a42c88f91fb5a2b39662fdab6a5c9f9 to your computer and use it in GitHub Desktop.
Auto create GitHub (GHEC) organizations via the GraphQL API endpoint
curl -H "Authorization: token ${GH_PAT}" -X POST \
-d '{"query": "mutation {create_org: createEnterpriseOrganization(input: {adminLogins: [\"<ADMIN_HANDLE>\", \"<ADMIN_HANDLE>\", \"<ADMIN_HANDLE>\"] billingEmail: \"<ADMIN_EMAIL>\" enterpriseId: \"<ENTPRISE_ID>\" login: \"<ORG_SLUG>\" profileName: \"<ORG_FULL_NAME>\" }){organization {id}}}"}' https://api.github.com/graphql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment