Skip to content

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.”

API method documentation

owner
required
string

The account owner of the repository. The name is not case sensitive.

repo
required
string

The name of the repository without the .git extension. The name is not case sensitive.

hook_id
required
integer

The unique identifier of the hook. You can find this value in the X-GitHub-Hook-ID header of a webhook delivery.

Response

Media type application/json
Webhook

Webhooks for repositories.

object
type
required
string
id
required

Unique identifier of the webhook.

integer
name
required

The name of a valid service, use ‘web’ for a webhook.

string
active
required

Determines whether the hook is actually triggered on pushes.

boolean
events
required

Determines what events the hook is triggered for. Default: [‘push’].

Array<string>
config
required
Webhook Configuration

Configuration object of the webhook

object
url

The URL to which the payloads will be delivered.

string format: uri
content_type

The media type used to serialize the payloads. Supported values include json and form. The default is form.

string
secret

If provided, the secret will be used as the key to generate the HMAC hex digest value for delivery signature headers.

string
insecure_ssl
One of:

Determines whether the SSL certificate of the host for url will be verified when delivering payloads. Supported values include 0 (verification is performed) and 1 (verification is not performed). The default is 0. We strongly recommend not setting this to 1 as you are subject to man-in-the-middle and other attacks.

string
updated_at
required
string format: date-time
created_at
required
string format: date-time
url
required
string format: uri
test_url
required
string format: uri
ping_url
required
string format: uri
deliveries_url
string format: uri
last_response
required
Hook Response
object
code
required
integer
nullable
status
required
string
nullable
message
required
string
nullable
Examples
Example default
{
"type": "Repository",
"id": 12345678,
"name": "web",
"active": true,
"events": [
"push",
"pull_request"
],
"config": {
"content_type": "json",
"insecure_ssl": "0",
"url": "https://example.com/webhook"
},
"updated_at": "2019-06-03T00:57:16Z",
"created_at": "2019-06-03T00:57:16Z",
"url": "https://api.github.com/repos/octocat/Hello-World/hooks/12345678",
"test_url": "https://api.github.com/repos/octocat/Hello-World/hooks/12345678/test",
"ping_url": "https://api.github.com/repos/octocat/Hello-World/hooks/12345678/pings",
"deliveries_url": "https://api.github.com/repos/octocat/Hello-World/hooks/12345678/deliveries",
"last_response": {
"code": null,
"status": "unused",
"message": null
}
}

Resource not found

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}