Method
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
- 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
donefield)
What Gets Deleted
Deleted:- Job metadata and configuration
- Job history and logs
- Reference to input/output locations
- 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
- batches.cancel - Cancel a running job before deleting
- batches.get - Check job status before deleting
- batches.list - Find jobs to delete
- batches.create - Create a new batch job