---
type: api
title: Update trust relationship
description: Updates a trust relationship.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/v4/operation/operation-update-trust-relationship
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/v4/operation/operation-update-trust-relationship
products:
  - Elastic Cloud Enterprise
---

# Update trust relationship

## Paths

- `PUT` `/platform/configuration/trust-relationships/{trust_relationship_id}`

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

#### Path Parameters

- `trust_relationship_id` (string)
  Identifier for the trust relationship

## Description

Updates a trust relationship.

## Request Body

`application/json`

The trust relationship definition

- `name` (string) — optional
  A name for the trust relationship
- `trust_by_default` (boolean) — optional
  If this relationship is trusted by default by all deployments in the current environment.
- `account_ids` ([] string) — optional
  The ID of the accounts to trust by this relationship.
- `public_ca_cert` (string) — optional
  The public CA certificate of the environment to trust
- `installation_id` (string) — optional
  The installation ID of the environment to trust

## Responses

#### `200`

The request was valid and the trust relationship was updated.

`application/json`

- `id` (string)
  The id of the trust relationship
- `name` (string)
  The name of the trust relationship
- `trust_by_default` (boolean)
  If this relationship is trusted by default by all deployments in the current environment.
- `account_ids` ([] string)
  The ID of the accounts trusted by this relationship.
- `local` (boolean)
  If this is the trust relationship for the local environment
- `installation_id` (string)
  The installation ID of the environment to trust
##### Response Headers

- `x-cloud-resource-version` (string)
  The resource version, which is used to avoid update conflicts with concurrent operations
- `x-cloud-resource-created` (string)
  The date-time when the resource was created (ISO format relative to UTC)
- `x-cloud-resource-last-modified` (string)
  The date-time when the resource was last modified (ISO format relative to UTC)

#### `400`

The trust relationship request had errors.

`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
#### `401`

You are not authorized to perform this action.

`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
#### `404`

The trust relationship specified by {trust_relationship_id} cannot be found. (code: `trust_relationships.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 /platform/configuration/trust-relationships/{trust_relationship_id}
```

#### curl

```curl
curl -X PUT "/platform/configuration/trust-relationships/{trust_relationship_id}"
```

