> ## Documentation Index
> Fetch the complete documentation index at: https://docs.e6data.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a cluster

> Create compute in this workspace using an available cluster release.

`POST /api/v1/queryservices`

Create compute in this workspace using an available cluster release.

## Access

[Request a workspace OAuth token](https://docs.e6data.com/api-reference/workspace-oauth-2-0/post-oauth2-token.md#request) for the workspace that owns the resource. If your workspace uses OAuth scopes for API access, request `query_engine.clusters:create`. If your admin confirms that workspace permissions are active for management API calls, omit the `scope` field for this call.

## Request

Body: name is a unique cluster name. For this example, replace releaseRef with an available engine release version and baseSizeExecutors with an allowed size.

Content type: `application/json`.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "name": "reporting",
  "releaseRef": "<available-release-version>",
  "baseSizeExecutors": 4
}
```

### Body fields

| Field | Type | Input | Details |
| - | - | - | - |
| `autoResumeEnabled` | boolean | Optional | Enable automatic resume on first query when cluster is suspended. Suspended clusters automatically resume when a query arrives. Default: true. |
| `autoResumeTimeoutSeconds` | integer | Optional | Readiness wait for the next auto-resume attempt. Range 30-600 seconds. Defaults to 300 on create. Omission on update preserves the current value. Minimum: 30. Maximum: 600. |
| `autoSuspensionEnabled` | boolean | Optional | Allow the cluster to suspend after its configured idle interval. |
| `autoscalingEnabled` | boolean | Optional | Enable automatic scaling of executor replicas based on query load. |
| `baseSizeExecutors` | integer | Optional | Starting executor count for the cluster size you select. This is separate from the autoscaling minimum and maximum. Minimum: 1. |
| `executorReplicas` | integer | Optional | Starting executor count. Must be zero or greater. For new clusters, use baseSizeExecutors. |
| `maxExecutors` | integer | Optional | Maximum executor replicas when autoscaling is enabled. Limits cost during high load. Minimum: 0. |
| `maxIdleDurationMinutes` | integer | Optional | Minutes of inactivity before auto-suspension triggers. Default: 30. Minimum: 0. |
| `minExecutors` | integer | Optional | Minimum executor replicas when autoscaling is enabled. Default: 1. Minimum: 0. |
| `name` | string | Required | Cluster name, 3 to 30 characters. Use lowercase letters, digits and hyphens. Start with a letter and end with a letter or digit. |
| `plannerReplicas` | integer | Optional | Planner count. Must be zero or greater. Automatic sizing can override this value. |
| `qps` | object | Optional | QPS configuration for dynamic planner scaling |
| `qps.count` | integer | Optional | Target queries per second. Maximum: 10000. |
| `qps.enabled` | boolean | Optional | Enable QPS-based planner scaling. When true, planner count is calculated from QPS formula. |
| `queryHistoryEnabled` | boolean | Optional | Save query history so users with access can find their runs in Run History. |
| `queryResultCacheEnabled` | boolean | Optional | Enable query result caching. When enabled, query results are cached to improve performance for repeated queries. |
| `queryResultCacheTTLSeconds` | integer | Optional | Time-to-live for cached query results in seconds. Default: 300 (5 minutes). Needs queryResultCacheEnabled: true (400 otherwise). Minimum: 0. |
| `queryTimeoutSeconds` | integer | Optional | Maximum query execution time in seconds. Default: 900 (15 minutes). Queries exceeding this are canceled. Minimum: 0. Maximum: 172800. |
| `releaseRef` | string | Optional | Version to use for the cluster. Choose a version available in your workspace. |
| `slidingWindowDuration` | integer | Optional | Length of the autoscaling observation window in minutes. Minimum: 0. Maximum: 35791394. |
| `startupGracePeriodSeconds` | integer | Optional | Time in seconds to keep startup protection active after capacity is ready. Defaults to 300 seconds. Use 0 to disable it for future starts. |
| `transpilerDialect` | string | Optional | SQL dialect to transpile from (e.g., "snowflake", "trino", "databricks"). Optional, default snowflake. Needs transpilerEnabled: true (400 otherwise). |
| `transpilerEnabled` | boolean | Optional | Enable translation from the selected SQL dialect. |
| `windowBasedEnabled` | boolean | Optional | Enable window-based autoscaling for smoother scaling decisions. |

### Example request

Save the JSON request above as `request.json`.
Set `WORKSPACE_URL` to the same HTTPS workspace origin and `ACCESS_TOKEN` to the access token from that workspace.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl --proto '=https' --silent --show-error --fail-with-body \
  --request POST \
  --header @- \
  --header 'Content-Type: application/json' \
  --data-binary @request.json \
  "$WORKSPACE_URL/api/v1/queryservices" <<< "Authorization: Bearer $ACCESS_TOKEN"
```

## Response

HTTP `201`. Content type: `application/json`.

Example response (selected fields and sample values):

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "message": "<message from your workspace>",
  "name": "reporting"
}
```

The `message` field contains text from your workspace. The example uses a placeholder for that text.

The response acknowledges creation. Wait for the cluster to become ready before submitting work.

## Troubleshooting

For `401`, check the workspace URL and token expiry. For `403`, ask your admin to check the machine client’s access to this operation and resource. In a scope-based workspace, also check the scope on the token. [Troubleshoot the token or request](https://docs.e6data.com/api-reference/list-clusters-with-oauth.md#troubleshoot-a-request).

400: check the name, version and sizing constraints. 409: the name or requested change conflicts with existing state.

## Related guides

[Workspace management guide](https://docs.e6data.com/platform/automate/clusters-catalogs-schedules-policies.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.