Skip to content

Create or update a commit pipeline status

POST
/api/v4/projects/{id}/statuses/{sha}

Creates or updates the status of a commit represented by a job in an external stage. If the commit is associated with a merge request, target the commit in the merge request source branch.

id
required
One of:
string

ID or URL-encoded path of the project.

sha
required
string

The commit hash

Example
18f3e63d05582537db6d183d9d557be09e1f90c8
Media type application/json
object
state
required

The state of the status

string
>= 1 characters
Allowed values: pending running success failed canceled skipped
ref

The ref

string
nullable
Example
develop
target_url

The target URL to associate with this status

string
nullable
Example
https://gitlab.example.com/janedoe/gitlab-foss/builds/91
description

A short description of the status

string
nullable
name

A string label to differentiate this status from the status of other systems

string
nullable
Example
coverage
context

A string label to differentiate this status from the status of other systems

string
nullable
Example
coverage
coverage

The total code coverage

number
nullable
Example
100
pipeline_id

An existing pipeline ID, when multiple pipelines on the same commit SHA have been triggered

integer
nullable

OK

Media type application/json
object
id
integer format: int64
sha
string
ref
string
status
string
name
string
target_url
string
description
string
created_at
string format: date-time
started_at
string format: date-time
finished_at
string format: date-time
allow_failure
boolean
coverage
number format: float
pipeline_id
integer format: int64
author
object
id
integer format: int64
username
string
public_email
string
name
string
state
string
locked
boolean
avatar_url
string
avatar_path
string
custom_attributes
Array<object>
object
key
string
value
string
web_url
string
Example
{
"id": 93,
"sha": "18f3e63d05582537db6d183d9d557be09e1f90c8",
"ref": "develop",
"status": "success",
"name": "default",
"target_url": "https://gitlab.example.com/janedoe/gitlab-foss/builds/91",
"created_at": "2016-01-19T09:05:50.355Z",
"started_at": "2016-01-20T08:40:25.832Z",
"finished_at": "2016-01-21T08:40:25.832Z",
"allow_failure": false,
"coverage": 98.29,
"pipeline_id": 101,
"author": {
"id": 1,
"username": "admin",
"public_email": "john@example.com",
"name": "Administrator",
"state": "active",
"avatar_url": "https://gravatar.com/avatar/1",
"avatar_path": "/user/avatar/28/The-Big-Lebowski-400-400.png",
"custom_attributes": [
{
"key": "foo",
"value": "bar"
}
],
"web_url": "https://gitlab.example.com/root"
}
}

Bad request

Unauthorized

Forbidden

Not found

Another update to this commit status is in progress