Skip to main content

Method

Deletes a batch job from your project. This operation removes the job metadata but does not delete output files that have already been written.
string
required
The resource name or ID of the batch job to delete:
  • Vertex AI: projects/{project}/locations/{location}/batchPredictionJobs/{job_id} or just the {job_id} if project/location are set in the client
  • Gemini API: batches/{batch_id} or just the {batch_id}
DeleteBatchJobConfig
Optional configuration for the delete request

Response

string
The resource name of the delete operation
boolean
Whether the deletion is complete
object
Error information if the deletion failed

Usage

Delete a Batch Job

Delete with Error Handling

Delete Multiple Jobs

Delete Old Jobs

Conditional Deletion

Cleanup After Processing Results

Bulk Cleanup

Important Notes

Deleting a batch job is permanent and cannot be undone. Make sure to download any results before deletion.
  • Deletion removes job metadata but NOT output files in GCS or BigQuery
  • You can delete jobs in any state, including running jobs
  • Deleting a running job does NOT cancel it - use batches.cancel first
  • Output files must be deleted separately if needed
  • Some deletion operations may be asynchronous (check done field)

What Gets Deleted

Deleted:
  • Job metadata and configuration
  • Job history and logs
  • Reference to input/output locations
Not Deleted:
  • Output files in GCS buckets
  • Output tables in BigQuery
  • Input files
  • Uploaded files in Files API

Error Handling

The delete operation may fail in the following cases:
  • Job not found: The specified job name doesn’t exist
  • Permission denied: Insufficient permissions to delete the job
  • Network error: Connection issues with the API

See Also