---
type: api
title: Set certificate based remote clusters
description: Overwrites or creates the list of certificate based remote clusters for the elasticsearch resource.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/operation/operation-set-deployment-es-resource-remote-clusters
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/operation/operation-set-deployment-es-resource-remote-clusters
products:
  - Elastic Cloud Enterprise
---

# Set certificate based remote clusters

## Paths

- `PUT` `/deployments/{deployment_id}/elasticsearch/{ref_id}/remote-clusters`

- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/authentication#basicauth)
- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/authentication#apikey)

#### Path Parameters

- `deployment_id` (string)
  Identifier for the Deployment.
- `ref_id` (string)
  User-specified RefId for the Resource (or '_main' if there is only one).

## Description

Overwrites or creates the list of certificate based remote clusters for the elasticsearch resource.

## Request Body

`application/json`

List of certificate based remote clusters for the resource

- `resources` ([] RemoteResourceRef) — required
  The remote resources
  - `deployment_id` (string) — required
    The id of the deployment
  - `elasticsearch_ref_id` (string) — required
    The locally-unique user-specified id of an Elasticsearch Resource
  - `alias` (string) — required
    The alias for this remote cluster. Aliases must only contain letters, digits, dashes and underscores
  - `skip_unavailable` (boolean) — optional
    If true, skip this cluster during search if it is disconnected. Default: false
  - `info` ({} RemoteResourceInfo) — optional
    Information about a Remote Cluster.
    - `healthy` (boolean) — required
      Whether or not the remote cluster is healthy
    - `connected` (boolean) — required
      Whether or not there is at least one connection to the remote cluster.
    - `compatible` (boolean) — required
      Whether or not the remote cluster version is compatible with this cluster version.
    - `trusted` (boolean) — required
      Whether or not the remote cluster is trusted by this cluster.
    - `trusted_back` (boolean) — required
      Whether or not the remote cluster trusts this cluster back.

## Responses

#### `202`

The Remote Clusters were updated

`application/json`

Type: `EmptyResponse`

#### `404`

* The Deployment specified by {deployment_id} cannot be found. (code: `deployments.deployment_not_found`)
* The Resource specified by {ref_id} cannot be found. (code: `deployments.deployment_resource_not_found`)

`application/json`

- `errors` ([] BasicFailedReplyElement)
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` ([] string)
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response Headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

## Code Examples

#### Console

```console
PUT /deployments/{deployment_id}/elasticsearch/{ref_id}/remote-clusters
```

#### curl

```curl
curl -X PUT "/deployments/{deployment_id}/elasticsearch/{ref_id}/remote-clusters"
```

