Use this API to interact with CI/CD jobs.
Retrieve a job by job token
GET /api/v4/job
Retrieves a job that was generated by a specified job token. The request must run as part of the script section of a CI/CD job.
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad request | — |
401 | Unauthorized | — |
404 | Not found | — |
List all jobs for a project
GET /api/v4/projects/{id}/jobs
Lists all jobs for a specified project. By default, this request returns 20 results at a time because the API results are paginated. This endpoint supports offset-based and keyset-based pagination. Keyset-based pagination is recommended when requesting consecutive pages of results. Jobs are returned by ID in descending order.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
scopeQuery | Array of strings | Filter jobs by status. Example: ["pending", |
refQuery | String | Branch name (ref) to filter jobs by Example: feature- |
pageQuery | Integer | Page number of results to retrieve Default: 1Example: 1 |
per_Query | Integer | Number of items to list per page Default: 20Example: 20 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | Array of APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
Retrieve a job
GET /api/v4/projects/{id}/jobs/{job_id}
Retrieves a job with the specified job ID.
Parameters
| Name | Type | Description |
|---|---|---|
job_Path, | Integer | ID of the job Example: 88 |
idPath, | String or integer | ID or URL- |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
Cancel a job
POST /api/v4/projects/{id}/jobs/{job_id}/cancel
Cancels a specified job in a project. If the job cancellation rate limit is exceeded, returns 429 Too Many Requests with a Retry-After header.
Parameters
| Name | Type | Description |
|---|---|---|
job_Path, | Integer | ID of the job Example: 88 |
idPath, | String or integer | ID or URL- |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
force | Boolean | If true,canceling stateExample: true |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
429 | Too Many Requests | — |
Erase a job
POST /api/v4/projects/{id}/jobs/{job_id}/erase
Erases a specified job in a project. This removes job artifacts and the job log. If the job erasure rate limit is exceeded, returns 429 Too Many Requests with a Retry-After header.
Parameters
| Name | Type | Description |
|---|---|---|
job_Path, | Integer | ID of the job Example: 88 |
idPath, | String or integer | ID or URL- |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
409 | Conflict | — |
429 | Too Many Requests | — |
Run a job
POST /api/v4/projects/{id}/jobs/{job_id}/play
Runs a specified job. For a job in manual status, triggers an action to start the job. If the manual job run rate limit is exceeded, returns 429 Too Many Requests with a Retry-After header.
Parameters
| Name | Type | Description |
|---|---|---|
job_Path, | Integer | ID of the job Example: 88 |
idPath, | String or integer | ID or URL- |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
job_ | Object | Hash of job input values to use when playing the job. Example: {"environment": |
job_ | Array of objects | User- |
job_Required | String | Name of the variable Example: foo |
job_Required | String | Value of the variable Example: bar |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
429 | Too Many Requests | — |
Retry a job
POST /api/v4/projects/{id}/jobs/{job_id}/retry
Retries a specified job in a project. Retries both CI/CD jobs and trigger jobs. If the job retry rate limit is exceeded, returns 429 Too Many Requests with a Retry-After header.
Parameters
| Name | Type | Description |
|---|---|---|
job_Path, | Integer | ID of the job Example: 88 |
idPath, | String or integer | ID or URL- |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
inputs | Object | Input values for the job. Example: {"environment": |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
429 | Too Many Requests | — |
Get a trace of a specific job of a project
GET /api/v4/projects/{id}/jobs/{job_id}/trace
Retrieves a log file for a job.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
job_Path, | Integer | ID of the job Example: 88 |
byte_Query | Integer | Byte offset to start reading the trace from Minimum: 0Example: 0 |
byte_Query | Integer | Maximum number of bytes to return Maximum: 512000Minimum: 1Example: 51200 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
Schemas
Objects returned by the operations above and objects nested in their request bodies.
APIEntitiesCiJob
| Property | Type | Description |
|---|---|---|
allow_ | Boolean | — |
archived | Boolean | Example:false |
artifacts | Array of APIEntities | — |
artifacts_ | String (date- | Example:2016- |
artifacts_ | APIEntities | — |
commit | APIEntities | — |
coverage | Number (float) | Example:98. |
created_ | String (date- | Example:2015- |
duration | Number (float) | Time spent running Example: 0. |
erased_ | String (date- | Example:2015- |
failure_ | String | Example:script_ |
finished_ | String (date- | Example:2015- |
id | Integer (int64) | Example:1 |
name | String | Example:deploy_ |
pipeline | APIEntities | — |
project | Object | — |
project. | String | Example:false |
queued_ | Number (float) | Time spent enqueued Example: 0. |
ref | String | Example:main |
runner | APIEntities | — |
runner_ | APIEntities | — |
stage | String | Example:deploy |
started_ | String (date- | Example:2015- |
status | String | Example:waiting_ |
tag | Boolean | — |
tag_ | Array of strings | Example:["ubuntu18", |
user | APIEntities | — |
web_ | String | Example:https: |
APIEntitiesCiJobArtifact
| Property | Type | Description |
|---|---|---|
file_ | String | Allowed values:raw,zip,gzipExample: zip |
file_ | String | Allowed values:archive,metadata,trace,junit,sast,dependency_,container_,dast,codequality,license_,performance,metrics,metrics_,network_,lsif,dotenv,cobertura,terraform,accessibility,cluster_,secret_,requirements,coverage_,browser_,load_,api_,cluster_,cyclonedx,requirements_,annotations,repository_,jacoco,sarifExample: archive |
filename | String | Example:artifacts. |
size | Integer | Example:1000 |
APIEntitiesCiJobArtifactFile
| Property | Type | Description |
|---|---|---|
filename | String | Example:artifacts. |
size | Integer | Example:1000 |
APIEntitiesCiJobBasic
| Property | Type | Description |
|---|---|---|
allow_ | Boolean | — |
commit | APIEntities | — |
coverage | Number (float) | Example:98. |
created_ | String (date- | Example:2015- |
duration | Number (float) | Time spent running Example: 0. |
erased_ | String (date- | Example:2015- |
failure_ | String | Example:script_ |
finished_ | String (date- | Example:2015- |
id | Integer (int64) | Example:1 |
name | String | Example:deploy_ |
pipeline | APIEntities | — |
project | Object | — |
project. | String | Example:false |
queued_ | Number (float) | Time spent enqueued Example: 0. |
ref | String | Example:main |
stage | String | Example:deploy |
started_ | String (date- | Example:2015- |
status | String | Example:waiting_ |
tag | Boolean | — |
user | APIEntities | — |
web_ | String | Example:https: |
APIEntitiesCiPipelineBasic
| Property | Type | Description |
|---|---|---|
created_ | String (date- | Timestamp when the pipeline was created Example: 2022- |
id | Integer (int64) | ID of the pipeline Example: 1 |
iid | Integer | Internal ID of the pipeline Example: 2 |
project_ | Integer (int64) | ID of the project of the pipeline Example: 3 |
ref | String | Git reference of the pipeline Example: feature- |
sha | String | SHA of the commit the pipeline runs for Example: 0ec9e58fdfca6cdd6652 |
source | String | Source that triggered the pipeline Example: push |
status | String | Status of the pipeline Example: success |
updated_ | String (date- | Timestamp when the pipeline was last updated Example: 2022- |
web_ | String | URL of the pipeline in the Git Example: https: |
APIEntitiesCiRunner
| Property | Type | Description |
|---|---|---|
active | Boolean | If true,paused insteadExample: true |
created_ | String (date- | Example:2025- |
created_ | APIEntities | — |
description | String | Example:test- |
id | Integer (int64) | Example:8 |
ip_ | String | Always null.Example: 127. |
is_ | Boolean | Example:true |
job_ | String | Allowed values:active,idleExample: idle |
name | String | Example:test |
online | Boolean | Example:true |
paused | Boolean | Example:false |
runner_ | String | Allowed values:instance_,group_,project_Example: instance_ |
status | String | Example:online |
APIEntitiesCiRunnerManager
| Property | Type | Description |
|---|---|---|
architecture | String | Example:amd64 |
contacted_ | String | Example:2023- |
created_ | String | Example:2023- |
id | Integer (int64) | Example:8 |
ip_ | String | Example:127. |
job_ | String | Allowed values:active,idleExample: idle |
platform | String | Example:linux |
revision | String | Example:91a27b2a |
status | String | Example:online |
system_ | String | Example:runner- |
version | String | Example:16. |
APIEntitiesCommit
| Property | Type | Description |
|---|---|---|
author_ | String | Email address of the commit author Example: john@example. |
author_ | String | Name of the commit author Example: John Smith |
authored_ | String (date- | Date and time when the commit was authored Example: 2012- |
committed_ | String (date- | Date and time when the commit was committed Example: 2012- |
committer_ | String | Email address of the committer Example: jack@example. |
committer_ | String | Name of the committer Example: Jack Smith |
created_ | String (date- | Date and time when the commit was created.committed_Example: 2017- |
extended_ | Object | Git trailers parsed from the commit message, Example: {"Signed- |
id | String | Full SHA of the commit Example: 2695effb5807a22ff3d1 |
message | String | Full commit message Example: Initial commit |
parent_ | Array of strings | SHAs of the parent commits Example: ["2a4b78934375d7f53875 |
short_ | String | Short SHA of the commit Example: 2695effb |
title | String | Title of the commit message Example: Initial commit |
trailers | Object | Git trailers parsed from the commit message. Example: {"Merged- |
web_ | String | URL to view the commit in the Git Example: https: |
APIEntitiesCustomAttribute
| Property | Type | Description |
|---|---|---|
key | String | Example:foo |
value | String | Example:bar |
APIEntitiesUser
| Property | Type | Description |
|---|---|---|
avatar_ | String | Example:/ |
avatar_ | String | URL of the user’s avatar Example: https: |
bio | String | Biography of the user |
bot | Boolean | — |
created_ | String (date- | Creation date and time of the user account in ISO 8601 format |
custom_ | Array of APIEntities | — |
discord | String | Discord user ID of the user |
followers | String | — |
following | String | — |
github | String | Git |
id | Integer (int64) | ID of the user Example: 1 |
is_ | String | — |
job_ | String | Job title of the user |
linkedin | String | Linked |
local_ | String | — |
location | String | Location of the user |
locked | Boolean | If true, |
name | String | Name of the user.**** if the current user cannot read the bot’s project or groupExample: Administrator |
organization | String | Organization of the user |
pronouns | String | Pronouns of the user |
public_ | String | Public email address of the user Example: john@example. |
state | String | State of the user account.active,blocked,ldap_,blocked_,banned,deactivatedExample: active |
twitter | String | Twitter username of the user |
username | String | Username of the user Example: admin |
web_ | String | URL of the user’s profile Example: https: |
website_ | String | Website of the user |
work_ | String | — |
APIEntitiesUserBasic
| Property | Type | Description |
|---|---|---|
avatar_ | String | Example:/ |
avatar_ | String | URL of the user’s avatar Example: https: |
custom_ | Array of APIEntities | — |
id | Integer (int64) | ID of the user Example: 1 |
locked | Boolean | If true, |
name | String | Name of the user.**** if the current user cannot read the bot’s project or groupExample: Administrator |
public_ | String | Public email address of the user Example: john@example. |
state | String | State of the user account.active,blocked,ldap_,blocked_,banned,deactivatedExample: active |
username | String | Username of the user Example: admin |
web_ | String | URL of the user’s profile Example: https: |