---
title: "Create a commit status"
method: POST
path: "/repos/{owner}/{repo}/statuses/{sha}"
tags: ["repository"]
---

# Create a commit status

`POST /repos/{owner}/{repo}/statuses/{sha}`

## Path parameters

- `owner` string, required
- `repo` string, required
- `sha` string, required

## Request body

- CreateStatusOption — CreateStatusOption holds the information needed to create a new CommitStatus for a Commit
  - `context` string — Context is the unique context identifier for the status
  - `description` string — Description provides a brief description of the status
  - `state` 'pending' | 'success' | 'error' | 'failure' | 'warning' | 'skipped' — State represents the status state to set (pending, success, error, failure)
  - `target_url` string — TargetURL is the URL to link to for more details

## Response `201`

CommitStatus

- CommitStatus — CommitStatus holds a single status of a single Commit
  - `context` string — Context is the unique context identifier for the status
  - `created_at` string, date-time
  - `creator` User — User represents a user
    - `active` boolean — Is user active
    - `avatar_url` string — URL to the user's avatar
    - `created` string, date-time
    - `description` string — the user's description
    - `email` string, email
    - `followers_count` integer — user counts
    - `following_count` integer
    - `full_name` string — the user's full name
    - `html_url` string — URL to the user's gitea page
    - `id` integer — the user's id
    - `is_admin` boolean — Is the user an administrator
    - `language` string — User locale
    - `last_login` string, date-time
    - `location` string — the user's location
    - `login` string — login of the user, same as `username`
    - `login_name` string — identifier of the user, provided by the external authenticator (if configured)
    - `prohibit_login` boolean — Is user login prohibited
    - `restricted` boolean — Is user restricted
    - `source_id` integer — The ID of the user's Authentication Source
    - `starred_repos_count` integer
    - `visibility` 'public' | 'limited' | 'private' — User visibility level option: public, limited, private
    - `website` string — the user's website
  - `description` string — Description provides a brief description of the status
  - `id` integer — ID is the unique identifier for the commit status
  - `status` 'pending' | 'success' | 'error' | 'failure' | 'warning' | 'skipped' — State represents the status state (pending, success, error, failure)
  - `target_url` string — TargetURL is the URL to link to for more details
  - `updated_at` string, date-time
  - `url` string — URL is the API URL for this status

## Other responses

- `400` — APIError is error format response
- `404` — APINotFound is a not found empty response

---

[API](https://skmtc.net/gitea/apis/gitea-api.md) · [All operations](https://skmtc.net/gitea/apis/gitea-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gitea/gitea-api/revisions/350de506cefa/schema)
