# Create

Launch stage: GA

`POST /api/2.0/sql/warehouses`

Creates a new SQL warehouse.

API scopes: sql

## Request body

- `name` (string, optional)
  Logical name for the cluster.
  
   Supported values:
     - Must be unique within an org.
     - Must be less than 100 characters.
- `cluster_size` (string, optional)
  Size of the clusters allocated for this warehouse.
   Increasing the size of a spark cluster allows you to run larger queries on
   it. If you want to increase the number of concurrent queries, please tune
   max_num_clusters.
  
   Supported values:
   - 2X-Small
   - X-Small
   - Small
   - Medium
   - Large
   - X-Large
   - 2X-Large
   - 3X-Large
   - 4X-Large
   - 5X-Large
- `min_num_clusters` (int32, optional)
  Minimum number of available clusters that will be maintained for this SQL
   warehouse. Increasing this will ensure that a larger number of clusters are
   always running and therefore may reduce the cold start time for new
   queries. This is similar to reserved vs. revocable cores in a resource
   manager.
  
   Supported values:
     - Must be > 0
     - Must be <= min(max_num_clusters, 30)
  
   Defaults to 1
  Default: `1`
- `max_num_clusters` (int32, optional)
  Maximum number of clusters that the autoscaler will create to handle
   concurrent queries.
  
   Supported values:
     - Must be >= min_num_clusters
     - Must be <= 40.
  
   Defaults to min_clusters if unset.
- `auto_stop_mins` (int32, optional)
  The amount of time in minutes that a SQL warehouse must be idle (i.e., no
   RUNNING queries) before it is automatically stopped.
  
   Supported values:
     - Must be == 0 or >= 10 mins
     - 0 indicates no autostop.
  
   Defaults to 120 mins
  Default: `120`
- `creator_name` (string, optional)
  warehouse creator name
- `instance_profile_arn` (string, optional)
  Deprecated. Instance profile used to pass IAM role to the cluster
- `tags` (object, optional)
  A set of key-value pairs that will be tagged on all resources (e.g., AWS instances and EBS volumes) associated
   with this SQL warehouse.
  
   Supported values:
    - Number of tags < 45.
  - `custom_tags` (array of object, optional)
    - `key` (string, optional)
    - `value` (string, optional)
- `spot_instance_policy` (string, optional)
  Configurations whether the endpoint should use spot instances.
  Possible values: `POLICY_UNSPECIFIED`, `COST_OPTIMIZED`, `RELIABILITY_OPTIMIZED`
  Default: `COST_OPTIMIZED`
- `enable_photon` (boolean, optional)
  Configures whether the warehouse should use Photon optimized clusters.
  
   Defaults to true.
- `channel` (object, optional)
  Channel Details
  - `name` (string, optional)
    Possible values: `CHANNEL_NAME_UNSPECIFIED`, `CHANNEL_NAME_PREVIEW`, `CHANNEL_NAME_CURRENT`, `CHANNEL_NAME_PREVIOUS`, `CHANNEL_NAME_CUSTOM`
  - `dbsql_version` (string, optional)
- `enable_serverless_compute` (boolean, optional)
  Configures whether the warehouse should use serverless compute
- `warehouse_type` (string, optional)
  Warehouse type: `PRO` or `CLASSIC`. If you want to use serverless compute,
   you must set to `PRO` and also set the field `enable_serverless_compute` to `true`.
  Possible values: `TYPE_UNSPECIFIED`, `CLASSIC`, `PRO`

## Returns

- `id` (string, optional)
  Id for the SQL warehouse.
   This value is unique across all SQL warehouses.

## Response

```json
{
  "id": "string"
}
```

