This version of GitHub Enterprise was discontinued on 2023-03-15. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise. For help with the upgrade, contact GitHub Enterprise support.
Deployment statuses
Use the REST API to manage deployment statuses.
List deployment statuses
Users with pull access can view deployment statuses for a deployment:
Parameters for "List deployment statuses"
| Headers | 
|---|
| Name, Type, Description | 
| acceptstringSetting to  | 
| Path parameters | 
| Name, Type, Description | 
| ownerstring RequiredThe account owner of the repository. The name is not case sensitive. | 
| repostring RequiredThe name of the repository without the  | 
| deployment_idinteger Requireddeployment_id parameter | 
| Query parameters | 
| Name, Type, Description | 
| per_pageintegerThe number of results per page (max 100). Default:  | 
| pageintegerPage number of the results to fetch. Default:  | 
HTTP response status codes for "List deployment statuses"
| Status code | Description | 
|---|---|
| 200 | OK | 
| 404 | Resource not found | 
Code samples for "List deployment statuses"
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/deployments/DEPLOYMENT_ID/statusesResponse
Status: 200[ { "url": "https://HOSTNAME/repos/octocat/example/deployments/42/statuses/1", "id": 1, "node_id": "MDE2OkRlcGxveW1lbnRTdGF0dXMx", "state": "success", "creator": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://HOSTNAME/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://HOSTNAME/users/octocat/followers", "following_url": "https://HOSTNAME/users/octocat/following{/other_user}", "gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}", "starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions", "organizations_url": "https://HOSTNAME/users/octocat/orgs", "repos_url": "https://HOSTNAME/users/octocat/repos", "events_url": "https://HOSTNAME/users/octocat/events{/privacy}", "received_events_url": "https://HOSTNAME/users/octocat/received_events", "type": "User", "site_admin": false }, "description": "Deployment finished successfully.", "environment": "production", "target_url": "https://example.com/deployment/42/output", "created_at": "2012-07-20T01:19:13Z", "updated_at": "2012-07-20T01:19:13Z", "deployment_url": "https://HOSTNAME/repos/octocat/example/deployments/42", "repository_url": "https://HOSTNAME/repos/octocat/example", "environment_url": "https://test-branch.lab.acme.com", "log_url": "https://example.com/deployment/42/output" } ]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.
Parameters for "Create a deployment status"
| Headers | 
|---|
| Name, Type, Description | 
| acceptstringSetting to  | 
| Path parameters | 
| Name, Type, Description | 
| ownerstring RequiredThe account owner of the repository. The name is not case sensitive. | 
| repostring RequiredThe name of the repository without the  | 
| deployment_idinteger Requireddeployment_id parameter | 
| Body parameters | 
| Name, Type, Description | 
| statestring RequiredThe state of the status. When you set a transient deployment to  Can be one of:  | 
| target_urlstringThe 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  Default:  | 
| log_urlstringThe full URL of the deployment's output. This parameter replaces  Default:  | 
| descriptionstringA short description of the status. The maximum description length is 140 characters. Default:  | 
| environmentstringName for the target deployment environment, which can be changed when setting a deploy status. For example,  Can be one of:  | 
| environment_urlstringSets the URL for accessing your environment. Default:  Default:  | 
| auto_inactivebooleanAdds a new  | 
HTTP response status codes for "Create a deployment status"
| Status code | Description | 
|---|---|
| 201 | Created | 
| 422 | Validation failed, or the endpoint has been spammed. | 
Code samples for "Create a deployment status"
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/deployments/DEPLOYMENT_ID/statuses \ -d '{"environment":"production","state":"success","log_url":"https://example.com/deployment/42/output","description":"Deployment finished successfully."}'Response
Status: 201{ "url": "https://HOSTNAME/repos/octocat/example/deployments/42/statuses/1", "id": 1, "node_id": "MDE2OkRlcGxveW1lbnRTdGF0dXMx", "state": "success", "creator": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://HOSTNAME/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://HOSTNAME/users/octocat/followers", "following_url": "https://HOSTNAME/users/octocat/following{/other_user}", "gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}", "starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions", "organizations_url": "https://HOSTNAME/users/octocat/orgs", "repos_url": "https://HOSTNAME/users/octocat/repos", "events_url": "https://HOSTNAME/users/octocat/events{/privacy}", "received_events_url": "https://HOSTNAME/users/octocat/received_events", "type": "User", "site_admin": false }, "description": "Deployment finished successfully.", "environment": "production", "target_url": "https://example.com/deployment/42/output", "created_at": "2012-07-20T01:19:13Z", "updated_at": "2012-07-20T01:19:13Z", "deployment_url": "https://HOSTNAME/repos/octocat/example/deployments/42", "repository_url": "https://HOSTNAME/repos/octocat/example", "environment_url": "https://test-branch.lab.acme.com", "log_url": "https://example.com/deployment/42/output" }Get a deployment status
Users with pull access can view a deployment status for a deployment:
Parameters for "Get a deployment status"
| Headers | 
|---|
| Name, Type, Description | 
| acceptstringSetting to  | 
| Path parameters | 
| Name, Type, Description | 
| ownerstring RequiredThe account owner of the repository. The name is not case sensitive. | 
| repostring RequiredThe name of the repository without the  | 
| deployment_idinteger Requireddeployment_id parameter | 
| status_idinteger Required | 
HTTP response status codes for "Get a deployment status"
| Status code | Description | 
|---|---|
| 200 | OK | 
| 404 | Resource not found | 
Code samples for "Get a deployment status"
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/deployments/DEPLOYMENT_ID/statuses/STATUS_IDResponse
Status: 200{ "url": "https://HOSTNAME/repos/octocat/example/deployments/42/statuses/1", "id": 1, "node_id": "MDE2OkRlcGxveW1lbnRTdGF0dXMx", "state": "success", "creator": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://HOSTNAME/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://HOSTNAME/users/octocat/followers", "following_url": "https://HOSTNAME/users/octocat/following{/other_user}", "gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}", "starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions", "organizations_url": "https://HOSTNAME/users/octocat/orgs", "repos_url": "https://HOSTNAME/users/octocat/repos", "events_url": "https://HOSTNAME/users/octocat/events{/privacy}", "received_events_url": "https://HOSTNAME/users/octocat/received_events", "type": "User", "site_admin": false }, "description": "Deployment finished successfully.", "environment": "production", "target_url": "https://example.com/deployment/42/output", "created_at": "2012-07-20T01:19:13Z", "updated_at": "2012-07-20T01:19:13Z", "deployment_url": "https://HOSTNAME/repos/octocat/example/deployments/42", "repository_url": "https://HOSTNAME/repos/octocat/example", "environment_url": "https://test-branch.lab.acme.com", "log_url": "https://example.com/deployment/42/output" }