---
title: "Get a job in a batch"
method: GET
path: "/api/v1alpha/batches/{batch_id}/jobs/{job_id}"
tags: ["Batches API v1Alpha"]
---

# Get a job in a batch

`GET /api/v1alpha/batches/{batch_id}/jobs/{job_id}`

## Request

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

Get a job in a batch by ID.

## Path parameters

- `batch_id` number, required
- `job_id` number, required

## Response `200`

Successfully retrieved the job in the batch.

- JobResponse
  - `batch_id` integer: ID of the batch this job belongs to
  - `job_id` integer: The job ID
  - `job_group_id` integer: ID of the job group this job belongs to
  - `name` string, nullable: Name of the job
  - `user` string: User who owns the job
  - `billing_project` string: Billing project for the job
  - `state` 'Pending' | 'Ready' | 'Creating' | 'Running' | 'Failed' | 'Cancelled' | 'Error' | 'Success': Current state of the job
  - `display_state` string, nullable: Human-readable display state
  - `exit_code` integer, nullable: Exit code of the job
  - `duration` number, nullable: Duration of the job in milliseconds
  - `start_time` string, date-time, nullable: When the job started
  - `end_time` string, date-time, nullable: When the job ended
  - `cost` number, nullable: Total cost of the job in USD
  - `msec_mcpu` integer: Millisecond milli-CPU usage
  - `cost_breakdown` CostBreakdownEntry[]: Per-resource cost breakdown
    - `resource` string: Name of the resource
    - `cost` number: Cost for this resource in USD
  - `always_run` boolean: Whether the job runs regardless of the batch's success state
  - `n_max_attempts` integer: Maximum number of times this job will be attempted
  - `inst_coll` string, nullable: Instance collection the job ran on
  - `attributes` object, nullable: Key-value pairs of attributes for the job
  - `status` object, nullable: Detailed job status
  - `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

## Changes

- **2026-09-03** `4b54754f84e8`: 1 breaking, 26 info
  - removed the required property `spec/job_spec` from the response with the `200` status
  - added the optional property `spec/absolute_job_group_id` to the response with the `200` status
  - added the optional property `spec/absolute_parent_ids` to the response with the `200` status
  - added the optional property `spec/always_copy_output` to the response with the `200` status
  - …23 more
- **2026-05-12** `f4ba312e849f`: 1 breaking, 8 warning, 17 info
  - the response property `attributes` became nullable for the status `200`
  - added the new `Cancelled` enum value to the `state` response property for the response status `200`
  - added the new `Creating` enum value to the `state` response property for the response status `200`
  - added the new `Error` enum value to the `state` response property for the response status `200`
  - …22 more
- **2025-04-16** `afa3b61d1d09`: 9 info
  - added the optional property `attributes` to the response with the `200` status
  - added the optional property `batch_id` to the response with the `200` status
  - added the optional property `duration` to the response with the `200` status
  - added the optional property `end_time` to the response with the `200` status
  - …5 more
- …earlier changes not shown

[Operation history](https://skmtc.dev/hail-is/apis/hail-services/changes/api/v1alpha/batches/:batch_id/jobs/:job_id/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)
