Use this API to interact with resource groups.

List all resource groups

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

Lists all resource groups for a specified project.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project owned by the authenticated user
page
Query
IntegerCurrent page number
Default: 1
Example: 1
per_page
Query
IntegerNumber of items per page
Default: 20
Example: 20

Responses

CodeDescriptionSchema
200OKAPIEntitiesCiResourceGroup
400Bad Request—
401Unauthorized—
404Not found—

Retrieve a resource group

GET /api/v4/projects/{id}/resource_groups/{key}

Retrieves a specified resource group for a project.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project owned by the authenticated user
key
Path, required
StringThe key of the resource group

Responses

CodeDescriptionSchema
200OKAPIEntitiesCiResourceGroup
400Bad Request—
401Unauthorized—
404Not found—

Update a resource group

PUT /api/v4/projects/{id}/resource_groups/{key}

Updates the properties for a specified resource group. It returns 200 if the resource group was successfully updated. In case of an error, a status code 400 is returned.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project owned by the authenticated user
key
Path, required
StringThe key of the resource group

Request body (application/json)

PropertyTypeDescription
process_modeStringThe process mode of the resource group
Allowed values: unordered, oldest_first, newest_first, newest_ready_first

Responses

CodeDescriptionSchema
200OKAPIEntitiesCiResourceGroup
400Bad request—
401Unauthorized—
404Not found—

Retrieve current job for a resource group

GET /api/v4/projects/{id}/resource_groups/{key}/current_job

Retrieves the current job for a specified resource group in a project.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project owned by the authenticated user
key
Path, required
StringThe key of the resource group

Responses

CodeDescriptionSchema
200OKAPIEntitiesCiJobBasic
400Bad Request—
401Unauthorized—
404Not found—

List all upcoming jobs for a resource group

GET /api/v4/projects/{id}/resource_groups/{key}/upcoming_jobs

Lists all upcoming jobs for a specified resource group.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project owned by the authenticated user
key
Path, required
StringThe key of the resource group
page
Query
IntegerCurrent page number
Default: 1
Example: 1
per_page
Query
IntegerNumber of items per page
Default: 20
Example: 20

Responses

CodeDescriptionSchema
200OKAPIEntitiesCiJobBasic
400Bad Request—
401Unauthorized—
404Not found—

Schemas

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

APIEntitiesCiJobBasic

PropertyTypeDescription
allow_failureBoolean—
commitAPIEntitiesCommit—
coverageNumber (float)Example: 98.29
created_atString (date-time)Example: 2015-12-24T15:51:21.880Z
durationNumber (float)Time spent running
Example: 0.465
erased_atString (date-time)Example: 2015-12-24T18:00:29.728Z
failure_reasonStringExample: script_failure
finished_atString (date-time)Example: 2015-12-24T17:54:31.198Z
idInteger (int64)Example: 1
nameStringExample: deploy_to_production
pipelineAPIEntitiesCiPipelineBasic—
projectObject—
project.ci_job_token_scope_enabledStringExample: false
queued_durationNumber (float)Time spent enqueued
Example: 0.123
refStringExample: main
stageStringExample: deploy
started_atString (date-time)Example: 2015-12-24T17:54:30.733Z
statusStringExample: waiting_for_resource
tagBoolean—
userAPIEntitiesUser—
web_urlStringExample: https://example.com/foo/bar/-/jobs/1

APIEntitiesCiPipelineBasic

PropertyTypeDescription
created_atString (date-time)Example: 2022-10-21T16:49:48.000+02:00
idInteger (int64)Example: 1
iidIntegerExample: 2
project_idInteger (int64)Example: 3
refStringExample: feature-branch
shaStringExample: 0ec9e58fdfca6cdd6652c083c9edb53abc0bad52
sourceStringExample: push
statusStringExample: success
updated_atString (date-time)Example: 2022-10-21T16:49:48.000+02:00
web_urlStringExample: https://gitlab.example.com/gitlab-org/gitlab-foss/-/pipelines/61

APIEntitiesCiResourceGroup

PropertyTypeDescription
created_atString (date-time)Example: 2021-09-01T08:04:59.650Z
idInteger (int64)Example: 1
keyStringExample: production
process_modeStringExample: unordered
updated_atString (date-time)Example: 2021-09-01T08:04:59.650Z

APIEntitiesCommit

PropertyTypeDescription
author_emailStringExample: john@example.com
author_nameStringExample: John Smith
authored_dateString (date-time)Example: 2012-05-28T04:42:42-07:00
committed_dateString (date-time)Example: 2012-05-28T04:42:42-07:00
committer_emailStringExample: jack@example.com
committer_nameStringExample: Jack Smith
created_atString (date-time)Example: 2017-07-26T11:08:53.000+02:00
extended_trailersObjectExample: {"Signed-off-by":["John Doe \u003cjohndoe@gitlab.com\u003e","Jane Doe \u003cjanedoe@gitlab.com\u003e"]}
idStringExample: 2695effb5807a22ff3d138d593fd856244e155e7
messageStringExample: Initial commit
parent_idsArray of stringsExample: ["2a4b78934375d7f53875269ffd4f45fd83a84ebe"]
short_idStringExample: 2695effb
titleStringExample: Initial commit
trailersObjectExample: {"Merged-By":"Jane Doe janedoe@gitlab.com"}
web_urlStringExample: https://gitlab.example.com/janedoe/gitlab-foss/-/commit/ed899a2f4b50b4370feeea94676502b42383c746

APIEntitiesCustomAttribute

PropertyTypeDescription
keyStringExample: foo
valueStringExample: bar

APIEntitiesUser

PropertyTypeDescription
avatar_pathStringExample: /user/avatar/28/The-Big-Lebowski-400-400.png
avatar_urlStringExample: https://gravatar.com/avatar/1
bioString—
botBoolean—
created_atString—
custom_attributesArray of APIEntitiesCustomAttribute—
discordString—
followersString—
followingString—
githubString—
idInteger (int64)Example: 1
is_followedString—
job_titleString—
linkedinString—
local_timeString—
locationString—
lockedBoolean—
nameStringExample: Administrator
organizationString—
pronounsString—
public_emailStringExample: john@example.com
stateStringExample: active
twitterString—
usernameStringExample: admin
web_urlStringExample: https://gitlab.example.com/root
website_urlString—
work_informationString—