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.
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.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
scopeQuery | Array of strings | The scope of builds to show Example: ["pending", |
refQuery | String | The branch name (ref) to filter jobs by Example: feature- |
pageQuery | Integer | Current page number Default: 1Example: 1 |
per_Query | Integer | Number of items per page Default: 20Example: 20 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | 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 | The ID of a job Example: 88 |
idPath, | String or integer | The ID or URL- Example: 11 |
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.
Parameters
| Name | Type | Description |
|---|---|---|
job_Path, | Integer | The ID of a job Example: 88 |
idPath, | String or integer | The ID or URL- Example: 11 |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
force | Boolean | Force cancellation for a job with a state of cancelingExample: true |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
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.
Parameters
| Name | Type | Description |
|---|---|---|
job_Path, | Integer | The ID of a build Example: 88 |
idPath, | String or integer | The ID or URL- Example: 11 |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
409 | Conflict | — |
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.
Parameters
| Name | Type | Description |
|---|---|---|
job_Path, | Integer | The ID of a Job Example: 88 |
idPath, | String or integer | The ID or URL- Example: 11 |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
job_ | Object | Input values for the job Example: {"environment": |
job_ | Array of objects | User defined variables that will be included when running the job |
job_Required | String | The name of the variable Example: foo |
job_Required | String | The value of the variable Example: bar |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
Retry a job
POST /api/v4/projects/{id}/jobs/{job_id}/retry
Retries a specified job in a project.
Parameters
| Name | Type | Description |
|---|---|---|
job_Path, | Integer | The ID of a job Example: 88 |
idPath, | String or integer | The ID or URL- Example: 11 |
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 | — |
Get the runtime environment key for a job
GET /api/v4/projects/{id}/jobs/{job_id}/runtime_environment_key
Retrieves the runtime environment key linked to a job, if the job is resuming a suspended environment.
Parameters
| Name | Type | Description |
|---|---|---|
job_Path, | Integer | The ID of a job Example: 88 |
idPath, | String or integer | The ID or URL- Example: 11 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
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 | The ID or URL- |
job_Path, | Integer | The ID of a job Example: 88 |
byte_Query | Integer | Byte offset to start reading 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- | Example:2022- |
id | Integer (int64) | Example:1 |
iid | Integer | Example:2 |
project_ | Integer (int64) | Example:3 |
ref | String | Example:feature- |
sha | String | Example:0ec9e58fdfca6cdd6652 |
source | String | Example:push |
status | String | Example:success |
updated_ | String (date- | Example:2022- |
web_ | String | Example:https: |
APIEntitiesCiRunner
| Property | Type | Description |
|---|---|---|
active | Boolean | Example:true |
created_ | String (date- | Example:2025- |
created_ | APIEntities | — |
description | String | Example:test- |
id | Integer (int64) | Example:8 |
ip_ | String | 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. |
APIEntitiesCiRuntimeEnvironmentKey
| Property | Type | Description |
|---|---|---|
runtime_ | String | Example:42/ |
APIEntitiesCommit
| Property | Type | Description |
|---|---|---|
author_ | String | Example:john@example. |
author_ | String | Example:John Smith |
authored_ | String (date- | Example:2012- |
committed_ | String (date- | Example:2012- |
committer_ | String | Example:jack@example. |
committer_ | String | Example:Jack Smith |
created_ | String (date- | Example:2017- |
extended_ | Object | Example:{"Signed- |
id | String | Example:2695effb5807a22ff3d1 |
message | String | Example:Initial commit |
parent_ | Array of strings | Example:["2a4b78934375d7f53875 |
short_ | String | Example:2695effb |
title | String | Example:Initial commit |
trailers | Object | Example:{"Merged- |
web_ | String | Example:https: |
APIEntitiesCustomAttribute
| Property | Type | Description |
|---|---|---|
key | String | Example:foo |
value | String | Example:bar |
APIEntitiesUser
| Property | Type | Description |
|---|---|---|
avatar_ | String | Example:/ |
avatar_ | String | Example:https: |
bio | String | — |
bot | Boolean | — |
created_ | String | — |
custom_ | Array of APIEntities | — |
discord | String | — |
followers | String | — |
following | String | — |
github | String | — |
id | Integer (int64) | Example:1 |
is_ | String | — |
job_ | String | — |
linkedin | String | — |
local_ | String | — |
location | String | — |
locked | Boolean | — |
name | String | Example:Administrator |
organization | String | — |
pronouns | String | — |
public_ | String | Example:john@example. |
state | String | Example:active |
twitter | String | — |
username | String | Example:admin |
web_ | String | Example:https: |
website_ | String | — |
work_ | String | — |
APIEntitiesUserBasic
| Property | Type | Description |
|---|---|---|
avatar_ | String | Example:/ |
avatar_ | String | Example:https: |
custom_ | Array of APIEntities | — |
id | Integer (int64) | Example:1 |
locked | Boolean | — |
name | String | Example:Administrator |
public_ | String | Example:john@example. |
state | String | Example:active |
username | String | Example:admin |
web_ | String | Example:https: |