GitHub v3 REST API

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.

patch
http://HOSTNAME/api/v3/repos/{owner}/{repo}/hooks/{hook_id}/config

Path Parameters

ownerstringrequired
repostringrequired
hook_idintegerrequired

Body

application/json
* Additional properties are NOT allowed.
urlstring(uri)

The URL to which the payloads will be delivered.

Example:https://example.com/webhook

content_typestring

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

Example:"json"

secretstring

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

Example:"********"

insecure_sslOne Of
Variant 1string

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.

Example:"0"

Response

200 application/json

Response

Webhook Configuration

Configuration object of the webhook

urlstring(uri)

The URL to which the payloads will be delivered.

Example:https://example.com/webhook

content_typestring

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

Example:"json"

secretstring

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

Example:"********"

insecure_sslOne Of
Variant 1string

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.

Example:"0"

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

Body

{ "content_type": "json", "insecure_ssl": "0", "secret": "********", "url": "https://example.com/webhook" }
 
200 application/json

Ping a repository webhook

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

post
http://HOSTNAME/api/v3/repos/{owner}/{repo}/hooks/{hook_id}/pings

Path Parameters

ownerstringrequired
repostringrequired
hook_idintegerrequired

Response

Response

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

Test the push repository webhook

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

post
http://HOSTNAME/api/v3/repos/{owner}/{repo}/hooks/{hook_id}/tests

Path Parameters

ownerstringrequired
repostringrequired
hook_idintegerrequired

Response

Response

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

List repository invitations

When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations.

get
http://HOSTNAME/api/v3/repos/{owner}/{repo}/invitations

Query Parameters

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Path Parameters

ownerstringrequired
repostringrequired

Response

200 application/json

Response

Repository invitations let you manage who you collaborate with.

idintegerrequired

Unique identifier of the repository invitation.

Example:42

repositoryobjectrequired

Minimal Repository

Show Child Parameters
inviteeobject | nullrequired

Simple User

Show Child Parameters
inviterobject | nullrequired

Simple User

Show Child Parameters
permissionsstringrequired

The permission associated with the invitation.

Allowed values:readwriteadmintriagemaintain

Example:read

created_atstring(date-time)required

Example:2016-06-13T14:52:50-05:00

expiredboolean

Whether or not the invitation has expired

urlstringrequired

URL for the repository invitation

Example:https://api.github.com/user/repository-invitations/1

html_urlstringrequired

Example:https://github.com/octocat/Hello-World/invitations

node_idstringrequired
get/repos/{owner}/{repo}/invitations
 
200 application/json

Update a repository invitation

patch
http://HOSTNAME/api/v3/repos/{owner}/{repo}/invitations/{invitation_id}

Path Parameters

ownerstringrequired
repostringrequired
invitation_idintegerrequired

invitation_id parameter

Body

application/json
permissionsstring

The permissions that the associated user will have on the repository. Valid values are read, write, maintain, triage, and admin.

Allowed values:readwritemaintaintriageadmin

Response

200 application/json

Response

Repository Invitation

Repository invitations let you manage who you collaborate with.

idintegerrequired

Unique identifier of the repository invitation.

Example:42

repositoryobjectrequired

Minimal Repository

Show Child Parameters
inviteeobject | nullrequired

Simple User

Show Child Parameters
inviterobject | nullrequired

Simple User

Show Child Parameters
permissionsstringrequired

The permission associated with the invitation.

Allowed values:readwriteadmintriagemaintain

Example:read

created_atstring(date-time)required

Example:2016-06-13T14:52:50-05:00

expiredboolean

Whether or not the invitation has expired

urlstringrequired

URL for the repository invitation

Example:https://api.github.com/user/repository-invitations/1

html_urlstringrequired

Example:https://github.com/octocat/Hello-World/invitations

node_idstringrequired
patch/repos/{owner}/{repo}/invitations/{invitation_id}

Body

{}
 
200 application/json