v56

latestOpenAPI 3.0.3MITraw.githubusercontent.com2026-08-011,4581,08113.3 MB
repos

Create a deployment status

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

OAuth app tokens and personal access tokens (classic) need the repo_deployment scope to use this endpoint.

post/repos/{owner}/{repo}/deployments/{deployment_id}/statuses

Path parameters

ownerstring required

The account owner of the repository. The name is not case sensitive.

repostring required

The name of the repository without the .git extension. The name is not case sensitive.

deployment_idinteger required

deployment_id parameter

Request body

state'error' | 'failure' | 'inactive' | 'in_progress' | 'queued' | 'pending' | 'success' required

The state of the status. When you set a transient deployment to inactive, the deployment will be shown as destroyed in GitHub.

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.

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: ""

descriptionstring

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

environmentstring

Name for the target deployment environment, which can be changed when setting a deploy status. For example, production, staging, or qa. If not defined, the environment of the previous status on the deployment will be used, if it exists. Otherwise, the environment of the deployment will be used.

environment_urlstring

Sets the URL for accessing your environment. 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

Response

Response

urlstring uri required
idinteger required
node_idstring required
state'error' | 'failure' | 'inactive' | 'pending' | 'success' | 'queued' | 'in_progress' required

The state of the status.

descriptionstring required

A short description of the status.

environmentstring

The environment of the deployment that the status is for.

target_urlstring uri required

Closing down notice: the URL to associate with this status.

created_atstring date-time required
updated_atstring date-time required
deployment_urlstring uri required
repository_urlstring uri required
environment_urlstring uri

The URL for accessing your environment.

log_urlstring uri

The URL to associate with this status.

Example response

{
  "url": "https://api.github.com/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": "41d064eb2195891e12d0413f63227ea7",
    "url": "https://api.github.com/users/octocat",
    "html_url": "https://github.com/octocat",
    "followers_url": "https://api.github.com/users/octocat/followers",
    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    "organizations_url": "https://api.github.com/users/octocat/orgs",
    "repos_url": "https://api.github.com/users/octocat/repos",
    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    "received_events_url": "https://api.github.com/users/octocat/received_events",
    "type": "User",
    "starred_at": "\"2020-07-09T00:17:55Z\"",
    "user_view_type": "public"
  },
  "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://api.github.com/repos/octocat/example/deployments/42",
  "repository_url": "https://api.github.com/repos/octocat/example",
  "environment_url": "https://staging.example.com/",
  "log_url": "https://example.com/deployment/42/output",
  "performed_via_github_app": {
    "id": 37,
    "slug": "probot-owners",
    "node_id": "MDExOkludGVncmF0aW9uMQ==",
    "client_id": "\"Iv1.25b5d1e65ffc4022\"",
    "owner": {
      "login": "octocat",
      "id": 1,
      "node_id": "MDQ6VXNlcjE=",
      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
      "gravatar_id": "41d064eb2195891e12d0413f63227ea7",
      "url": "https://api.github.com/users/octocat",
      "html_url": "https://github.com/octocat",
      "followers_url": "https://api.github.com/users/octocat/followers",
      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
      "organizations_url": "https://api.github.com/users/octocat/orgs",
      "repos_url": "https://api.github.com/users/octocat/repos",
      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
      "received_events_url": "https://api.github.com/users/octocat/received_events",
      "type": "User",
      "starred_at": "\"2020-07-09T00:17:55Z\"",
      "user_view_type": "public"
    },
    "name": "Probot Owners",
    "description": "The description of the app.",
    "external_url": "https://example.com",
    "html_url": "https://github.com/apps/super-ci",
    "created_at": "2017-07-08T16:18:44-04:00",
    "updated_at": "2017-07-08T16:18:44-04:00",
    "permissions": {
      "issues": "read",
      "deployments": "write"
    },
    "events": [
      "label",
      "deployment"
    ],
    "installations_count": 5
  }
}