Use this API to manage external status checks.

Get list of project external status checks

GET /api/v4/projects/{id}/external_status_checks

Parameters

NameTypeDescription
page
Query
IntegerPage number of results to retrieve
Default: 1
Example: 1
per_page
Query
IntegerNumber of items to list per page
Default: 20
Example: 20
id
Path, required
String or integerID or URL-encoded path of the project

Responses

CodeDescriptionSchema
200OKArray of APIEntitiesExternalStatusCheck
400Bad Request—
404Not Found—

Create external status check

POST /api/v4/projects/{id}/external_status_checks

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project

Request body (application/json)

PropertyTypeDescription
branch_scope
Required
StringExternal status check branch scope
Allowed values: all_branches, all_protected_branches, protected_branch_specific
Minimum length: 1
external_url
Required
StringExternal status check resource url
Example: https://www.example.com
name
Required
StringExternal status check display name
Example: lorem ipsum
protected_branch_idsArray of integersIDs of protected branches
shared_secretStringHMAC shared secret
Example: hmac
timeout_minutesIntegerExternal status check timeout in minutes
Example: 5

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesExternalStatusCheck
400Bad Request—
404Not Found—

Update external status check by id

PUT /api/v4/projects/{id}/external_status_checks/{check_id}

Parameters

NameTypeDescription
check_id
Path, required
IntegerExternal status check ID
Example: 1
id
Path, required
String or integerID or URL-encoded path of the project

Request body (application/json)

PropertyTypeDescription
branch_scopeStringExternal status check branch scope. At least one of name, shared_secret, external_url, timeout_minutes, branch_scope, protected_branch_ids must be provided
Allowed values: all_branches, all_protected_branches, protected_branch_specific
external_urlStringExternal status check resource url. At least one of name, shared_secret, external_url, timeout_minutes, branch_scope, protected_branch_ids must be provided
Example: https://www.example.com
nameStringDisplay name of external status check. At least one of name, shared_secret, external_url, timeout_minutes, branch_scope, protected_branch_ids must be provided
Example: lorem ipsum
protected_branch_idsArray of integersIDs of protected branches to scope the rule by. At least one of name, shared_secret, external_url, timeout_minutes, branch_scope, protected_branch_ids must be provided
shared_secretStringHMAC shared secret. At least one of name, shared_secret, external_url, timeout_minutes, branch_scope, protected_branch_ids must be provided
Example: hmac
timeout_minutesIntegerExternal status check timeout in minutes. At least one of name, shared_secret, external_url, timeout_minutes, branch_scope, protected_branch_ids must be provided
Example: 5

Responses

CodeDescriptionSchema
200OKAPIEntitiesExternalStatusCheck
400Bad Request—
404Not Found—

Delete external status check

DELETE /api/v4/projects/{id}/external_status_checks/{check_id}

Parameters

NameTypeDescription
check_id
Path, required
IntegerID of an external status check
id
Path, required
String or integerID or URL-encoded path of the project

Responses

CodeDescriptionSchema
204No Content—
400Bad Request—
404Not Found—

Set status of an external status check

POST /api/v4/projects/{id}/merge_requests/{merge_request_iid}/status_check_responses

Parameters

NameTypeDescription
id
Path, required
StringID of a project
Example: 1
merge_request_iid
Path, required
IntegerIID of a merge request
Example: 1

Request body (application/json)

PropertyTypeDescription
external_status_check_id
Required
IntegerID of an external status check
Example: 1
sha
Required
StringSHA at HEAD of the source branch
Example: 5957a570eee0ac4580ec027fb874ad7514d1e576
status
Required
StringSet to passed to pass the check or failed to fail it
Allowed values: passed, failed
Minimum length: 1

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesMergeRequestsExternalStatusCheckResponse
400Bad Request—
404Not Found—

List status checks for a merge request

GET /api/v4/projects/{id}/merge_requests/{merge_request_iid}/status_checks

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project
merge_request_iid
Path, required
IntegerIID of a merge request
Example: 1

Responses

CodeDescriptionSchema
200OKArray of APIEntitiesMergeRequestsExternalStatusCheck
404Not Found—

Retry failed external status check

POST /api/v4/projects/{id}/merge_requests/{merge_request_iid}/status_checks/{external_status_check_id}/retry

Parameters

NameTypeDescription
id
Path, required
StringProject ID
Example: 1
merge_request_iid
Path, required
IntegerMerge Request IID
Example: 1
external_status_check_id
Path, required
IntegerFailed external status check ID

Responses

CodeDescriptionSchema
202Accepted—
400Bad Request—
404Not Found—

Schemas

Objects returned by the operations above and objects nested in their request bodies.

APIEntitiesCiPipeline

PropertyTypeDescription
archivedBooleanExample: false
before_shaStringExample: a91957a858320c0e17f3a0eca7cfacbff50ea29a
committed_atString (date-time)Example: 2015-12-24T15:51:21.880Z
coverageNumber (float)Example: 98.29
created_atString (date-time)Example: 2015-12-24T15:51:21.880Z
detailed_statusDetailedStatusEntity—
durationIntegerTime spent running in seconds
Example: 127
finished_atString (date-time)Example: 2015-12-24T17:54:31.198Z
idInteger (int64)ID of the pipeline
Example: 1
iidIntegerInternal ID of the pipeline
Example: 2
project_idInteger (int64)ID of the project of the pipeline
Example: 3
queued_durationIntegerTime spent enqueued in seconds
Example: 63
refStringGit reference of the pipeline
Example: feature-branch
shaStringSHA of the commit the pipeline runs for
Example: 0ec9e58fdfca6cdd6652c083c9edb53abc0bad52
sourceStringSource that triggered the pipeline
Example: push
started_atString (date-time)Example: 2015-12-24T17:54:30.733Z
statusStringStatus of the pipeline
Example: success
tagBooleanExample: false
updated_atString (date-time)Example: 2015-12-24T17:54:31.198Z
userAPIEntitiesUserBasic—
web_urlStringURL of the pipeline in the GitLab UI
Example: https://gitlab.example.com/gitlab-org/gitlab-foss/-/pipelines/61
yaml_errorsStringExample: widgets:build: needs 'widgets:test'

APIEntitiesCiPipelineBasic

PropertyTypeDescription
created_atString (date-time)Timestamp when the pipeline was created
Example: 2022-10-21T16:49:48.000+02:00
idInteger (int64)ID of the pipeline
Example: 1
iidIntegerInternal ID of the pipeline
Example: 2
project_idInteger (int64)ID of the project of the pipeline
Example: 3
refStringGit reference of the pipeline
Example: feature-branch
shaStringSHA of the commit the pipeline runs for
Example: 0ec9e58fdfca6cdd6652c083c9edb53abc0bad52
sourceStringSource that triggered the pipeline
Example: push
statusStringStatus of the pipeline
Example: success
updated_atString (date-time)Timestamp when the pipeline was last updated
Example: 2022-10-21T16:49:48.000+02:00
web_urlStringURL of the pipeline in the GitLab UI
Example: https://gitlab.example.com/gitlab-org/gitlab-foss/-/pipelines/61

APIEntitiesCustomAttribute

PropertyTypeDescription
keyStringExample: foo
valueStringExample: bar

APIEntitiesDiffRefs

PropertyTypeDescription
base_shaStringSHA of the merge base commit where the source and target branches diverged
Example: b83d6e391c22777fca1ed3012fce84f633d7fed0
head_shaStringSHA of the head commit of the source branch
Example: b83d6e391c22777fca1ed3012fce84f633d7fed0
start_shaStringSHA of the target branch commit the diff starts from. Usually the same as base_sha
Example: b83d6e391c22777fca1ed3012fce84f633d7fed0

APIEntitiesExternalStatusCheck

PropertyTypeDescription
branch_scopeStringExample: all_branches
external_urlStringExample: https://www.example.com
hmac?BooleanExample: true
idIntegerExample: 100
nameStringExample: lorem ipsum
project_idIntegerExample: 101
protected_branchesArray of APIEntitiesProtectedBranch—
timeout_minutesIntegerExample: 5

APIEntitiesIssuableReferences

PropertyTypeDescription
fullStringExample: test&6
relativeStringExample: &6
shortStringExample: &6

APIEntitiesIssuableTimeStats

PropertyTypeDescription
human_time_estimateStringExample: 3h 30m
human_total_time_spentStringExample: 1h
time_estimateIntegerExample: 12600
total_time_spentIntegerExample: 3600

APIEntitiesMergeRequest

PropertyTypeDescription
allow_collaborationBooleanIf true, the fork allows commits from members who can merge to the target branch. Returned only for merge requests from forks
allow_maintainer_to_pushBooleanReturned only for merge requests from forks. Deprecated. Use allow_collaboration instead
assigneeAPIEntitiesUserBasicFirst user assigned to the merge request. Deprecated. Use assignees instead
assigneesArray of APIEntitiesUserBasicUsers assigned to the merge request
authorAPIEntitiesMergeRequestAuthorUser who created the merge request
blocking_discussions_resolvedBooleanIf true, no unresolved threads block the merge. Always true if the project does not require all threads to be resolved before merge
changes_countStringNumber of changed files in the merge request, as a string. Empty when the merge request is created, and populates asynchronously. When the diff exceeds the file limit, the value is the limit followed by +, like "1000+"
Example: 1
closed_atString (date-time)Timestamp of when the merge request was closed
Example: 2022-01-31T15:10:45.080Z
closed_byAPIEntitiesUserBasicUser who closed the merge request. null if the merge request is not closed
created_atString (date-time)Example: 2022-08-17T12:46:35.053Z
descriptionStringExample: Repellendus impedit et vel velit dignissimos.
description_htmlStringDescription of the merge request rendered as HTML. Returned only if render_html is true
detailed_merge_statusStringDetailed merge status of the merge request. Accounts for every check that can block a merge. Can be approvals_syncing (approvals are syncing), checking (Git is testing whether a valid merge is possible), ci_must_pass (a CI/CD pipeline must succeed before merge), ci_still_running (a CI/CD pipeline is still running), commits_status (the source branch must exist and contain commits), conflict (conflicts exist between the source and target branches), discussions_not_resolved (all discussions must be resolved before merge), draft_status (the merge request is a draft), jira_association_missing (the title or description must reference a Jira issue), locked_lfs_files (LFS files locked by other users must be unlocked before merge), locked_paths (paths locked by other users must be unlocked before merging to the default branch), merge_request_blocked (blocked by another merge request), merge_time (cannot be merged until after the specified time), mergeable (the branch can merge cleanly into the target branch), need_rebase (the merge request must be rebased), not_approved (approval is required before merge), not_open (the merge request must be open before merge), preparing (the merge request diff is being created), requested_changes (reviewers have requested changes), security_policy_pipeline_check (when security policies are enforced, all pipelines for the latest commit must succeed before merge), security_policy_violations (all security policies must be satisfied), status_checks_must_pass (all status checks must pass before merge), title_regex (the title must match the regular expression set in the project settings), or unchecked (Git has not yet tested whether a valid merge is possible)
Example: mergeable
diff_refsAPIEntitiesDiffRefsBase, head, and start SHAs of the latest diff version of the merge request. Empty when the merge request is created, and populates asynchronously
discussion_lockedBooleanIf true, discussions are locked. Only project members can add, edit or resolve comments in locked discussions
diverged_commits_countIntegerNumber of commits the source branch is behind the target branch. Returned only if include_diverged_commits_count is true
Example: 0
downvotesIntegerNumber of downvotes for the merge request
draftBooleanIf true, the merge request is a draft
first_contributionBooleanIf true, the merge request is the author’s first contribution to the project
first_deployed_to_production_atString (date-time)Timestamp of when the first deployment to production finished
Example: 2022-01-31T15:10:45.080Z
force_remove_source_branchBooleanIf true, the source branch is forced to be deleted after merge
has_conflictsBooleanIf true, the merge request has conflicts and cannot merge. false unless merge_status is cannot_be_merged
head_pipelineAPIEntitiesCiPipelinePipeline that runs on the HEAD commit of the source branch. Use instead of pipeline, because it contains more information. Returned only if the current user can view pipelines for the project
idInteger (int64)Example: 84
iidIntegerExample: 14
importedBooleanIf true, the merge request was imported
imported_fromStringSource of the import, such as bitbucket
Example: bitbucket
labelsArray of stringsNames of the labels assigned to the merge request, sorted by name. If with_labels_details is true, an array of label objects with id, name, color, text_color, description, description_html and archived instead
latest_build_finished_atString (date-time)Timestamp of when the latest build for the merge request finished
Example: 2022-01-31T15:10:45.080Z
latest_build_started_atString (date-time)Timestamp of when the latest build for the merge request started
Example: 2022-01-31T15:10:45.080Z
merge_afterString (date-time)If set, timestamp after which the merge request can be merged. Introduced in GitLab 17.8
Example: 2022-01-31T15:10:45.080Z
merge_commit_shaStringSHA of the merge commit. null until the merge request is merged
Example: 1234abcd
merge_errorStringError message shown when a merge fails. To check mergeability, use detailed_merge_status instead
Example: Merge error
merge_statusStringStatus of the merge request. Can be unchecked, checking, can_be_merged, cannot_be_merged or cannot_be_merged_recheck. Affects has_conflicts. Deprecated. Use detailed_merge_status instead
Example: unchecked
merge_userAPIEntitiesUserBasicUser who merged the merge request or set it to auto-merge, or null
merge_when_pipeline_succeedsBooleanIf true, the merge request is set to auto-merge
merged_atString (date-time)Timestamp of when the merge request was merged
Example: 2022-01-31T15:10:45.080Z
merged_byAPIEntitiesUserBasicUser who merged the merge request or set it to auto-merge. Deprecated. Use merge_user instead
milestoneAPIEntitiesMilestoneMilestone assigned to the merge request
pipelineAPIEntitiesCiPipelineBasicPipeline running on the branch HEAD of the merge request. Use head_pipeline instead, because it contains more information
prepared_atString (date-time)Timestamp of when the merge request was prepared. Set one time, after the diff is created, pipeline creation and the mergeability check are started, Git LFS objects are linked, and notifications are sent. Not updated when more changes are added
Example: 2022-01-31T15:10:45.080Z
project_idInteger (int64)Example: 4
rebase_in_progressBooleanIf true, a rebase operation is in progress on the source branch. Returned only if include_rebase_in_progress is true
referenceStringInternal reference of the merge request, in short format. Deprecated. Use references instead
Example: !1
referencesAPIEntitiesIssuableReferencesInternal references of the merge request: short, relative and full. When fetched from the project of the merge request, relative matches short. When fetched from a project or group in another namespace, relative matches full
reviewersArray of APIEntitiesUserBasicReviewers of the merge request
shaStringSHA of the head commit of the source branch
Example: 1234abcd
should_remove_source_branchBooleanIf true, the source branch is deleted after merge
source_branchStringName of the source branch
source_project_idInteger (int64)ID of the source project. Equal to target_project_id, unless the merge request comes from a fork
squashBooleanIf true, squash commits when merging. Project squash settings can override this value. Use squash_on_merge to take them into account
squash_commit_shaStringSHA of the squash commit. Empty until the merge request is merged
Example: 1234abcd
squash_on_mergeBooleanIf true, commits are squashed on merge
stateStringExample: closed
subscribedBooleanIf true, the current user is subscribed to the merge request
target_branchStringName of the target branch
target_project_idInteger (int64)ID of the target project
task_completion_statusAPIEntitiesTaskCompletionStatusCompletion status of the task list: count and completed_count
time_statsAPIEntitiesIssuableTimeStatsTime tracking statistics of the merge request: time_estimate, total_time_spent, human_time_estimate and human_total_time_spent
titleStringExample: Impedit et ut et dolores vero provident ullam est
title_htmlStringTitle of the merge request rendered as HTML. Returned only if render_html is true
updated_atString (date-time)Example: 2022-11-14T17:22:01.470Z
upvotesIntegerNumber of upvotes for the merge request
userObjectPermissions of the current user for the merge request
user.can_mergeBooleanIf true, the current user can merge the merge request
user_notes_countIntegerNumber of user comments on the merge request
web_urlStringWeb URL of the merge request
Example: https://gitlab.example.com/my-group/my-project/-/merge_requests/1
work_in_progressBooleanIf true, the merge request is a draft. Deprecated. Use draft instead

APIEntitiesMergeRequestAuthor

PropertyTypeDescription
avatar_pathStringExample: /user/avatar/28/The-Big-Lebowski-400-400.png
avatar_urlStringURL of the user’s avatar
Example: https://gravatar.com/avatar/1
botBooleanIf true, the author is a bot
Example: false
custom_attributesArray of APIEntitiesCustomAttribute—
idInteger (int64)ID of the user
Example: 1
lockedBooleanIf true, the user account is locked, and the user cannot sign in until the lock expires or an administrator unlocks the account
nameStringName of the user. For a bot user, **** if the current user cannot read the bot’s project or group
Example: Administrator
public_emailStringPublic email address of the user
Example: john@example.com
stateStringState of the user account. Possible values: active, blocked, ldap_blocked, blocked_pending_approval, banned, or deactivated
Example: active
usernameStringUsername of the user
Example: admin
web_urlStringURL of the user’s profile
Example: https://gitlab.example.com/root

APIEntitiesMergeRequestsExternalStatusCheck

PropertyTypeDescription
error_reasonStringExample: Timeout error
external_urlStringExample: https://www.test.com
idIntegerExample: 1
nameStringExample: Security
statusStringExample: pending

APIEntitiesMergeRequestsExternalStatusCheckResponse

PropertyTypeDescription
external_status_checkAPIEntitiesExternalStatusCheck—
idIntegerExample: 1
merge_requestAPIEntitiesMergeRequest—

APIEntitiesMilestone

PropertyTypeDescription
created_atString—
descriptionString—
due_dateString—
expiredBoolean—
group_idString—
idInteger (int64)—
iidInteger (int64)—
project_idInteger (int64)—
start_dateString—
stateString—
titleString—
updated_atString—
web_urlString—

APIEntitiesProtectedBranch

PropertyTypeDescription
allow_force_pushBooleanIf true, force push is allowed on the branch
code_owner_approval_requiredBoolean—
idInteger (int64)ID of the protected branch
Example: 1
merge_access_levelsArray of APIEntitiesProtectedRefAccessArray of merge access level configurations
nameStringName of the protected branch
Example: main
push_access_levelsArray of APIEntitiesProtectedRefAccessArray of push access level configurations

APIEntitiesProtectedRefAccess

PropertyTypeDescription
access_levelIntegerExample: 40
access_level_descriptionStringHuman-readable description of the access level
Example: Maintainers
deploy_key_idInteger (int64)ID of the deploy key with access
Example: 1
group_idIntegerExample: 1
idInteger (int64)ID of the access level configuration
Example: 1
user_idIntegerExample: 1

APIEntitiesTaskCompletionStatus

PropertyTypeDescription
completed_countIntegerExample: 3
countIntegerExample: 5

APIEntitiesUserBasic

PropertyTypeDescription
avatar_pathStringExample: /user/avatar/28/The-Big-Lebowski-400-400.png
avatar_urlStringURL of the user’s avatar
Example: https://gravatar.com/avatar/1
custom_attributesArray of APIEntitiesCustomAttribute—
idInteger (int64)ID of the user
Example: 1
lockedBooleanIf true, the user account is locked, and the user cannot sign in until the lock expires or an administrator unlocks the account
nameStringName of the user. For a bot user, **** if the current user cannot read the bot’s project or group
Example: Administrator
public_emailStringPublic email address of the user
Example: john@example.com
stateStringState of the user account. Possible values: active, blocked, ldap_blocked, blocked_pending_approval, banned, or deactivated
Example: active
usernameStringUsername of the user
Example: admin
web_urlStringURL of the user’s profile
Example: https://gitlab.example.com/root

DetailedStatusEntity

PropertyTypeDescription
actionObject—
action.button_titleStringExample: Cancel this job
action.confirmation_messageStringExample: Are you sure?
action.iconStringExample: cancel
action.methodStringExample: post
action.pathStringExample: /namespace1/project1/-/jobs/2/cancel
action.titleStringExample: Cancel
details_pathStringExample: /test-group/test-project/-/pipelines/287
faviconStringExample: /assets/ci_favicons/favicon_status_success.png
groupStringExample: success
has_detailsBooleanExample: true
iconStringExample: status_success
illustrationObjectExample: {"content":"This job depends on upstream jobs that need to succeed in order for this job to be triggered","image":"illustrations/empty-state/empty-job-not-triggered-md.svg","size":"","title":"This job has not been triggered yet"}
labelStringExample: passed
textStringExample: passed
tooltipStringExample: passed