Points de terminaison d’API REST pour la gestion des stratégies de fonctionnalités Copilot
Utilisez l’API REST pour gérer les Copilot règles de fonctionnalité pour une organisation.
Get feature policies for an organization
Note
This endpoint is in public preview and is subject to change.
Use this endpoint to retrieve the Copilot default availability policy for new features and clients for an organization.
The enterprise default is used when the enterprise has set one. Otherwise, the organization's
own default is used, and an organization that has not enabled a default is reported as
disabled. For more information, see
About default availability.
Organization owners can use this endpoint.
OAuth app tokens and personal access tokens (classic) need the admin:org or repo scope to use this endpoint.
Organization SAML authorization and OAuth app access restrictions also apply.
Jetons d'accès granulaires pour «Get feature policies for an organization»
Ce point de terminaison fonctionne avec les types de tokens à granularité fine suivants:
- jetons d’accès utilisateur de l’application GitHub
- jetons d’accès d’installation de l’application GitHub
- Tokens d’accès personnel à granularité fine
Le token à granularité fine doit disposer de l’ensemble d’autorisations suivant:
- "Administration" organization permissions (write)
Paramètres pour «Get feature policies for an organization »
| Nom, Type, Description |
|---|
accept string Setting to |
| Nom, Type, Description |
|---|
org string RequisThe organization name. The name is not case sensitive. |
Codes d’état de réponse HTTP pour «Get feature policies for an organization »
| Code de statut | Description |
|---|---|
200 | OK |
401 | Requires authentication |
403 | Forbidden |
404 | Resource not found |
Exemples de code pour «Get feature policies for an organization »
Si vous accédez à GitHub à GHE.com, remplacez api.github.com par le sous-domaine dédié de votre entreprise à api.SUBDOMAIN.ghe.com.
Exemple de requête
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/orgs/ORG/copilot/feature-policiesOK
Status: 200{
"default_availability": {
"policy_state": "enabled",
"editable": true
}
}Update feature policies for an organization
Note
This endpoint is in public preview and is subject to change.
Use this endpoint to update the Copilot default availability policy for new features and clients for an organization.
An organization can only set its own default while its enterprise has not set one. For more information, see About default availability.
Changing this policy does not change any Copilot feature or client policy that has already been set.
Organization owners can use this endpoint.
OAuth app tokens and personal access tokens (classic) need the admin:org or repo scope to use this endpoint.
Organization SAML authorization and OAuth app access restrictions also apply.
Jetons d'accès granulaires pour «Update feature policies for an organization»
Ce point de terminaison fonctionne avec les types de tokens à granularité fine suivants:
- jetons d’accès utilisateur de l’application GitHub
- jetons d’accès d’installation de l’application GitHub
- Tokens d’accès personnel à granularité fine
Le token à granularité fine doit disposer de l’ensemble d’autorisations suivant:
- "Administration" organization permissions (write)
Paramètres pour «Update feature policies for an organization »
| Nom, Type, Description |
|---|
accept string Setting to |
| Nom, Type, Description |
|---|
org string RequisThe organization name. The name is not case sensitive. |
| Nom, Type, Description | ||
|---|---|---|
default_availability object Requis | ||
Properties of |
| Nom, Type, Description |
|---|
policy_state string RequisThe organization default policy applied to newly released Copilot features and clients. Peut être l'un des: |
Codes d’état de réponse HTTP pour «Update feature policies for an organization »
| Code de statut | Description |
|---|---|
200 | OK |
401 | Requires authentication |
403 | Forbidden |
404 | Resource not found |
422 | Validation failed, or the endpoint has been spammed. |
Exemples de code pour «Update feature policies for an organization »
Si vous accédez à GitHub à GHE.com, remplacez api.github.com par le sous-domaine dédié de votre entreprise à api.SUBDOMAIN.ghe.com.
Exemple de requête
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/orgs/ORG/copilot/feature-policies \
-d '{"default_availability":{"policy_state":"enabled"}}'OK
Status: 200{
"default_availability": {
"policy_state": "enabled",
"editable": true
}
}