---
title: "List jobs in a batch"
method: GET
path: "/api/v2alpha/batches/{batch_id}/jobs"
tags: ["Batches API v2Alpha"]
---

# List jobs in a batch

`GET /api/v2alpha/batches/{batch_id}/jobs`

## Request

- Base URL: `{{ base_url }}`
- URL: `{{ base_url }}/api/v2alpha/batches/{batch_id}/jobs`
- Auth: none declared

List jobs in a batch by batch ID.

## Path parameters

- `batch_id` number, required

## Query parameters

- `q` string
- `last_job_id` integer

## Response `200`

Successfully retrieved the jobs in the batch.

- JobV2ListResponse
  - `jobs` JobV2Response[]
    - `batch_id` integer: ID of the batch this job belongs to
    - `job_id` integer: The job ID
    - `state` 'pending' | 'running' | 'succeeded' | 'failed' | 'cancelled': Current state of the job
    - `exit_code` integer, nullable: Exit code of the job
    - `duration` number, nullable: Duration of the job in seconds
    - `cost` number, nullable: Cost of the job
    - `start_time` string, date-time, nullable: When the job started
    - `end_time` string, date-time, nullable: When the job ended
    - `attributes` object: Key-value pairs of attributes for the job
    - `spec` CreateJobRequest
      - `job_id` integer, required: Job ID, unique within the batch update. Job ids must be contiguous and increasing across the job specs in a request.
      - `process` union, required: What the job executes. A sum type discriminated by the 'type' field.
        - DockerProcess
          - `type` 'docker', required
          - `command` string[], required: Command to execute in the container
          - `image` string, required: Docker image to run
          - `mount_docker_socket` boolean: DEPRECATED. No longer supported; requests with this set to true are rejected.
        - JvmProcess
          - `type` 'jvm', required
          - `jar_spec` object, required
            - `type` 'git_revision' | 'jar_url', required: How the JAR is specified
            - `value` string, required: The git revision or JAR URL
          - `command` string[], required: Command to pass to the JVM entryway
          - `profile` boolean: Enable JVM profiling
          - `spark_version` string: Spark version that this version of hail requires, e.g. '3.5.3'
      - `always_copy_output` boolean: Copy output files even if the job fails
      - `always_run` boolean: Run this job even if its parents failed or the batch was cancelled
      - `attributes` object: Key-value pairs of attributes for the job
      - `env` object[]: Environment variables
        - `name` string
        - `value` string
      - `cloudfuse` object[]: Cloud storage buckets to mount with FUSE
        - `bucket` string, required: Name of the bucket to mount
        - `mount_path` string, required: Path at which to mount the bucket in the container
        - `read_only` boolean, required: Mount the bucket read-only
      - `input_files` FileTransfer[]: Files to copy into the job's container before it runs
        - `from` string, required: Source path
        - `to` string, required: Destination path
      - `output_files` FileTransfer[]: Files to copy out of the job's container after it runs
        - `from` string, required: Source path
        - `to` string, required: Destination path
      - `mount_tokens` boolean: Mount user tokens into the container
      - `network` 'public' | 'private': Network access for the job
      - `n_max_attempts` integer: Maximum number of times this job may be attempted
      - `unconfined` boolean: Run the container without default security confinement
      - `parent_ids` integer[]: IDs of jobs this job depends on (alias for absolute_parent_ids)
      - `absolute_parent_ids` integer[]: Batch-wide IDs of jobs this job depends on
      - `in_update_parent_ids` integer[]: IDs, relative to the current update, of jobs this job depends on
      - `absolute_job_group_id` integer: Batch-wide ID of the job group this job belongs to
      - `in_update_job_group_id` integer: ID, relative to the current update, of the job group this job belongs to
      - `port` integer: Port to expose
      - `regions` string[]: Regions in which this job may be scheduled
      - `requester_pays_project` string: Project to bill for accessing requester-pays buckets
      - `resources` object
        - `cpu` string: CPU request, e.g. '1' or '500m'
        - `memory` union: Memory request: either a quantity, e.g. '3.75Gi', or a memory type
          - string
          - 'lowmem' | 'standard' | 'highmem'
        - `storage` string: Storage request, e.g. '10Gi'
        - `machine_type` string: Specific machine type on which to run the job
        - `preemptible` boolean: Whether the job may run on a preemptible instance
      - `secrets` object[]: Kubernetes secrets to mount into the container
        - `namespace` string, required
        - `name` string, required
        - `mount_path` string, required
      - `service_account` object
        - `namespace` string, required
        - `name` string, required
      - `timeout` number: Job timeout in seconds
      - `user_code` string: The user code that created this job, for display purposes
  - `last_job_id` integer, nullable: ID of the last job in the list for pagination

## Changes

- **2026-09-21** `cc95ba1cb4af`: 2 info
  - added the new optional `query` request parameter `last_job_id`
  - added the new optional `query` request parameter `q`
- **2026-09-03** `4b54754f84e8`: 1 breaking, 26 info
  - removed the required property `jobs/items/spec/job_spec` from the response with the `200` status
  - added the optional property `jobs/items/spec/absolute_job_group_id` to the response with the `200` status
  - added the optional property `jobs/items/spec/absolute_parent_ids` to the response with the `200` status
  - added the optional property `jobs/items/spec/always_copy_output` to the response with the `200` status
  - …23 more
- **2025-04-16** `afa3b61d1d09`: 2 info
  - added the optional property `jobs` to the response with the `200` status
  - added the optional property `last_job_id` to the response with the `200` status
- **2025-01-14** `559a91071cc1`: 2 warning
  - removed the optional property `jobs` from the response with the `200` status
  - removed the optional property `last_job_id` from the response with the `200` status

[Operation history](https://skmtc.dev/hail-is/apis/hail-services/changes/api/v2alpha/batches/:batch_id/jobs/get.md)

---

[API](https://skmtc.dev/hail-is/apis/hail-services.md) - [All operations](https://skmtc.dev/hail-is/apis/hail-services/llms.txt) - [OpenAPI document](https://skmtc.dev/hail-is/apis/hail-services/revisions/cc95ba1cb4af?raw)
