REST API endpoints for repository webhooks

Use the REST API to create and manage webhooks for your repositories.

About repository webhooks

Repository webhooks allow your server to receive HTTP POST payloads whenever certain events happen in a repository. For more information, see Webhooks documentation.

Note

Most endpoints use Authorization: Bearer <YOUR-TOKEN> and Accept: application/vnd.github+json headers, plus X-GitHub-Api-Version: 2026-03-10. Curl examples below omit these standard headers for brevity.

List repository webhooks

GET /repos/{owner}/{repo}/hooks

Lists webhooks for a repository. last response may return null if there have not been any deliveries within 30 days.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/hooks

Response schema (Status: 200):

Array of Webhook:

Create a repository webhook

POST /repos/{owner}/{repo}/hooks

Repositories can have multiple webhooks installed. Each webhook should have a unique config. Multiple webhooks can
share the same config as long as those webhooks do not have any events that overlap.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X POST \
  https://api.github.com/repos/OWNER/REPO/hooks \
  -d '{
  "name": "web",
  "active": true,
  "events": [
    "push",
    "pull_request"
  ],
  "config": {
    "url": "https://example.com/webhook",
    "content_type": "json",
    "insecure_ssl": "0"
  }
}'

Response schema (Status: 201):

Get a repository webhook

GET /repos/{owner}/{repo}/hooks/{hook_id}

Returns a webhook configured in a repository. To get only the webhook config properties, see "Get a webhook configuration for a repository."

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/hooks/HOOK_ID

Response schema (Status: 200):

Same response schema as Create a repository webhook.

Update a repository webhook

PATCH /repos/{owner}/{repo}/hooks/{hook_id}

Updates a webhook configured in a repository. If you previously had a secret set, you must provide the same secret or set a new secret or the secret will be removed. If you are only updating individual webhook config properties, use "Update a webhook configuration for a repository."

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X PATCH \
  https://api.github.com/repos/OWNER/REPO/hooks/HOOK_ID \
  -d '{
  "active": true,
  "add_events": [
    "pull_request"
  ]
}'

Response schema (Status: 200):

Same response schema as Create a repository webhook.

Delete a repository webhook

DELETE /repos/{owner}/{repo}/hooks/{hook_id}

Delete a webhook for an organization.
The authenticated user must be a repository owner, or have admin access in the repository, to delete the webhook.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/repos/OWNER/REPO/hooks/HOOK_ID

Response schema (Status: 204):

Get a webhook configuration for a repository

GET /repos/{owner}/{repo}/hooks/{hook_id}/config

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."
OAuth app tokens and personal access tokens (classic) need the read:repo_hook or repo scope to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/hooks/HOOK_ID/config

Response schema (Status: 200):

Update a webhook configuration for a repository

PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config

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."
OAuth app tokens and personal access tokens (classic) need the write:repo_hook or repo scope to use this endpoint.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example of updating content type and URL

Request:

curl -L \
  -X PATCH \
  https://api.github.com/repos/OWNER/REPO/hooks/HOOK_ID/config \
  -d '{
  "content_type": "json",
  "url": "https://example.com/webhook"
}'

Response schema (Status: 200):

Same response schema as Get a webhook configuration for a repository.

List deliveries for a repository webhook

GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries

Returns a list of webhook deliveries for a webhook configured in a repository.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/hooks/HOOK_ID/deliveries

Response schema (Status: 200):

Array of Simple webhook delivery:

Get a delivery for a repository webhook

GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}

Returns a delivery for a webhook configured in a repository.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/hooks/HOOK_ID/deliveries/DELIVERY_ID

Response schema (Status: 200):

Redeliver a delivery for a repository webhook

POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts

Redeliver a webhook delivery for a webhook configured in a repository.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X POST \
  https://api.github.com/repos/OWNER/REPO/hooks/HOOK_ID/deliveries/DELIVERY_ID/attempts

Response schema (Status: 202):

object

Ping a repository webhook

POST /repos/{owner}/{repo}/hooks/{hook_id}/pings

This will trigger a ping event to be sent to the hook.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X POST \
  https://api.github.com/repos/OWNER/REPO/hooks/HOOK_ID/pings

Response schema (Status: 204):

Test the push repository webhook

POST /repos/{owner}/{repo}/hooks/{hook_id}/tests

This will trigger the hook with the latest push to the current repository if the hook is subscribed to push events. If the hook is not subscribed to push events, the server will respond with 204 but no test POST will be generated.
Note

Previously /repos/:owner/:repo/hooks/:hook_id/test

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X POST \
  https://api.github.com/repos/OWNER/REPO/hooks/HOOK_ID/tests

Response schema (Status: 204):