How to delete all jobs using the REST API
Run the following commands to delete all jobs in a Databricks workspace.
Identify the jobs to delete and list them in a text file:
curl -X GET -u "Bearer: <token>" https://<databricks-instance>/api/2.0/jobs/list | grep -o -P 'job_id.{0,6}' | awk -F':' '{print $2}' >> job_id.txt
Run the
curl
command in a loop to delete the identified jobs:while read line do job_id=$line curl -X POST -u "Bearer: <token>" https://<databricks-instance>/api/2.0/jobs/delete -d '{"job_id": '"$job_id"'}' done < job_id.txt