Esta versão do GitHub Enterprise foi descontinuada em 2022-10-12. Nenhum lançamento de patch será feito, mesmo para questões críticas de segurança. Para obter melhor desempenho, segurança aprimorada e novos recursos, atualize para a última versão do GitHub Enterprise. Para obter ajuda com a atualização, entre em contato com o suporte do GitHub Enterprise.
We've recently moved some of the REST API documentation. If you can't find what you're looking for, you might try the new Branches, Collaborators, Commits, Deploy Keys, Deployments, GitHub Pages, Releases, Metrics, Webhooks REST API pages.
Configuração de webhook do repositório
Get a webhook configuration for a repository
Returns the webhook configuration for a repository. To get more information about the webhook, including the active state and events, use "Get a repository webhook."
Access tokens must have the read:repo_hook or repo scope, and GitHub Apps must have the repository_hooks:read permission.
Parâmetros
| Headers | 
|---|
| Name, Type, Description | 
| acceptstringSetting to  | 
| Path parameters | 
| Name, Type, Description | 
| ownerstringRequiredThe account owner of the repository. The name is not case sensitive. | 
| repostringRequiredThe name of the repository. The name is not case sensitive. | 
| hook_idintegerRequiredThe unique identifier of the hook. | 
Códigos de status de resposta HTTP
| Código de status | Descrição | 
|---|---|
| 200 | OK | 
Exemplos de código
curl \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/hooks/HOOK_ID/configResponse
Status: 200{
  "content_type": "json",
  "insecure_ssl": "0",
  "secret": "********",
  "url": "https://example.com/webhook"
}Update a webhook configuration for a repository
Updates the webhook configuration for a repository. To update more information about the webhook, including the active state and events, use "Update a repository webhook."
Access tokens must have the write:repo_hook or repo scope, and GitHub Apps must have the repository_hooks:write permission.
Parâmetros
| Headers | 
|---|
| Name, Type, Description | 
| acceptstringSetting to  | 
| Path parameters | 
| Name, Type, Description | 
| ownerstringRequiredThe account owner of the repository. The name is not case sensitive. | 
| repostringRequiredThe name of the repository. The name is not case sensitive. | 
| hook_idintegerRequiredThe unique identifier of the hook. | 
| Body parameters | 
| Name, Type, Description | 
| urlstringThe URL to which the payloads will be delivered. | 
| content_typestringThe media type used to serialize the payloads. Supported values include  | 
| secretstringIf provided, the  | 
| insecure_sslstring or numberDetermines whether the SSL certificate of the host for  | 
Códigos de status de resposta HTTP
| Código de status | Descrição | 
|---|---|
| 200 | OK | 
Exemplos de código
curl \
  -X PATCH \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/hooks/HOOK_ID/configResponse
Status: 200{
  "content_type": "json",
  "insecure_ssl": "0",
  "secret": "********",
  "url": "https://example.com/webhook"
}