GitHub v3 REST API

Create a fork

Create a fork for the authenticated user.

Note: Forking a Repository happens asynchronously. You may have to wait a short period of time before you can access the git objects. If this takes longer than 5 minutes, be sure to contact GitHub Enterprise Server Support.

post
http://HOSTNAME/api/v3/repos/{owner}/{repo}/forks

Path Parameters

ownerstringrequired
repostringrequired

Body

application/json
organizationstring

Optional parameter to specify the organization name if forking into an organization.

Response

application/json

Response

Full Repository

Full Repository

idintegerrequired

Example:1296269

node_idstringrequired

Example:MDEwOlJlcG9zaXRvcnkxMjk2MjY5

namestringrequired

Example:Hello-World

full_namestringrequired

Example:octocat/Hello-World

ownerobjectrequired

Simple User

Show Child Parameters
privatebooleanrequired
html_urlstring(uri)required

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

descriptionstring | nullrequired

Example:This your first repo!

forkbooleanrequired
urlstring(uri)required

Example:https://api.github.com/repos/octocat/Hello-World

archive_urlstringrequired

Example:http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}

assignees_urlstringrequired

Example:http://api.github.com/repos/octocat/Hello-World/assignees{/user}

blobs_urlstringrequired

Example:http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}

branches_urlstringrequired

Example:http://api.github.com/repos/octocat/Hello-World/branches{/branch}

collaborators_urlstringrequired

Example:http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}

comments_urlstringrequired

Example:http://api.github.com/repos/octocat/Hello-World/comments{/number}

commits_urlstringrequired

Example:http://api.github.com/repos/octocat/Hello-World/commits{/sha}

compare_urlstringrequired

Example:http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}

contents_urlstringrequired

Example:http://api.github.com/repos/octocat/Hello-World/contents/{+path}

contributors_urlstring(uri)required

Example:http://api.github.com/repos/octocat/Hello-World/contributors

deployments_urlstring(uri)required

Example:http://api.github.com/repos/octocat/Hello-World/deployments

downloads_urlstring(uri)required

Example:http://api.github.com/repos/octocat/Hello-World/downloads

events_urlstring(uri)required

Example:http://api.github.com/repos/octocat/Hello-World/events

forks_urlstring(uri)required

Example:http://api.github.com/repos/octocat/Hello-World/forks

git_commits_urlstringrequired

Example:http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}

git_refs_urlstringrequired

Example:http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}

git_tags_urlstringrequired

Example:http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}

git_urlstringrequired

Example:git:github.com/octocat/Hello-World.git

issue_comment_urlstringrequired

Example:http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}

issue_events_urlstringrequired

Example:http://api.github.com/repos/octocat/Hello-World/issues/events{/number}

issues_urlstringrequired

Example:http://api.github.com/repos/octocat/Hello-World/issues{/number}

keys_urlstringrequired

Example:http://api.github.com/repos/octocat/Hello-World/keys{/key_id}

labels_urlstringrequired

Example:http://api.github.com/repos/octocat/Hello-World/labels{/name}

languages_urlstring(uri)required

Example:http://api.github.com/repos/octocat/Hello-World/languages

merges_urlstring(uri)required

Example:http://api.github.com/repos/octocat/Hello-World/merges

milestones_urlstringrequired

Example:http://api.github.com/repos/octocat/Hello-World/milestones{/number}

notifications_urlstringrequired

Example:http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}

pulls_urlstringrequired

Example:http://api.github.com/repos/octocat/Hello-World/pulls{/number}

releases_urlstringrequired

Example:http://api.github.com/repos/octocat/Hello-World/releases{/id}

ssh_urlstringrequired

Example:git@github.com:octocat/Hello-World.git

stargazers_urlstring(uri)required

Example:http://api.github.com/repos/octocat/Hello-World/stargazers

statuses_urlstringrequired

Example:http://api.github.com/repos/octocat/Hello-World/statuses/{sha}

subscribers_urlstring(uri)required

Example:http://api.github.com/repos/octocat/Hello-World/subscribers

subscription_urlstring(uri)required

Example:http://api.github.com/repos/octocat/Hello-World/subscription

tags_urlstring(uri)required

Example:http://api.github.com/repos/octocat/Hello-World/tags

teams_urlstring(uri)required

Example:http://api.github.com/repos/octocat/Hello-World/teams

trees_urlstringrequired

Example:http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}

clone_urlstringrequired

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

mirror_urlstring | null(uri)required

Example:git:git.example.com/octocat/Hello-World

hooks_urlstring(uri)required

Example:http://api.github.com/repos/octocat/Hello-World/hooks

svn_urlstring(uri)required

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

homepagestring | null(uri)required

Example:https://github.com

languagestring | nullrequired
forks_countintegerrequired

Example:9

stargazers_countintegerrequired

Example:80

watchers_countintegerrequired

Example:80

sizeintegerrequired

Example:108

default_branchstringrequired

Example:master

open_issues_countintegerrequired

Example:0

is_templateboolean

Example:true

topicsarray[string]

Example:["octocat","atom","electron","API"]

has_issuesbooleanrequired

Example:true

has_projectsbooleanrequired

Example:true

has_wikibooleanrequired

Example:true

has_pagesbooleanrequired
has_downloadsbooleanrequired

Example:true

archivedbooleanrequired
disabledbooleanrequired

Returns whether or not this repository disabled.

visibilitystring

The repository visibility: public, private, or internal.

Example:public

pushed_atstring(date-time)required

Example:2011-01-26T19:06:43Z

created_atstring(date-time)required

Example:2011-01-26T19:01:12Z

updated_atstring(date-time)required

Example:2011-01-26T19:14:43Z

permissionsobject
Show Child Parameters
allow_rebase_mergeboolean

Example:true

template_repositoryobject | null

A git repository

Show Child Parameters
temp_clone_tokenstring | null
allow_squash_mergeboolean

Example:true

delete_branch_on_mergeboolean

Example:false

allow_merge_commitboolean

Example:true

allow_forkingboolean

Example:true

subscribers_countintegerrequired

Example:42

network_countintegerrequired

Example:0

licenseobject | nullrequired

License Simple

Show Child Parameters
organizationobject | null

Simple User

Show Child Parameters
parentobject

A git repository

Show Child Parameters
sourceobject

A git repository

Show Child Parameters
forksintegerrequired
master_branchstring
open_issuesintegerrequired
watchersintegerrequired
anonymous_access_enabledboolean

Whether anonymous git access is allowed.

Default:true

code_of_conductobject

Code of Conduct Simple

Show Child Parameters
post/repos/{owner}/{repo}/forks

Body

{}
 
application/json

List repository webhooks

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

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

application/json

Response

Webhooks for repositories.

typestringrequired
idintegerrequired

Unique identifier of the webhook.

Example:42

namestringrequired

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

Example:web

activebooleanrequired

Determines whether the hook is actually triggered on pushes.

Example:true

eventsarray[string]required

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

Example:["push","pull_request"]

configobjectrequired
Show Child Parameters
updated_atstring(date-time)required

Example:2011-09-06T20:39:23Z

created_atstring(date-time)required

Example:2011-09-06T17:26:27Z

urlstring(uri)required

Example:https://api.github.com/repos/octocat/Hello-World/hooks/1

test_urlstring(uri)required

Example:https://api.github.com/repos/octocat/Hello-World/hooks/1/test

ping_urlstring(uri)required

Example:https://api.github.com/repos/octocat/Hello-World/hooks/1/pings

last_responseobjectrequired
Show Child Parameters
get/repos/{owner}/{repo}/hooks
 
application/json

Create a repository webhook

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.

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

Path Parameters

ownerstringrequired
repostringrequired

Body

application/json
* Additional properties are NOT allowed.
namestring

Use web to create a webhook. Default: web. This parameter only accepts the value web.

configobject

Key/value pairs to provide settings for this webhook. These are defined below.

Show Child Parameters
eventsarray[string]

Determines what events the hook is triggered for.

Default:push

activeboolean

Determines if notifications are sent when the webhook is triggered. Set to true to send notifications.

Default:true

Response

application/json

Response

Webhook

Webhooks for repositories.

typestringrequired
idintegerrequired

Unique identifier of the webhook.

Example:42

namestringrequired

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

Example:web

activebooleanrequired

Determines whether the hook is actually triggered on pushes.

Example:true

eventsarray[string]required

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

Example:["push","pull_request"]

configobjectrequired
Show Child Parameters
updated_atstring(date-time)required

Example:2011-09-06T20:39:23Z

created_atstring(date-time)required

Example:2011-09-06T17:26:27Z

urlstring(uri)required

Example:https://api.github.com/repos/octocat/Hello-World/hooks/1

test_urlstring(uri)required

Example:https://api.github.com/repos/octocat/Hello-World/hooks/1/test

ping_urlstring(uri)required

Example:https://api.github.com/repos/octocat/Hello-World/hooks/1/pings

last_responseobjectrequired
Show Child Parameters
post/repos/{owner}/{repo}/hooks

Body

{ "name": "web", "active": true, "events": [ "push", "pull_request" ], "config": { "url": "https://example.com/webhook", "content_type": "json", "insecure_ssl": "0" } }
 
application/json

Get a repository webhook

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

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

Path Parameters

ownerstringrequired
repostringrequired
hook_idintegerrequired

Response

application/json

Response

Webhook

Webhooks for repositories.

typestringrequired
idintegerrequired

Unique identifier of the webhook.

Example:42

namestringrequired

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

Example:web

activebooleanrequired

Determines whether the hook is actually triggered on pushes.

Example:true

eventsarray[string]required

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

Example:["push","pull_request"]

configobjectrequired
Show Child Parameters
updated_atstring(date-time)required

Example:2011-09-06T20:39:23Z

created_atstring(date-time)required

Example:2011-09-06T17:26:27Z

urlstring(uri)required

Example:https://api.github.com/repos/octocat/Hello-World/hooks/1

test_urlstring(uri)required

Example:https://api.github.com/repos/octocat/Hello-World/hooks/1/test

ping_urlstring(uri)required

Example:https://api.github.com/repos/octocat/Hello-World/hooks/1/pings

last_responseobjectrequired
Show Child Parameters
get/repos/{owner}/{repo}/hooks/{hook_id}
 
application/json

Update a repository webhook

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

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

Path Parameters

ownerstringrequired
repostringrequired
hook_idintegerrequired

Body

application/json
configobject

Key/value pairs to provide settings for this webhook. These are defined below.

Show Child Parameters
eventsarray[string]

Determines what events the hook is triggered for. This replaces the entire array of events.

Default:push

add_eventsarray[string]

Determines a list of events to be added to the list of events that the Hook triggers for.

remove_eventsarray[string]

Determines a list of events to be removed from the list of events that the Hook triggers for.

activeboolean

Determines if notifications are sent when the webhook is triggered. Set to true to send notifications.

Default:true

Response

application/json

Response

Webhook

Webhooks for repositories.

typestringrequired
idintegerrequired

Unique identifier of the webhook.

Example:42

namestringrequired

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

Example:web

activebooleanrequired

Determines whether the hook is actually triggered on pushes.

Example:true

eventsarray[string]required

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

Example:["push","pull_request"]

configobjectrequired
Show Child Parameters
updated_atstring(date-time)required

Example:2011-09-06T20:39:23Z

created_atstring(date-time)required

Example:2011-09-06T17:26:27Z

urlstring(uri)required

Example:https://api.github.com/repos/octocat/Hello-World/hooks/1

test_urlstring(uri)required

Example:https://api.github.com/repos/octocat/Hello-World/hooks/1/test

ping_urlstring(uri)required

Example:https://api.github.com/repos/octocat/Hello-World/hooks/1/pings

last_responseobjectrequired
Show Child Parameters
patch/repos/{owner}/{repo}/hooks/{hook_id}

Body

{ "active": true, "add_events": [ "pull_request" ] }
 
application/json