Skip to main content

Cancel Spark Job (V2)

This operation submits a cancellation request for a Spark job in a specified project.

POST/v2/projects/{projectId}/jobs/{jobId}/cancel
Connection Endpoint

The base URL for this API is in the following format:

https://api.cloud.zilliz.com

📘Notes

The endpoints on the control plane currently supports up to 20 requests per second per user per endpoint.

shell
export BASE_URL="https://api.cloud.zilliz.com"
Parameters
Authorizationstringheaderrequired

The authentication token should be an API key with appropriate privileges.

Example Value: Bearer {{TOKEN}}
projectIdstringpathrequired

The project ID.

Example Value: proj-xxxxxxxxxxxxxxxxxxx
jobIdstringpathrequired

The Spark job ID.

Example Value: job-xxxxxxxxxxxxxxxxxx
bash
export TOKEN="YOUR_API_KEY"
export projectId="proj-xxxxxxxxxxxxxxxxxxx"
export jobId="job-xxxxxxxxxxxxxxxxxx"

curl --request POST \
--url "${BASE_URL}/v2/projects/${projectId}/jobs/${jobId}/cancel" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Request-Timeout: 5" \
--header "Content-Type: application/json"
Responses

The cancellation request was accepted.

codeinteger

Response code.

dataobject

Response payload that contains the Spark job after the cancel request.

jobIdstringrequired

The job ID.

projectIdstringrequired

The project ID the job belongs to.

typestringrequired

The job type.

descriptionstring

The job description.

statusstringrequired

The job status.

regionIdstringrequired

The cloud region ID.

clusterIdstring

The cluster ID.

artifactobject

The output artifact produced by the job.

volumeNamestringrequired

The volume name the artifact is stored in.

pathstringrequired

The path of the artifact within the volume.

detailsobject

Details of a backfill job.

dbNamestring

The database name.

collectionNamestring

The collection name.

inputobject

A reference to job input or output data.

typestring

The data reference type.

volumeNamestring

The volume name.

pathstring

The data path within the volume.

formatstring

The data format.

fieldsarray

The target fields.

[]fieldsstring
(To be added soon)
columnMappingobject

Source-to-target column mapping.

modestring

The backfill mode.

resourceSizestring

The resource size.

failureReasonobject

The reason a job failed.

codestring

The error code.

messagestring

The error message.

retryableboolean

Whether the job can be retried.

precheckReportobject

The precheck report for a backfill job.

passedboolean

Whether the precheck passed.

dbNamestring

The database name.

collectionNamestring

The collection name.

inputstring

The input description.

fieldsarray

The target fields.

[]fieldsstring
(To be added soon)
columnMappingobject

Source-to-target column mapping.

requiredSourceColumnsarray

The required source columns.

[]requiredSourceColumnsstring
(To be added soon)
errorsarray

The precheck errors.

[]errorsobject

A single precheck error.

codestring

The error code.

sourceColumnstring

The source column.

targetFieldstring

The target field.

expectedTypestring

The expected type.

actualTypestring

The actual type.

messagestring

The error message.

checkedRowsinteger<int64>

The number of checked rows.

createdAtstring

Creation time (ISO 8601).

submittedAtstring

Submission time (ISO 8601).

startedAtstring

Start time (ISO 8601).

finishedAtstring

Finish time (ISO 8601).

durationSecondsinteger<int64>

The duration in seconds.

Returns an error message.

codeinteger

Response code.

messagestring

Error message.

Successjson
{
"code": 0,
"data": {
"jobId": "job-xxxxxxxxxxxxxxxxxx",
"sparkInstanceId": "sp-xxxxxxxxxxxxxxxxxx",
"type": "SPARK",
"jobName": "daily-vector-etl",
"status": "CANCELED",
"regionId": "aws-us-west-2",
"clusterId": "in01-xxxxxxxxxxxxxxx",
"mainClass": "com.zilliz.example.Main",
"createdAt": "2026-05-20T10:00:00Z",
"startedAt": "2026-05-20T10:01:00Z",
"finishedAt": "2026-05-20T10:06:00Z",
"durationSeconds": 300,
"sparkApplicationName": "spark-batch-sp-xxxxxxxxxxxxxxxxxx",
"sparkNamespace": "spark-sp-xxxxxxxxxxxxxxxxxx",
"sparkHistoryUrl": "https://spark-history.example.com",
"sparkApplicationId": "spark-batch-sp-xxxxxxxxxxxxxxxxxx-0",
"sparkHistoryAppUrl": "https://spark-history.example.com/history/spark-batch-sp-xxxxxxxxxxxxxxxxxx-0/jobs/",
"artifact": {
"volumeId": "stg-xxxxxxxxxxxxxxxxxxx",
"path": "/jars/example-job.jar",
"artifactUri": "volume://my-volume/jars/example-job.jar"
},
"applicationType": "Java",
"arguments": [
"--collection",
"medium_articles"
],
"resource": {
"driverCores": 2,
"driverMemory": "8g",
"executorCores": 2,
"executorMemory": "8g",
"minExecutors": 1,
"maxExecutors": 10
},
"sparkConf": {
"spark.sql.shuffle.partitions": "200"
},
"error": null,
"submittedAt": "2026-05-20T10:00:30Z"
}
}
Ctrl I