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 integerID or URL-encoded path of the project
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

Responses

CodeDescriptionSchema
200OKArray of APIEntitiesCiResourceGroup
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 integerID or URL-encoded path of the project
key
Path, required
StringURL-encoded key of the resource group, for example resource%5Fa instead of resource_a

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 integerID or URL-encoded path of the project
key
Path, required
StringURL-encoded key of the resource group, for example resource%5Fa instead of resource_a

Request body (application/json)

PropertyTypeDescription
process_modeStringProcess mode of the resource group. Read process modes for more information
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. This feature was introduced in GitLab 18.6.

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project
key
Path, required
StringURL-encoded key of the resource group, for example resource%5Fa instead of resource_a

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 integerID or URL-encoded path of the project
key
Path, required
StringURL-encoded key of the resource group, for example resource%5Fa instead of resource_a
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

Responses

CodeDescriptionSchema
200OKArray of APIEntitiesCiJobBasic
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)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

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_emailStringEmail address of the commit author
Example: john@example.com
author_nameStringName of the commit author
Example: John Smith
authored_dateString (date-time)Date and time when the commit was authored
Example: 2012-05-28T04:42:42-07:00
committed_dateString (date-time)Date and time when the commit was committed
Example: 2012-05-28T04:42:42-07:00
committer_emailStringEmail address of the committer
Example: jack@example.com
committer_nameStringName of the committer
Example: Jack Smith
created_atString (date-time)Date and time when the commit was created. Identical to committed_date
Example: 2017-07-26T11:08:53.000+02:00
extended_trailersObjectGit trailers parsed from the commit message, with every value for each key
Example: {"Signed-off-by":["John Doe \u003cjohndoe@gitlab.com\u003e","Jane Doe \u003cjanedoe@gitlab.com\u003e"]}
idStringFull SHA of the commit
Example: 2695effb5807a22ff3d138d593fd856244e155e7
messageStringFull commit message
Example: Initial commit
parent_idsArray of stringsSHAs of the parent commits
Example: ["2a4b78934375d7f53875269ffd4f45fd83a84ebe"]
short_idStringShort SHA of the commit
Example: 2695effb
titleStringTitle of the commit message
Example: Initial commit
trailersObjectGit trailers parsed from the commit message. Duplicate keys include the last value only
Example: {"Merged-By":"Jane Doe janedoe@gitlab.com"}
web_urlStringURL to view the commit in the GitLab UI
Example: 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_urlStringURL of the user’s avatar
Example: https://gravatar.com/avatar/1
bioStringBiography of the user
botBoolean—
created_atString (date-time)Creation date and time of the user account in ISO 8601 format
custom_attributesArray of APIEntitiesCustomAttribute—
discordStringDiscord user ID of the user
followersString—
followingString—
githubStringGitHub username of the user
idInteger (int64)ID of the user
Example: 1
is_followedString—
job_titleStringJob title of the user
linkedinStringLinkedIn username of the user
local_timeString—
locationStringLocation of the user
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
organizationStringOrganization of the user
pronounsStringPronouns of the user
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
twitterStringTwitter username of the user
usernameStringUsername of the user
Example: admin
web_urlStringURL of the user’s profile
Example: https://gitlab.example.com/root
website_urlStringWebsite of the user
work_informationString—