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

Create a commit status

Creates a commit status for a specific commit in a repository. You need push access to the repository, and state must be one of the supported values; each sha and context pair is limited to 1,000 statuses.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

3 parameters · 4 body fields
ownerstringrequired
The account that owns the repository; the name is not case-sensitive.
repostringrequired
The repository name without the `.git` extension; the name is not case-sensitive.
shastringrequired
The commit SHA to associate with the status.

Commit status details. state is required.

statestringrequired
The state of the status.
Allowed:errorfailurependingsuccess
target_urlstringoptional
The target URL to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the source of the status. For example, if your continuous integration system is posting build status, you would want to provide the deep link for the build output for this specific SHA: `http://ci.example.com/user/repo/build/sha`
descriptionstringoptional
A short description of the status.
contextstringoptional
A string label to differentiate this status from the status of other systems. This field is case-insensitive.
Default:default

1 status code
201Returns the created commit status, including its state, description, target URL, context, timestamps, and creator.
urlstringrequired
avatar_urlstringrequired
idintegerrequired
node_idstringrequired
statestringrequired
descriptionstringrequired
target_urlstringrequired
contextstringrequired
created_atstringrequired
updated_atstringrequired
creatorobjectrequired
A GitHub user.

Error handling

state is required and must be one of: error, failure, pending, or success. A sha and context pair can have no more than 1,000 statuses in the repository.