---
title: "Create a job"
method: POST
path: "/api/v1alpha/batches/{batch_id}/jobs/create"
tags: ["Batches API v1Alpha"]
deprecated: true
---

# Create a job

`POST /api/v1alpha/batches/{batch_id}/jobs/create`

## Request

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

> **Deprecated.**

Create a job.

## Path parameters

- `batch_id` number, required

## Request body

- 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

## Response `200`

Successfully created the job.

- object

## Changes

- **2026-09-03** `4b54754f84e8`: 2 breaking, 1 warning, 24 info
  - added the new required request property `job_id`
  - added the new required request property `process`
  - removed the request property `job_spec`
  - added the new optional request property `absolute_job_group_id`
  - …23 more
- **2025-04-16** `afa3b61d1d09`: 2 breaking
  - added the new required request property `job_spec`
  - request body became required
- **2025-01-14** `559a91071cc1`: 1 warning, 1 info
  - removed the request property `job_spec`
  - request body became optional

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