Skip to main content

Enterprise Server 3.21 est actuellement disponible en tant que version candidate.

L’API REST est maintenant versionnée. Pour plus d’informations, consultez « À propos des versions de l’API ».

Points de terminaison d’API REST pour les organisations de l’entreprise

Utilisez l’API REST pour créer des organisations sur votre entreprise.

À propos de l’administration de l’organisation

Ces points de terminaison sont uniquement disponibles pour les administrateurs de site authentifiés. Les utilisateurs normaux recevront une réponse 404.

Remarque

Ces points de terminaison prennent uniquement en charge l’authentification à l’aide d’un personal access token (classic). Pour plus d’informations, consultez « Gestion de vos jetons d’accès personnels ».

Create an organization

Fine-grained access tokens for "Create an organization"

This endpoint does not work with GitHub App user access tokens, GitHub App installation access tokens, or fine-grained personal access tokens.

Paramètres pour «Create an organization »

En-têtes
Nom, Type, Description
accept string

Setting to application/vnd.github+json is recommended.

Paramètres du corps
Nom, Type, Description
login string Requis

The organization's username.

admin string Requis

The login of the user who will manage this organization.

profile_name string

The organization's display name.

HTTP response status codes for "Create an organization"

Status codeDescription
201

Created

Code samples for "Create an organization"

Request example

post/admin/organizations
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ http(s)://HOSTNAME/api/v3/admin/organizations \ -d '{"login":"github","profile_name":"GitHub, Inc.","admin":"monalisaoctocat"}'

Response

Status: 201
{ "login": "github", "id": 1, "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=", "url": "https://HOSTNAME/orgs/github", "repos_url": "https://HOSTNAME/orgs/github/repos", "events_url": "https://HOSTNAME/orgs/github/events", "hooks_url": "https://HOSTNAME/orgs/github/hooks", "issues_url": "https://HOSTNAME/orgs/github/issues", "members_url": "https://HOSTNAME/orgs/github/members{/member}", "public_members_url": "https://HOSTNAME/orgs/github/public_members{/member}", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "description": "A great organization" }

Update an organization name

Fine-grained access tokens for "Update an organization name"

This endpoint does not work with GitHub App user access tokens, GitHub App installation access tokens, or fine-grained personal access tokens.

Paramètres pour «Update an organization name »

En-têtes
Nom, Type, Description
accept string

Setting to application/vnd.github+json is recommended.

Paramètres de chemin d’accès
Nom, Type, Description
org string Requis

The organization name. The name is not case sensitive.

Paramètres du corps
Nom, Type, Description
login string Requis

The organization's new name.

HTTP response status codes for "Update an organization name"

Status codeDescription
202

Accepted

Code samples for "Update an organization name"

Request example

patch/admin/organizations/{org}
curl -L \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ http(s)://HOSTNAME/api/v3/admin/organizations/ORG \ -d '{"login":"the-new-octocats"}'

Response

Status: 202
{ "message": "Job queued to rename organization. It may take a few minutes to complete.", "url": "https://<hostname>/api/v3/organizations/1" }