# List

Launch stage: GA

`GET /api/2.0/sql/warehouses`

Lists all SQL warehouses that a user has access to.

API scopes: sql

## Query parameters

- `run_as_user_id` (int64, optional)
  Deprecated: this field is ignored by the server.
   Service Principal which will be used to fetch the list of endpoints.
   If not specified, SQL Gateway will use the user from the session header.
- `page_size` (int32, optional)
  The max number of warehouses to return.
- `page_token` (string, optional)
  A page token, received from a previous `ListWarehouses` call.
   Provide this to retrieve the subsequent page; otherwise the first
   will be retrieved.
  
   When paginating, all other parameters provided to `ListWarehouses` must match
   the call that provided the page token.

## Returns

Returns a list of EndpointInfo objects.

## Response

```json
{
  "warehouses": [
    {
      "id": "string",
      "name": "string",
      "cluster_size": "string",
      "min_num_clusters": 0,
      "max_num_clusters": 0,
      "auto_stop_mins": 0,
      "creator_name": "string",
      "instance_profile_arn": "string",
      "tags": {},
      "spot_instance_policy": "string",
      "enable_photon": true,
      "channel": {},
      "enable_serverless_compute": true,
      "warehouse_type": "string",
      "num_clusters": 0,
      "num_active_sessions": 0,
      "state": "string",
      "jdbc_url": "string",
      "odbc_params": {},
      "health": {}
    }
  ],
  "next_page_token": "string"
}
```

