Creating Github Organization using graphql

Creating Github Organization using graphql


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.

Creating Github Organization using graphql

Share

1 Answer
1

Reset to default


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

Share



Not the answer you're looking for? Browse other questions tagged

or ask your own question.

Leave a Reply

Your email address will not be published. Required fields are marked *