---
title: "Create a deployment status"
method: POST
path: "/repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
tags: ["repos"]
---

# Create a deployment status

`POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses`

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.

## Path parameters

- `owner` string, required
- `repo` string, required
- `deployment_id` integer, required

## Request body

- object
  - `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_url` string — 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_url` string — 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: `""`
  - `description` string — A short description of the status. The maximum description length is 140 characters.
  - `environment` 'production' | 'staging' | 'qa' — Name for the target deployment environment, which can be changed when setting a deploy status. For example, `production`, `staging`, or `qa`.
  - `environment_url` string — Sets the URL for accessing your environment. Default: `""`
  - `auto_inactive` boolean — 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 `201`

Response

- DeploymentStatus — The status of a deployment.
  - `url` string, uri, required
  - `id` integer, required
  - `node_id` string, required
  - `state` 'error' | 'failure' | 'inactive' | 'pending' | 'success' | 'queued' | 'in_progress', required — The state of the status.
  - `creator` NullableSimpleUser, nullable, required — A GitHub user.
    - `name` string, nullable
    - `email` string, nullable
    - `login` string, required
    - `id` integer, required
    - `node_id` string, required
    - `avatar_url` string, uri, required
    - `gravatar_id` string, nullable, required
    - `url` string, uri, required
    - `html_url` string, uri, required
    - `followers_url` string, uri, required
    - `following_url` string, required
    - `gists_url` string, required
    - `starred_url` string, required
    - `subscriptions_url` string, uri, required
    - `organizations_url` string, uri, required
    - `repos_url` string, uri, required
    - `events_url` string, required
    - `received_events_url` string, uri, required
    - `type` string, required
    - `site_admin` boolean, required
    - `starred_at` string
  - `description` string, required — A short description of the status.
  - `environment` string — The environment of the deployment that the status is for.
  - `target_url` string, uri, required — Deprecated: the URL to associate with this status.
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `deployment_url` string, uri, required
  - `repository_url` string, uri, required
  - `environment_url` string, uri — The URL for accessing your environment.
  - `log_url` string, uri — The URL to associate with this status.
  - `performed_via_github_app` NullableIntegration, nullable — 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.
    - `id` integer, required — Unique identifier of the GitHub app
    - `slug` string — The slug name of the GitHub app
    - `node_id` string, required
    - `owner` NullableSimpleUser, nullable, required — A GitHub user.
      - `name` string, nullable
      - `email` string, nullable
      - `login` string, required
      - `id` integer, required
      - `node_id` string, required
      - `avatar_url` string, uri, required
      - `gravatar_id` string, nullable, required
      - `url` string, uri, required
      - `html_url` string, uri, required
      - `followers_url` string, uri, required
      - `following_url` string, required
      - `gists_url` string, required
      - `starred_url` string, required
      - `subscriptions_url` string, uri, required
      - `organizations_url` string, uri, required
      - `repos_url` string, uri, required
      - `events_url` string, required
      - `received_events_url` string, uri, required
      - `type` string, required
      - `site_admin` boolean, required
      - `starred_at` string
    - `name` string, required — The name of the GitHub app
    - `description` string, nullable, required
    - `external_url` string, uri, required
    - `html_url` string, uri, required
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required
    - `permissions` object, required — The set of permissions for the GitHub app
      - `issues` string
      - `checks` string
      - `metadata` string
      - `contents` string
      - `deployments` string
    - `events` string[], required — The list of events for the GitHub app
    - `installations_count` integer — The number of installations associated with the GitHub app
    - `client_id` string
    - `client_secret` string
    - `webhook_secret` string, nullable
    - `pem` string

## Other responses

- `422` — Validation failed, or the endpoint has been spammed.

---

[API](https://skmtc.net/github/apis/github-v3-rest-api-4.md) · [All operations](https://skmtc.net/github/apis/github-v3-rest-api-4/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/github-v3-rest-api-4/versions/ee6c7a46328e/schema)
