GitHub v3 REST API

Create a deployment status

Users with push access can create deployment statuses for a given deployment.

GitHub Apps require read & write access to “Deployments” and read-only access to “Repo contents” (for private repos). OAuth Apps require the repo_deployment scope.

post
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/deployments/{deployment_id}/statuses

Path Parameters

ownerstringrequired
repostringrequired
deployment_idintegerrequired

deployment_id parameter

Body

application/json
statestringrequired

The state of the status. Can be one of error, failure, inactive, in_progress, queued, pending, or success. Note: To use the inactive state, you must provide the application/vnd.github.ant-man-preview+json custom media type. When you set a transient deployment to inactive, the deployment will be shown as destroyed in GitHub.

Allowed values:errorfailureinactivein_progressqueuedpendingsuccess

target_urlstring

The target URL to associate with this status. This URL should contain output to keep the user updated while the task is running or serve as historical information for what happened in the deployment. Note: It’s recommended to use the log_url parameter, which replaces target_url.

Default:

log_urlstring

The full URL of the deployment’s output. This parameter replaces target_url. We will continue to accept target_url to support legacy uses, but we recommend replacing target_url with log_url. Setting log_url will automatically set target_url to the same value. Default: ""
Note: This parameter requires you to use the application/vnd.github.ant-man-preview+json custom media type.

Default:

descriptionstring

A short description of the status. The maximum description length is 140 characters.

Default:

environmentstring

Name for the target deployment environment, which can be changed when setting a deploy status. For example, production, staging, or qa.

Allowed values:productionstagingqa

environment_urlstring

Sets the URL for accessing your environment. Default: ""
Note: This parameter requires you to use the application/vnd.github.ant-man-preview+json custom media type.

Default:

auto_inactiveboolean

Adds a new inactive status to all prior non-transient, non-production environment deployments with the same repository and environment name as the created status’s deployment. An inactive status is only added to deployments that had a success state. Default: true
Note: This parameter requires you to use the application/vnd.github.ant-man-preview+json custom media type.

Response

application/json

Response

Deployment Status

The status of a deployment.

urlstring(uri)required

Example:https://api.github.com/repos/octocat/example/deployments/42/statuses/1

idintegerrequired

Example:1

node_idstringrequired

Example:MDE2OkRlcGxveW1lbnRTdGF0dXMx

statestringrequired

The state of the status.

Allowed values:errorfailureinactivependingsuccessqueuedin_progress

Example:success

creatorobject | nullrequired

Simple User

Show Child Parameters
descriptionstringrequired

A short description of the status.

Default:

<= 140 characters

Example:Deployment finished successfully.

environmentstring

The environment of the deployment that the status is for.

Default:

Example:production

target_urlstring(uri)required

Deprecated: the URL to associate with this status.

Default:

Example:https://example.com/deployment/42/output

created_atstring(date-time)required

Example:2012-07-20T01:19:13Z

updated_atstring(date-time)required

Example:2012-07-20T01:19:13Z

deployment_urlstring(uri)required

Example:https://api.github.com/repos/octocat/example/deployments/42

repository_urlstring(uri)required

Example:https://api.github.com/repos/octocat/example

environment_urlstring(uri)

The URL for accessing your environment.

Default:

Example:https://staging.example.com/

log_urlstring(uri)

The URL to associate with this status.

Default:

Example:https://example.com/deployment/42/output

performed_via_github_appobject | null

GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub.

Show Child Parameters
post/repos/{owner}/{repo}/deployments/{deployment_id}/statuses

Body

{ "environment": "production", "state": "success", "log_url": "https://example.com/deployment/42/output", "description": "Deployment finished successfully." }
 
application/json

Get a deployment status

Users with pull access can view a deployment status for a deployment:

get
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}

Path Parameters

ownerstringrequired
repostringrequired
deployment_idintegerrequired

deployment_id parameter

status_idintegerrequired

Response

application/json

Response

Deployment Status

The status of a deployment.

urlstring(uri)required

Example:https://api.github.com/repos/octocat/example/deployments/42/statuses/1

idintegerrequired

Example:1

node_idstringrequired

Example:MDE2OkRlcGxveW1lbnRTdGF0dXMx

statestringrequired

The state of the status.

Allowed values:errorfailureinactivependingsuccessqueuedin_progress

Example:success

creatorobject | nullrequired

Simple User

Show Child Parameters
descriptionstringrequired

A short description of the status.

Default:

<= 140 characters

Example:Deployment finished successfully.

environmentstring

The environment of the deployment that the status is for.

Default:

Example:production

target_urlstring(uri)required

Deprecated: the URL to associate with this status.

Default:

Example:https://example.com/deployment/42/output

created_atstring(date-time)required

Example:2012-07-20T01:19:13Z

updated_atstring(date-time)required

Example:2012-07-20T01:19:13Z

deployment_urlstring(uri)required

Example:https://api.github.com/repos/octocat/example/deployments/42

repository_urlstring(uri)required

Example:https://api.github.com/repos/octocat/example

environment_urlstring(uri)

The URL for accessing your environment.

Default:

Example:https://staging.example.com/

log_urlstring(uri)

The URL to associate with this status.

Default:

Example:https://example.com/deployment/42/output

performed_via_github_appobject | null

GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub.

Show Child Parameters
get/repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}
 
application/json

Create a repository dispatch event

You can use this endpoint to trigger a webhook event called repository_dispatch when you want activity that happens outside of GitHub Enterprise Server to trigger a GitHub Actions workflow or GitHub App webhook. You must configure your GitHub Actions workflow or GitHub App to run when the repository_dispatch event occurs. For an example repository_dispatch webhook payload, see “RepositoryDispatchEvent.”

The client_payload parameter is available for any extra information that your workflow might need. This parameter is a JSON payload that will be passed on when the webhook event is dispatched. For example, the client_payload can include a message that a user would like to send using a GitHub Actions workflow. Or the client_payload can be used as a test to debug your workflow.

This endpoint requires write access to the repository by providing either:

This input example shows how you can use the client_payload as a test to debug your workflow.

post
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/dispatches

Path Parameters

ownerstringrequired
repostringrequired

Body

application/json
event_typestringrequired

A custom webhook event name.

>= 1 characters<= 100 characters

client_payloadobject

JSON payload with extra information about the webhook event that your action or worklow may use.

* Additional properties are allowed.

Response

Response

post/repos/{owner}/{repo}/dispatches

Body

{ "event_type": "on-demand-test", "client_payload": { "unit": false, "integration": true } }
 

List forks

get
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/forks

Query Parameters

sortstring

The sort order. Can be either newest, oldest, or stargazers.

Allowed values:newestoldeststargazerswatchers

Default:newest

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

Minimal 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_urlstring
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_urlstring
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_urlstring
mirror_urlstring | null
hooks_urlstring(uri)required

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

svn_urlstring
homepagestring | null
languagestring | null
forks_countinteger
stargazers_countinteger
watchers_countinteger
sizeinteger
default_branchstring
open_issues_countinteger
is_templateboolean
topicsarray[string]
has_issuesboolean
has_projectsboolean
has_wikiboolean
has_pagesboolean
has_downloadsboolean
archivedboolean
disabledboolean
visibilitystring
pushed_atstring | null(date-time)

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

created_atstring | null(date-time)

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

updated_atstring | null(date-time)

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

permissionsobject
Show Child Parameters
template_repositoryobject | null

A git repository

Show Child Parameters
temp_clone_tokenstring
delete_branch_on_mergeboolean
subscribers_countinteger
network_countinteger
code_of_conductobject

Code Of Conduct

Show Child Parameters
licenseobject | null
Show Child Parameters
forksinteger

Example:0

open_issuesinteger

Example:0

watchersinteger

Example:0

allow_forkingboolean
get/repos/{owner}/{repo}/forks
 
application/json

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
{protocol}://{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