Databrick’s REST API uses the username and password of the user for authentication with the REST API. While using cURL we assume that you store Databricks API credentials under .netrc. Please see the relevant documentation for where to place our documentation.

Once you set up your login credentials in the .netrc file format. You can specify your curl commands with -n. You can also use environmental variables to set these credentials and pass them into -u although the recommended way is with .netrc.

  curl -n -H "Content-Type: application/json" \
  -X POST \
  -d '{
  "cluster_name": "flights",
  "spark_version": "2.0.x-scala2.10",
  "node_type_id": "r3.xlarge",
  "spark_conf": {
    "spark.speculation": true
"aws_attributes": {
  "availability": "SPOT",
  "zone_id": "us-west-2c"
"num_workers": 2
}' \