Get a single job by ID

GET /projects/{id}/jobs/{job_id}

Path parameters

  • id integer Required

    The ID of the project

  • job_id integer Required

    The ID of the job

Responses

  • 200 application/json

    A single job object

    Hide response attributes Show response attributes object
    • id integer

      The ID of the job

    • name string

      The name of the job

    • status string

      The current status of the job

    • stage string

      The stage of the job in the CI/CD pipeline

    • created_at string(date-time)

      The creation time of the job

    • started_at string(date-time)

      The start time of the job

    • finished_at string(date-time)

      The finish time of the job

    • commit object
      Hide commit attributes Show commit attributes object
      • id string
      • short_id string
      • created_at string(date-time)
      • parent_ids array[string]
      • title string
      • message string
      • author_name string
      • author_email string
      • authored_date string(date-time)
      • committer_name string
      • committer_email string
      • committed_date string(date-time)
      • trailers object
      • web_url string
    • archived boolean

      Indicates if the job is archived

    • allow_failure boolean

      Indicates if the job is allowed to fail

    • erased_at string(date-time)

      The time when the job was erased, if applicable

    • duration integer

      The duration of the job in seconds

    • queued_duration number

      The duration the job was queued before execution, in seconds

    • ref string

      The reference for the job

    • artifacts array

      The artifacts produced by the job

    • tag boolean

      Indicates if the job is tagged

    • web_url string

      The URL for accessing the job in the web interface

    • project object
      Hide project attribute Show project attribute object
      • ci_job_token_scope_enabled boolean

        Indicates if the CI/CD job token scope setting is enabled for the project

    • user object
      Hide user attributes Show user attributes object
      • id integer(int32)
      • username string
      • name string
      • state string
      • avatar_url string
      • avatar_path string
      • custom_attributes array[object]
        Hide custom_attributes attributes Show custom_attributes attributes object
        • key string
        • value string
      • web_url string
      • email string
GET /projects/{id}/jobs/{job_id}
curl \
 --request GET 'https://www.gitlab.com/api/v4/projects/{id}/jobs/{job_id}' \
 --header "Private-Token: $API_KEY"
Response examples (200)
{
  "id": 42,
  "name": "string",
  "status": "string",
  "stage": "string",
  "created_at": "2016-01-11T10:13:33Z",
  "started_at": "2016-01-11T10:13:33Z",
  "finished_at": "2016-01-11T10:13:33Z",
  "commit": {
    "id": "2695effb5807a22ff3d138d593fd856244e155e7",
    "short_id": "2695effb",
    "created_at": "2017-07-26T11:08:53+02:00",
    "parent_ids": [
      "2a4b78934375d7f53875269ffd4f45fd83a84ebe"
    ],
    "title": "Initial commit",
    "message": "Initial commit",
    "author_name": "John Smith",
    "author_email": "john@example.com",
    "authored_date": "2012-05-28T04:42:42-07:00",
    "committer_name": "Jack Smith",
    "committer_email": "jack@example.com",
    "committed_date": "2012-05-28T04:42:42-07:00",
    "trailers": "{ \"Merged-By\": \"Jane Doe janedoe@gitlab.com\" }",
    "web_url": "https://gitlab.example.com/janedoe/gitlab-foss/-/commit/ed899a2f4b50b4370feeea94676502b42383c746"
  },
  "archived": true,
  "allow_failure": true,
  "erased_at": "2016-01-11T10:13:33Z",
  "duration": 42,
  "queued_duration": 42.0,
  "ref": "string",
  "artifacts": [],
  "tag": true,
  "web_url": "string",
  "project": {
    "ci_job_token_scope_enabled": true
  },
  "user": {
    "id": 1,
    "username": "admin",
    "name": "Administrator",
    "state": "active",
    "avatar_url": "https://gravatar.com/avatar/1",
    "avatar_path": "/user/avatar/28/The-Big-Lebowski-400-400.png",
    "custom_attributes": [
      {
        "key": "foo",
        "value": "bar"
      }
    ],
    "web_url": "https://gitlab.example.com/root",
    "email": "string"
  }
}