# Create

Launch stage: GA

`POST /api/2.0/accounts/{account_id}/workspaces`

Creates a new workspace using a credential configuration and a storage configuration, an optional network configuration (if using a customer-managed VPC), an optional managed services key configuration (if using customer-managed keys for managed services), and an optional storage key configuration (if using customer-managed keys for storage). The key configurations used for managed services and storage encryption can be the same or different.

 Important: This operation is asynchronous. A response with HTTP status code 200 means the request has been accepted and is in progress, but does not mean that the workspace deployed successfully and is running. The initial workspace status is typically PROVISIONING. Use the workspace ID (workspace_id) field in the response to identify the new workspace and make repeated GET requests with the workspace ID and check its status. The workspace becomes available when the status changes to RUNNING.

 You can share one customer-managed VPC with multiple workspaces in a single account. It is not required to create a new VPC for each workspace. However, you cannot reuse subnets or Security Groups between workspaces. If you plan to share one VPC with multiple workspaces, make sure you size your VPC and subnets accordingly. Because a Databricks Account API network configuration encapsulates this information, you cannot reuse a Databricks Account API network configuration across workspaces.

 For information about how to create a new workspace with this API including error handling, see [Create a new workspace using the Account API](http://docs.databricks.com/administration-guide/account-api/new-workspace.html).

 Important: Customer-managed VPCs, PrivateLink, and customer-managed keys are supported on a limited set of deployment and subscription types. If you have questions about availability, contact your <Databricks> representative.

 This operation is available only if your account is on the E2 version of the platform or on a select custom plan that allows multiple workspaces per account.

API scopes: provisioning

Clouds: AWS, GCP

## Path parameters

- `account_id` (string, optional)

## Request body

- `workspace_name` (string, optional)
  The human-readable name of the workspace.
  Constraints: `[ 1 .. 100 ] characters`
- `deployment_name` (string, optional)
  The deployment name defines part of the subdomain for the workspace. The workspace URL for the web application and REST APIs is <workspace-deployment-name>.cloud.databricks.com. For example, if the deployment name is abcsales, your workspace URL will be https://abcsales.cloud.databricks.com. Hyphens are allowed. This property supports only the set of characters that are allowed in a subdomain.
   To set this value, you must have a deployment name prefix. Contact your <Databricks> account team to add an account deployment name prefix to your account.
   Workspace deployment names follow the account prefix and a hyphen. For example, if your account's deployment prefix is acme and the workspace deployment name is workspace-1, the JSON response for the deployment_name field becomes acme-workspace-1. The workspace URL would be acme-workspace-1.cloud.databricks.com.
   You can also set the deployment_name to the reserved keyword EMPTY if you want the deployment name to only include the deployment prefix. For example, if your account's deployment prefix is acme and the workspace deployment name is EMPTY, the deployment_name becomes acme only and the workspace URL is acme.cloud.databricks.com.
   This value must be unique across all non-deleted deployments across all AWS regions.
   If a new workspace omits this property, the server generates a unique deployment name for you with the pattern dbc-xxxxxxxx-xxxx.
  Example: `workspace_1`
  Constraints: `<= 64 characters`
- `aws_region` (string, optional)
  **AWS:** The AWS region of the workspace data plane (for example, `us-west-2`).
- `location` (string, optional)
  The Google Cloud region of the workspace data plane in your Google account (for example, `us-east4`).
- `cloud` (string, optional)
  DEPRECATED: This field is being ignored by the server and will be removed in the future.
   The cloud name. This field always has the value `gcp`.
- `pricing_tier` (string, optional)
  Possible values: `UNKNOWN`, `COMMUNITY_EDITION`, `STANDARD`, `PREMIUM`, `ENTERPRISE`, `DEDICATED`
- `cloud_resource_container` (object, optional)
  - `gcp` (object, required)
    **GCP:** The GCP cloud entities in which GCP workspaces are.
    - `project_id` (string, optional)
      **GCP:** The GCP project ID where the dataplane resources will be located in.
- `credentials_id` (string, optional)
  ID of the workspace's credential configuration object.
- `storage_configuration_id` (string, optional)
  ID of the workspace's storage configuration object.
- `network_id` (string, optional)
  The ID of the workspace's network configuration object. To use AWS PrivateLink, this field is required.
- `gcp_managed_network_config` (object, optional)
  **GCP:** The network config for GCP workspace with <Databricks> managed network.
  - `subnet_cidr` (string, optional)
    The IP range which will be used to allocate GKE cluster nodes from.
     Note: Pods, services and master IP range must be mutually exclusive.
  - `gke_cluster_pod_ip_range` (string, optional)
    The IP range that will be used to allocate GKE cluster Pods from.
  - `gke_cluster_service_ip_range` (string, optional)
    The IP range that will be used to allocate GKE cluster Services from.
- `gke_config` (object, optional)
  **GCP:** The configurations of the GKE cluster used by the GCP workspace.
  - `connectivity_type` (string, optional)
    The type of network connectivity of the GKE cluster.
    Possible values: `PRIVATE_NODE_PUBLIC_MASTER`, `PUBLIC_NODE_PUBLIC_MASTER`
  - `master_ip_range` (string, optional)
    The IP range that will be used to allocate GKE cluster master resources from.
     This field must not be set if gke_cluster_type=PUBLIC_NODE_PUBLIC_MASTER.
- `private_access_settings_id` (string, optional)
  ID of the workspace's private access settings object. Only used for PrivateLink. You must specify this ID if you are using [AWS PrivateLink](https://aws.amazon.com/privatelink/) for either front-end (user-to-workspace connection), back-end (data plane to control plane connection), or both connection types.
   Before configuring PrivateLink, read the [<Databricks> article about PrivateLink](https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html).",
- `managed_services_customer_managed_key_id` (string, optional)
  The ID of the workspace's managed services encryption key configuration object. This is used to help protect and control access to the workspace's notebooks, secrets, Databricks SQL queries, and query history. The provided key configuration object property use_cases must contain MANAGED_SERVICES.
  Example: `849b3d6b-e68e-468d-b3e5-deb08b03c56d`
- `storage_customer_managed_key_id` (string, optional)
  The ID of the workspace's storage encryption key configuration object. This is used to encrypt the workspace's root S3 bucket (root DBFS and system data) and, optionally, cluster EBS volumes. The provided key configuration object property use_cases must contain STORAGE.
  Example: `849b3d6b-e68e-468d-b3e5-deb08b03c56d`
- `custom_tags` (object, optional)
  The custom tags key-value pairing that is attached to this workspace. The key-value pair is a string of utf-8 characters. The 
   value can be an empty string, with maximum length of 255 characters. The key can be of maximum length of 127 characters, and cannot be empty.
- `compute_mode` (string, optional)
  If the compute mode is `SERVERLESS`, a serverless workspace is created that comes pre-configured with serverless compute and default storage, providing a fully-managed, enterprise-ready SaaS experience. This means you don't need to provide any resources managed by you, such as credentials, storage, or network.
   If the compute mode is `HYBRID` (which is the default option), a classic workspace is created that uses customer-managed resources.
  Possible values: `HYBRID`, `SERVERLESS`
  Example: `SERVERLESS`
- `network_connectivity_config_id` (string, optional)
  The object ID of network connectivity config. Once assigned, the workspace serverless compute resources use the same set of stable IP CIDR blocks and optional private link to access your resources.
  Example: `0560fb5c-0ec3-4018-bd88-9820331d9eab`

## Returns

Returns the Workspace object.

## Response

```json
{
  "workspace_id": 0,
  "workspace_name": "string",
  "aws_region": "string",
  "creation_time": 0,
  "deployment_name": "string",
  "workspace_status": "string",
  "account_id": "string",
  "credentials_id": "string",
  "storage_configuration_id": "string",
  "workspace_status_message": "string",
  "network_id": "string",
  "gcp_managed_network_config": {
    "subnet_cidr": "string",
    "gke_cluster_pod_ip_range": "string",
    "gke_cluster_service_ip_range": "string"
  },
  "pricing_tier": "string",
  "private_access_settings_id": "string",
  "managed_services_customer_managed_key_id": "string",
  "storage_customer_managed_key_id": "string",
  "location": "string",
  "cloud": "string",
  "network": {
    "gcp_managed_network_config": {},
    "network_id": "string",
    "gcp_common_network_config": {}
  },
  "gke_config": {
    "connectivity_type": "string",
    "master_ip_range": "string"
  },
  "cloud_resource_container": {
    "gcp": {}
  },
  "custom_tags": {},
  "network_connectivity_config_id": "string",
  "storage_mode": "string",
  "compute_mode": "string"
}
```

