---
type: api
title: Create a Cloud Connected cluster.
description: Create a Cloud Connected cluster to onboard a self-managed cluster.
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/cloud-connect/operation/operation-createcluster
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/cloud-connect/operation/operation-createcluster
products:
  - Elastic Cloud Hosted
---

# Create a Cloud Connected cluster.

- Server: `https://api.elastic-cloud.com`

## Paths

- `POST` `/api/v1/cloud-connected/clusters`

## Description

Create a Cloud Connected cluster to onboard a self-managed cluster.

## Authentication

- Api key: `Authorization: <value>`
  API keys are used to authenticate requests to the Elastic Cloud Connected REST API.
  Generate your secret API key in https://cloud.elastic.co/account/keys
  You must provide the API key for all API requests in the Authorization header as follows:
  ```
  "Authorization: ApiKey $API_KEY"
  ```
  For example, if you interact with the API using the curl command:
  ```
  curl -H "Authorization: ApiKey essu_..." https://api.elastic-cloud.com/api/v1/cloud-connected/clusters
  ```

## Query string parameters

- `create_api_key` (boolean · default: false) — optional
  If true, the response will return an API Key with cloud-connected-admin permissions scoped to the cluster being created. This API Key will be revoked when the cluster is disconnected.

## Request body

Configuration of the Cloud Connected cluster to create.

`application/json`

- `name` (string · max length: 255) — optional
  Descriptive name for a Cloud Connected cluster.
- `self_managed_cluster` (object) — required
  A self-managed cluster.
  - `id` (string) — required
    ID of the self-managed cluster.
  - `name` (string) — required
    Descriptive name for a self managed cluster.
  - `version` (string) — required
    The version of the self-managed cluster.
- `license` (object) — required
  The license of the self-managed cluster
  - `type` (enum) — required
    The type of the self-managed cluster license.
    Values: `trial`, `basic`, `standard`, `dev`, `silver`, `gold`, `platinum`, `enterprise`
  - `uid` (string) — required
    The unique identifier of the self-managed cluster license.

## Responses

#### `200`

The Cloud Connected cluster already existed.

`application/json`

- `id` (string · pattern: ^[a-z0-9]{32}$)
  ID of the Cloud Connected cluster.
- `name` (string · max length: 255)
  Descriptive name for a Cloud Connected cluster.
- `metadata` (object)
  Additional details about the Cloud Connected cluster.
  - `created_at` (string · format: date-time)
    Date and time when the cluster was onboarded.
  - `created_by` (string)
    ID of the user.
  - `organization_id` (string · pattern: ^[a-z0-9]{1,32}$)
    The Organization ID which owns the cluster.
- `self_managed_cluster` (object)
  A self-managed cluster.
  - `id` (string)
    ID of the self-managed cluster.
  - `name` (string)
    Descriptive name for a self managed cluster.
  - `version` (string)
    The version of the self-managed cluster.
- `license` (object)
  The license of the self-managed cluster
  - `type` (enum)
    The type of the self-managed cluster license.
    Values: `trial`, `basic`, `standard`, `dev`, `silver`, `gold`, `platinum`, `enterprise`
  - `uid` (string)
    The unique identifier of the self-managed cluster license.
- `services` (object)
  A list of Cloud services that can be enabled for a cluster.
  - `auto_ops` (object)
    Information about the state and configuration for the AutoOps service
    - `enabled` (boolean)
      whether the AutoOps service is enabled for the cluster
    - `support` (object)
      Information about whether a service is supported for a cluster
      - `supported` (boolean)
        whether the service can be enabled for the cluster
      - `valid_license_types` (enum[])
        list of license types that support the service.
        Values: `trial`, `basic`, `standard`, `dev`, `silver`, `gold`, `platinum`, `enterprise`
      - `minimum_stack_version` (string)
        minimum stack version that supports the service.
    - `config` (object)
      Configuration for the AutoOps service
      - `region_id` (string)
        Unique human-readable identifier for a region in Elastic Cloud.
    - `metadata` (object)
      Metadata information for the AutoOps service, including documentation and service URLs
      - `documentation_url` (string · format: uri)
        URL to the service documentation
      - `service_url` (string · format: uri)
        URL to access the service for this cluster.
      - `connect_url` (string · format: uri)
        URL to connect to the service.
    - `subscription` (object)
      Subscription requirements for a service.
      - `required` (boolean)
        Whether a subscription is required for this service.
  - `eis` (object)
    Information about the state and configuration for the EIS service
    - `enabled` (boolean)
      whether the EIS service is enabled for the cluster
    - `support` (object)
      Information about whether a service is supported for a cluster
      - `supported` (boolean)
        whether the service can be enabled for the cluster
      - `valid_license_types` (enum[])
        list of license types that support the service.
        Values: `trial`, `basic`, `standard`, `dev`, `silver`, `gold`, `platinum`, `enterprise`
      - `minimum_stack_version` (string)
        minimum stack version that supports the service.
    - `metadata` (object)
      Base metadata information for a service, including documentation URL
      - `documentation_url` (string · format: uri)
        URL to the service documentation
    - `subscription` (object)
      Subscription requirements for a service.
      - `required` (boolean)
        Whether a subscription is required for this service.
- `key` (string)
  The API Key to manage the Cloud Connected cluster.
##### Response headers

- `ETag` (string)

#### `201`

The created Cloud Connected cluster.

`application/json`

- `id` (string · pattern: ^[a-z0-9]{32}$)
  ID of the Cloud Connected cluster.
- `name` (string · max length: 255)
  Descriptive name for a Cloud Connected cluster.
- `metadata` (object)
  Additional details about the Cloud Connected cluster.
  - `created_at` (string · format: date-time)
    Date and time when the cluster was onboarded.
  - `created_by` (string)
    ID of the user.
  - `organization_id` (string · pattern: ^[a-z0-9]{1,32}$)
    The Organization ID which owns the cluster.
- `self_managed_cluster` (object)
  A self-managed cluster.
  - `id` (string)
    ID of the self-managed cluster.
  - `name` (string)
    Descriptive name for a self managed cluster.
  - `version` (string)
    The version of the self-managed cluster.
- `license` (object)
  The license of the self-managed cluster
  - `type` (enum)
    The type of the self-managed cluster license.
    Values: `trial`, `basic`, `standard`, `dev`, `silver`, `gold`, `platinum`, `enterprise`
  - `uid` (string)
    The unique identifier of the self-managed cluster license.
- `services` (object)
  A list of Cloud services that can be enabled for a cluster.
  Same fields as `services`
- `key` (string)
  The API Key to manage the Cloud Connected cluster.
##### Response headers

- `ETag` (string)

#### `400`

Bad request

`application/json`

- `errors` (object[])
  - `message` (string)
    A human-readable message of the error.
  - `code` (string)
    An identifier for this type of error.
#### `401`

Unauthorized

`application/json`

- `errors` (object[])
  - `message` (string)
    A human-readable message of the error.
  - `code` (string)
    An identifier for this type of error.
#### `403`

Forbidden

`application/json`

- `errors` (object[])
  - `message` (string)
    A human-readable message of the error.
  - `code` (string)
    An identifier for this type of error.
#### `422`

Unprocessable entity

`application/json`

- `errors` (object[])
  - `message` (string)
    A human-readable message of the error.
  - `code` (string)
    An identifier for this type of error.
## Code examples

#### curl

```curl
curl -X POST "https://api.elastic-cloud.com/api/v1/cloud-connected/clusters" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "self_managed_cluster": {
      "id": "string",
      "name": "observability-cluster-central-2",
      "version": "8.10.1"
    },
    "license": {
      "type": "trial",
      "uid": "1234567890abcdef1234567890abcdef"
    }
  }'
```

