---
title: "Submit a Spark application"
method: POST
path: "/spark"
tags: ["Submission"]
---

# Submit a Spark application

`POST /spark`

To submit a job, prepare a job payload in the request body either in JSON or YAML format.

## Headers

- `content-type` string

## Request body

- SubmitApplicationRequest — Submit Application Request
  - `submissionIdSuffix` string — If specified, the suffix will be appended to the submission ID
  - `applicationName` string — Name of the application. This will help listing submissions under the same application later.
  - `type` string — Should be: Java / Scala / Python. If not specified, the API will try to figure out by itself.
  - `image` string
  - `spotInstance` boolean — To enable Spot Instance feature that schedules all Spark Executor pods to Spot nodes
  - `sparkVersion` string, required — Spark version in the format of x.y, where x and y are integers.
  - `mainClass` string — The main class in the jar provided in mainApplicationFile for a Java/Scala Spark job
  - `mainApplicationFile` string, required — For Java/Scala Spark jobs, provide the full path to the jar file. For PySpark jobs, provide the full path to the Python file.
  - `arguments` string[]
  - `annotations` object
  - `driver` DriverSpec, required
    - `cores` integer
    - `coreRequest` string
    - `coreLimit` string
    - `memory` string
    - `memoryOverhead` string
    - `image` string
    - `env` EnvVar[]
      - `name` string
      - `value` string
    - `annotations` object
  - `executor` ExecutorSpec, required
    - `cores` integer
    - `coreRequest` string
    - `coreLimit` string
    - `memory` string
    - `memoryOverhead` string
    - `image` string
    - `env` EnvVar[]
      - `name` string
      - `value` string
    - `annotations` object
    - `instances` integer
  - `deps` Dependencies
    - `jars` string[]
    - `files` string[]
    - `pyFiles` string[]
    - `packages` string[]
    - `excludePackages` string[]
    - `repositories` string[]
    - `archives` string[]
  - `pythonVersion` string
  - `queue` string — If no queue is specified, a default 'poc' queue will be used.

## Response `200`

OK

- SubmitApplicationResponse
  - `submissionId` string

## Other responses

- `400` — Bad request due to wrong format or invalid values
- `415` — Unsupported content type
- `500` — Internal server error

---

[API](https://skmtc.dev/apple/apis/batch-processing-gateway-api.md) · [All operations](https://skmtc.dev/apple/apis/batch-processing-gateway-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/apple/batch-processing-gateway-api/revisions/01a8fc362221/schema)
