0

I tried below code to create organization using my github account getting error

mutation { createOrganization(input: { login: "besttestzzzz", admin: true }) { organization { id login } } }

{ "input": { "admin": [ "testgithubaccount" ],

"clientMutationId": "",
"login": "testgithubaccount"

} }

I got errors view the below image.

view the below image

Bhaskar g
  • 37
  • 6

1 Answers1

0

GitHub's GraphQL API does not provide direct endpoints to create organizations. Organization creation is typically done through the GitHub web interface or using the REST API.

Here's how you can use rest API:

curl -X POST -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -d '{
  "login": "new-org",
  "profile_name": "New Organization",
  "admin": "your-username"
}' https://api.github.com/user/repos
Ritik
  • 137
  • 1
  • 12