API
tryapis.com
Find anything
⌘ K
GitHub API Endpoints
actions
activity
apps
billing
checks
code-scanning
codes-of-conduct
emojis
enterprise-admin
gists
git
gitignore
interactions
issues
licenses
markdown
meta
migrations
oauth-authorizations
orgs
packages
projects
pulls
rate-limit
reactions
repos
List organization repositories

GET

Create an organization repository

POST

Get a repository

GET

Update a repository

PATCH

Delete a repository

DELETE

List all autolinks of a repository

GET

Create an autolink reference for a repository

POST

Get an autolink reference of a repository

GET

Delete an autolink reference from a repository

DELETE

Enable automated security fixes

PUT

Disable automated security fixes

DELETE

List branches

GET

Get a branch

GET

Get branch protection

GET

Update branch protection

PUT

Delete branch protection

DELETE

Get admin branch protection

GET

Set admin branch protection

POST

Delete admin branch protection

DELETE

Get pull request review protection

GET

Update pull request review protection

PATCH

Delete pull request review protection

DELETE

Get commit signature protection

GET

Create commit signature protection

POST

Delete commit signature protection

DELETE

Get status checks protection

GET

Update status check protection

PATCH

Remove status check protection

DELETE

Get all status check contexts

GET

Add status check contexts

POST

Set status check contexts

PUT

Remove status check contexts

DELETE

Get access restrictions

GET

Delete access restrictions

DELETE

Get apps with access to the protected branch

GET

Add app access restrictions

POST

Set app access restrictions

PUT

Remove app access restrictions

DELETE

Get teams with access to the protected branch

GET

Add team access restrictions

POST

Set team access restrictions

PUT

Remove team access restrictions

DELETE

Get users with access to the protected branch

GET

Add user access restrictions

POST

Set user access restrictions

PUT

Remove user access restrictions

DELETE

Rename a branch

POST

List repository collaborators

GET

Check if a user is a repository collaborator

GET

Add a repository collaborator

PUT

Remove a repository collaborator

DELETE

Get repository permissions for a user

GET

List commit comments for a repository

GET

Get a commit comment

GET

Update a commit comment

PATCH

Delete a commit comment

DELETE

List commits

GET

List branches for HEAD commit

GET

List commit comments

GET

Create a commit comment

POST

List pull requests associated with a commit

GET

Get a commit

GET

Get the combined status for a specific reference

GET

List commit statuses for a reference

GET

Get community profile metrics

GET

Compare two commits

GET

Get repository content

GET

Create or update file contents

PUT

Delete a file

DELETE

List repository contributors

GET

List deployments

GET

Create a deployment

POST

Get a deployment

GET

Delete a deployment

DELETE

List deployment statuses

GET

Create a deployment status

POST

Get a deployment status

GET

Create a repository dispatch event

POST

Get all environments

GET

Get an environment

GET

Create or update an environment

PUT

Delete an environment

DELETE

List forks

GET

Create a fork

POST

List repository webhooks

GET

Create a repository webhook

POST

Get a repository webhook

GET

Update a repository webhook

PATCH

Delete a repository webhook

DELETE

Get a webhook configuration for a repository

GET

Update a webhook configuration for a repository

PATCH

List deliveries for a repository webhook

GET

Get a delivery for a repository webhook

GET

Redeliver a delivery for a repository webhook

POST

Ping a repository webhook

POST

Test the push repository webhook

POST

List repository invitations

GET

Update a repository invitation

PATCH

Delete a repository invitation

DELETE

List deploy keys

GET

Create a deploy key

POST

Get a deploy key

GET

Delete a deploy key

DELETE

List repository languages

GET

Enable Git LFS for a repository

PUT

Disable Git LFS for a repository

DELETE

Sync a fork branch with the upstream repository

POST

Merge a branch

POST

Get a GitHub Pages site

GET

Create a GitHub Pages site

POST

Update information about a GitHub Pages site

PUT

Delete a GitHub Pages site

DELETE

List GitHub Pages builds

GET

Request a GitHub Pages build

POST

Get latest Pages build

GET

Get GitHub Pages build

GET

Get a DNS health check for GitHub Pages

GET

Get a repository README

GET

Get a repository README for a directory

GET

List releases

GET

Create a release

POST

Get a release asset

GET

Update a release asset

PATCH

Delete a release asset

DELETE

Generate release notes content for a release

POST

Get the latest release

GET

Get a release by tag name

GET

Get a release

GET

Update a release

PATCH

Delete a release

DELETE

List release assets

GET

Upload a release asset

POST

Get the weekly commit activity

GET

Get the last year of commit activity

GET

Get all contributor commit activity

GET

Get the weekly commit count

GET

Get the hourly commit count for each day

GET

Create a commit status

POST

List repository tags

GET

Download a repository archive (tar)

GET

List repository teams

GET

Get all repository topics

GET

Replace all repository topics

PUT

Get repository clones

GET

Get top referral paths

GET

Get top referral sources

GET

Get page views

GET

Transfer a repository

POST

Check if vulnerability alerts are enabled for a repository

GET

Enable vulnerability alerts

PUT

Disable vulnerability alerts

DELETE

Download a repository archive (zip)

GET

Create a repository using a template

POST

List public repositories

GET

List repositories for the authenticated user

GET

Create a repository for the authenticated user

POST

List repository invitations for the authenticated user

GET

Accept a repository invitation

PATCH

Decline a repository invitation

DELETE

List repositories for a user

GET

scim
search
secret-scanning
teams
users

POST

https://api.github.com/repos/owner/repo/deployments

Deployments offer a few configurable parameters with certain defaults.

The ref parameter can be any named branch, tag, or SHA. At GitHub we often deploy branches and verify them before we merge a pull request.

The environment parameter allows deployments to be issued to different runtime environments. Teams often have multiple environments for verifying their applications, such as production, staging, and qa. This parameter makes it easier to track which environments have requested deployments. The default environment is production.

The auto_merge parameter is used to ensure that the requested ref is not behind the repository's default branch. If the ref is behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds, the API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will return a failure response.

By default, commit statuses for every submitted context must be in a success state. The required_contexts parameter allows you to specify a subset of contexts that must be success, or to specify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do not require any contexts or create any commit statuses, the deployment will always succeed.

The payload parameter is available for any extra information that a deployment system might need. It is a JSON text field that will be passed on when a deployment event is dispatched.

The task parameter is used by the deployment system to allow different execution paths. In the web world this might be deploy:migrations to run schema changes on the system. In the compiled world this could be a flag to compile an application with debugging enabled.

Users with repo or repo_deployment scopes can create a deployment for a given ref.

Merged branch response

You will see this response when GitHub automatically merges the base branch into the topic branch instead of creating a deployment. This auto-merge happens when:

  • Auto-merge option is enabled in the repository
  • Topic branch does not include the latest changes on the base branch, which is master in the response example
  • There are no merge conflicts

If there are no new commits in the base branch, a new request to create a deployment should give a successful response.

Merge conflict response

This error happens when the auto_merge option is enabled and when the default branch (in this case master), can't be merged into the branch that's being deployed (in this case topic-branch), due to merge conflicts.

Failed commit status checks

This error happens when the required_contexts parameter indicates that one or more contexts need to have a success status for the commit to be deployed, but one or more of the required contexts do not have a state of success.

Scopes requested: user, public_repo, repo, notifications, gist
Authorization
tryapis.com never stores your requests or responses