Skip to main content
Beta ProductSQL Proxy is currently in beta. API endpoints may change.
Warehouse management endpoints allow you to configure which Databricks SQL warehouses the proxy can route queries to.

List Warehouses

GET /admin/warehouses
curl -X GET \
  -H "Authorization: Bearer <proxy-manager-token>" \
  https://sqlproxy.your-company.datafold.com/admin/warehouses

Get Warehouse

GET /admin/warehouses/{warehouse_id}
curl -X GET \
  -H "Authorization: Bearer <proxy-manager-token>" \
  https://sqlproxy.your-company.datafold.com/admin/warehouses/{warehouse_id}

Add Warehouse

POST /admin/warehouses
curl -X POST \
  -H "Authorization: Bearer <proxy-manager-token>" \
  -H "Content-Type: application/json" \
  -d '{
    "warehouse_id": "abc123def4567890",
    "host": "workspace.cloud.databricks.com",
    "is_default": true,
    "size": "S",
    "auto_stop_mins": 15,
    "warehouse_type": "PRO",
    "routing_label": "production"
  }' \
  https://sqlproxy.your-company.datafold.com/admin/warehouses

Request Body

FieldTypeRequiredDescription
warehouse_idstringYesDatabricks warehouse ID (16-character hex string, e.g., abc123def45678907890)
hoststringYesDatabricks workspace host (e.g., workspace.cloud.databricks.com)
http_pathstringNoHTTP path to the warehouse. Derived from warehouse_id if omitted.
is_defaultbooleanNoSet as default warehouse for routing
sizestringNoWarehouse size: 2XS, XS, S, M, L, XL, 2XL, 3XL, 4XL
auto_stop_minsintegerNoAuto-stop timeout in minutes
warehouse_typestringNoWarehouse type: CLASSIC, PRO, or SERVERLESS
routing_labelstringNoHuman-friendly routing_label for routing (must be unique). Use with @datafold:warehouse=routing_label directive.

Update Warehouse

PUT /admin/warehouses/{warehouse_id}
curl -X PUT \
  -H "Authorization: Bearer <proxy-manager-token>" \
  -H "Content-Type: application/json" \
  -d '{
    "is_default": true,
    "size": "M",
    "routing_label": "staging"
  }' \
  https://sqlproxy.your-company.datafold.com/admin/warehouses/{warehouse_id}

Request Body

FieldTypeRequiredDescription
hoststringNoDatabricks workspace host
is_defaultbooleanNoSet as default warehouse
sizestringNoWarehouse size
auto_stop_minsintegerNoAuto-stop timeout in minutes
warehouse_typestringNoWarehouse type: CLASSIC, PRO, or SERVERLESS
routing_labelstring / nullNoHuman-friendly routing_label for routing (must be unique). Set to null to clear.

Delete Warehouse

DELETE /admin/warehouses/{warehouse_id}
curl -X DELETE \
  -H "Authorization: Bearer <proxy-manager-token>" \
  https://sqlproxy.your-company.datafold.com/admin/warehouses/{warehouse_id}

Set Default Warehouse

POST /admin/warehouses/{warehouse_id}/default Sets a warehouse as the default for query routing when no routing directive is specified.
curl -X POST \
  -H "Authorization: Bearer <proxy-manager-token>" \
  https://sqlproxy.your-company.datafold.com/admin/warehouses/{warehouse_id}/default

Routing by Label

You can use the routing_label field to enable human-friendly routing directives in SQL queries. Instead of using the warehouse ID:
-- @datafold:warehouse=abc123def4567890
SELECT * FROM my_table;
You can use a meaningful routing_label:
-- @datafold:warehouse=production
SELECT * FROM my_table;
The proxy first attempts to match the directive value against warehouse routing_labels. If no routing_label matches, it falls back to treating the value as a warehouse ID, ensuring backward compatibility.