# Update destination

`PATCH /v1/destinations/{destinationId}`

Available as MCP tool `update-destination` (Replace).

Destination endpoints allow you to review and manage destinations in a specified environment. 

You must be a member of the environment and be assigned to an engineer role to manage destinations. [Learn about roles](https://docs.redoxengine.com/permalink/1OBel3inQAjAnDbgd9QLzM). 

### Update destination

Replace the auth credential of an existing destination within the specified environment. You must use the correct destination and environment identifiers.

## Request parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `destinationId` | path | string | Yes | Displays the unique identifier of the destination that's configured to receive data from Redox. |

## Request body

Contains the fields that can be provided when updating a destination.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | No | Displays the human-readable name of the endpoint that will receive messages from Redox. |
| `authCredential` | string (uuid) | No | Displays the unique identifier of the destination's attached auth credential, if any. |
| `endpoint` | string | No | Contains the URL of the endpoint that will receive messages from Redox. Production and staging applications must use HTTPS. |
| `verificationToken` | string | No | Contains the unique value that Redox sends in the message header to authenticate itself to a destination. |

## Request example

_Generated from the schema: the values are placeholders, not a real payload._

```bash
curl 'https://api.redoxengine.com/platform/v1/destinations/{destinationId}' \
--request PATCH \
--header 'Authorization: Bearer $API_TOKEN' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
  "name": "string",
  "authCredential": "95dc8346-96b6-4721-88bf-bd96d3ac7a91",
  "endpoint": "string",
  "verificationToken": "string"
}'
```

## Responses

### 200

Contains a payload object with the updated details for the specified destination.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `meta` | object | No |  |
| `meta.version` | string | No | Lists the major and minor version number for the format of the returned payload. The payload format or shape may change between minor versions, like including additional or extended fields in later versions. We include the version data in each response so that you have the option to handle the signaled differences. |
| `payload` | object | No | Contains the payload with details about the requested destination. |
| `payload.destination` | object | No | Contains an instance of a destination. |
| `payload.destination.id` | string (uuid) | No | Displays the unique identifier of the endpoint that will receive messages from Redox. |
| `payload.destination.name` | string | No | Displays the human-readable name of the endpoint that will receive messages from Redox. |
| `payload.destination.authCredential` | string (uuid) | No | Displays the unique identifier of the destination's attached auth credential, if any. |
| `payload.destination.endpoint` | string | No | Contains the URL of the endpoint that will receive messages from Redox. Production and staging applications must use HTTPS. |
| `payload.destination.environment` | object | No | Contains metadata about the environment within the associated Redox organization. |
| `payload.destination.environment.id` | string (uuid) | No | Contains the unique identifier of the Redox environment. |
| `payload.destination.environment.environmentFlag` | string | No | Indicates whether the environment is used for development, staging, or production. Possible values: Production, Staging, Development |
| `payload.destination.cloudProviderSettings` | Azure Databricks or Azure Fabric or Azure Health Data Service or Azure Snowflake or GCP Databricks or GCP Cloud Healthcare or GCP Cloud Storage or GCP Snowflake or AWS Databricks or AWS S3 or AWS HealthLake or AWS Snowflake | No | Contains all the relevant configuration fields for the selected cloud provider and cloud product(s). |
| `payload.destination.cloudProviderSettings (Azure Databricks).typeId` | string | Yes | Specifies the cloud provider (i.e., Azure). Value: azure |
| `payload.destination.cloudProviderSettings (Azure Databricks).productId` | string | Yes | Specifies the cloud product being used with Azure. Value: databricks |
| `payload.destination.cloudProviderSettings (Azure Databricks).settings` | object | No | Contains the configuration details for Microsoft Azure. |
| `payload.destination.cloudProviderSettings (Azure Databricks).settings.containerName` | string | No | Defines the name of the container created in Azure. |
| `payload.destination.cloudProviderSettings (Azure Databricks).settings.fileNamePrefix` | string | No | Provides a prefix to prepend to new files when they're created in Azure. Add / to put files in a subdirectory. |
| `payload.destination.cloudProviderSettings (Azure Databricks).settings.storageAccountName` | string | No | Defines the name of the storage account created in Azure. |
| `payload.destination.cloudProviderSettings (Azure Fabric).typeId` | string | Yes | Specifies the cloud provider (i.e., Azure). Value: azure |
| `payload.destination.cloudProviderSettings (Azure Fabric).productId` | string | Yes | Specifies the cloud product being used with Azure. Value: fabric |
| `payload.destination.cloudProviderSettings (Azure Fabric).settings` | object | No | Contains the configuration details for Microsoft Azure. |
| `payload.destination.cloudProviderSettings (Azure Fabric).settings.containerName` | string | No | Defines the name of the container created in Azure. |
| `payload.destination.cloudProviderSettings (Azure Fabric).settings.fileNamePrefix` | string | No | Provides a prefix to prepend to new files when they're created in Azure. Add / to put files in a subdirectory. |
| `payload.destination.cloudProviderSettings (Azure Fabric).settings.storageAccountName` | string | No | Defines the name of the storage account created in Azure. |
| `payload.destination.cloudProviderSettings (Azure Health Data Service).typeId` | string | Yes | Specifies the cloud provider (i.e., Azure). |
| `payload.destination.cloudProviderSettings (Azure Health Data Service).productId` | string | Yes | Specifies the cloud product being used with Azure. Value: health-data-services |
| `payload.destination.cloudProviderSettings (Azure Health Data Service).settings` | object | No | Contains the configuration details for Microsoft Azure. |
| `payload.destination.cloudProviderSettings (Azure Health Data Service).settings.fhirBaseUrl` | string | No | Specifies the Azure FHIR endpoint where data should be sent. Append the URL with either `/Bundle` or `/fhir`, depending on the message type you plan to receive at this destination. |
| `payload.destination.cloudProviderSettings (Azure Snowflake).typeId` | string | Yes | Specifies the cloud provider (i.e., Azure). Value: azure |
| `payload.destination.cloudProviderSettings (Azure Snowflake).productId` | string | Yes | Specifies the cloud product being used with Azure. Value: snowflake |
| `payload.destination.cloudProviderSettings (Azure Snowflake).settings` | object | No | Contains the configuration details for Microsoft Azure. |
| `payload.destination.cloudProviderSettings (Azure Snowflake).settings.containerName` | string | No | Defines the name of the container created in Azure. |
| `payload.destination.cloudProviderSettings (Azure Snowflake).settings.fileNamePrefix` | string | No | Provides a prefix to prepend to new files when they're created in Azure. Add / to put files in a subdirectory. |
| `payload.destination.cloudProviderSettings (Azure Snowflake).settings.storageAccountName` | string | No | Defines the name of the storage account created in Azure. |
| `payload.destination.cloudProviderSettings (GCP Databricks).typeId` | string | No | Specifies the cloud provider (i.e., GCP). Value: gcp |
| `payload.destination.cloudProviderSettings (GCP Databricks).productId` | string | No | Specifies the cloud product being used with GCP. Value: databricks |
| `payload.destination.cloudProviderSettings (GCP Databricks).settings` | object | No | Contains the configuration details for GCP. |
| `payload.destination.cloudProviderSettings (GCP Databricks).settings.bucketName` | string | No | Defines the name of the GCS bucket created in GCP. |
| `payload.destination.cloudProviderSettings (GCP Databricks).settings.fileNamePrefix` | string | No | Provides a prefix to prepend to new files when they're created in GCP. Add / to put files in a subdirectory. |
| `payload.destination.cloudProviderSettings (GCP Cloud Healthcare).typeId` | string | Yes | Specifies the cloud provider (i.e., GCP). Value: gcp |
| `payload.destination.cloudProviderSettings (GCP Cloud Healthcare).productId` | string | Yes | Specifies the cloud product being used with GCP. Value: cloud-healthcare-api |
| `payload.destination.cloudProviderSettings (GCP Cloud Healthcare).settings` | object | No | Contains the configuration details for GCP. |
| `payload.destination.cloudProviderSettings (GCP Cloud Healthcare).settings.location` | string | No | Defines the GCP location name for your FHIR store. |
| `payload.destination.cloudProviderSettings (GCP Cloud Healthcare).settings.datasetId` | string | No | Defines the ID of the dataset that contains of your FHIR store. |
| `payload.destination.cloudProviderSettings (GCP Cloud Healthcare).settings.projectId` | string | No | Defines the ID of the project created in GCP. |
| `payload.destination.cloudProviderSettings (GCP Cloud Healthcare).settings.fhirStoreId` | string | No | Defines the ID of the FHIR store created in GCP. |
| `payload.destination.cloudProviderSettings (GCP Cloud Storage).typeId` | string | No | Specifies the cloud provider (i.e., GCP). Value: gcp |
| `payload.destination.cloudProviderSettings (GCP Cloud Storage).productId` | string | No | Specifies the cloud product being used with GCP. Value: cloud-storage |
| `payload.destination.cloudProviderSettings (GCP Cloud Storage).settings` | object | No | Contains the configuration details for GCP. |
| `payload.destination.cloudProviderSettings (GCP Cloud Storage).settings.bucketName` | string | No | Defines the name of the GCS bucket created in GCP. |
| `payload.destination.cloudProviderSettings (GCP Cloud Storage).settings.fileNamePrefix` | string | No | Provides a prefix to prepend to new files when they're created in GCP. Add / to put files in a subdirectory. |
| `payload.destination.cloudProviderSettings (GCP Snowflake).typeId` | string | No | Specifies the cloud provider (i.e., GCP). Value: gcp |
| `payload.destination.cloudProviderSettings (GCP Snowflake).productId` | string | No | Specifies the cloud product being used with GCP. Value: snowflake |
| `payload.destination.cloudProviderSettings (GCP Snowflake).settings` | object | No | Contains the configuration details for GCP. |
| `payload.destination.cloudProviderSettings (GCP Snowflake).settings.bucketName` | string | No | Defines the name of the GCS bucket created in GCP. |
| `payload.destination.cloudProviderSettings (GCP Snowflake).settings.fileNamePrefix` | string | No | Provides a prefix to prepend to new files when they're created in GCP. Add / to put files in a subdirectory. |
| `payload.destination.cloudProviderSettings (AWS Databricks).typeId` | string | No | Specifies the cloud provider (i.e., AWS). Value: aws |
| `payload.destination.cloudProviderSettings (AWS Databricks).productId` | string | No | Specifies the cloud product being used with AWS. Value: databricks |
| `payload.destination.cloudProviderSettings (AWS Databricks).settings` | object | No | Contains the configuration details for AWS. |
| `payload.destination.cloudProviderSettings (AWS Databricks).settings.bucketName` | string | No | Defines the name of the S3 bucket created in AWS. |
| `payload.destination.cloudProviderSettings (AWS Databricks).settings.keyPrefix` | string | No | Provides a prefix to prepend to new files when they're created in AWS. Add / to put files in a subdirectory. |
| `payload.destination.cloudProviderSettings (AWS S3).typeId` | string | No | Specifies the cloud provider (i.e., AWS). Value: aws |
| `payload.destination.cloudProviderSettings (AWS S3).productId` | string | No | Specifies the cloud product being used with AWS. Value: s3 |
| `payload.destination.cloudProviderSettings (AWS S3).settings` | object | No | Contains the configuration details for AWS. |
| `payload.destination.cloudProviderSettings (AWS S3).settings.bucketName` | string | No | Defines the name of the S3 bucket created in AWS. |
| `payload.destination.cloudProviderSettings (AWS S3).settings.keyPrefix` | string | No | Provides a prefix to prepend to new files when they're created in AWS. Add / to put files in a subdirectory. |
| `payload.destination.cloudProviderSettings (AWS HealthLake).typeId` | string | No | Specifies the cloud provider (i.e., AWS). Value: aws |
| `payload.destination.cloudProviderSettings (AWS HealthLake).productId` | string | No | Specifies the cloud product being used with AWS. Value: healthlake |
| `payload.destination.cloudProviderSettings (AWS HealthLake).settings` | object | No | Contains the configuration details for AWS. |
| `payload.destination.cloudProviderSettings (AWS HealthLake).settings.fhirBaseUrl` | string | No | Specifies the AWS FHIR endpoint where data should be sent. |
| `payload.destination.cloudProviderSettings (AWS Snowflake).typeId` | string | No | Specifies the cloud provider (i.e., AWS). Value: aws |
| `payload.destination.cloudProviderSettings (AWS Snowflake).productId` | string | No | Specifies the cloud product being used with AWS. Value: snowflake |
| `payload.destination.cloudProviderSettings (AWS Snowflake).settings` | object | No | Contains the configuration details for AWS. |
| `payload.destination.cloudProviderSettings (AWS Snowflake).settings.bucketName` | string | No | Defines the name of the S3 bucket created in AWS. |
| `payload.destination.cloudProviderSettings (AWS Snowflake).settings.keyPrefix` | string | No | Provides a prefix to prepend to new files when they're created in AWS. Add / to put files in a subdirectory. |
| `payload.destination.setupState` | object, nullable | No | Describes the current state of configuration for a destination in your Redox organization. |
| `payload.destination.setupState.step` | string | No | Indicates which step the user is on in the configuration process. |
| `payload.destination.setupState.destination` | object | No | Contains the details about the destination. |
| `payload.destination.setupState.destination.authCredential` | string (uuid), nullable | No | Displays the unique identifier of the destination's attached auth credential, if any. |
| `payload.destination.setupState.destination.cloudProviderSettings` | object, nullable | No |  |
| `payload.destination.setupState.destination.id` | string (uuid), nullable | No | Displays the unique identifier of the endpoint that will receive messages from Redox. |
| `payload.destination.setupState.destination.name` | string, nullable | No | Displays the human-readable name of the endpoint that will receive messages from Redox. |
| `payload.destination.setupState.destination.environment` | object, nullable | No | Contains metadata about the environment within the associated Redox organization. |
| `payload.destination.setupState.destination.environment.id` | string (uuid) | No | Contains the unique identifier of the Redox environment. |
| `payload.destination.setupState.destination.environment.environmentFlag` | string | No | Indicates whether the environment is used for development, staging, or production. Possible values: Production, Staging, Development |
| `payload.destination.verified` | boolean | No | Indicates whether a destination has been successfully verified and can receive data. |

_Generated from the schema: the values are placeholders, not a real payload._

```json
{
  "meta": {
    "version": "1.0.0"
  },
  "payload": {
    "destination": {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "name": "string",
      "authCredential": "95dc8346-96b6-4721-88bf-bd96d3ac7a91",
      "endpoint": "string",
      "environment": {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "environmentFlag": "Staging"
      },
      "cloudProviderSettings": {
        "typeId": "azure",
        "productId": "databricks",
        "settings": {
          "containerName": "string",
          "fileNamePrefix": "string",
          "storageAccountName": "string"
        }
      },
      "setupState": {
        "step": "string",
        "destination": {
          "authCredential": "95dc8346-96b6-4721-88bf-bd96d3ac7a91",
          "cloudProviderSettings": {},
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
          "name": "string",
          "environment": {
            "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
            "environmentFlag": "Staging"
          }
        }
      },
      "verified": true
    }
  }
}
```

### 400

Bad Request

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `payload` | object | No | Contains the error message. |
| `payload.error` | object | No | Contains the error message details. |
| `payload.error.id` | string | No | Contains a unique identifier for the given error instance. |
| `payload.error.title` | string | No | Displays the high-level error message, typically something succinct like `Bad Request`. |
| `payload.error.code` | string | No | Contains an alternative ID for the error type, which can be used to find relevant troubleshooting information. |
| `payload.error.detail` | string | No | Contains the specific error details for this message. |
| `payload.error.status` | number | No | Displays the corresponding HTTP status code for the error. |
| `payload.error.transient` | boolean | No | Describes whether the error will resolve itself. If `true`, no further action needs to be taken. If `false`, you may need to troubleshoot on your end to resolve the issue before the error can be processed. |

```json
{
  "payload": {
    "error": {
      "title": "Bad Request",
      "code": "validation.error.bad.request",
      "detail": "Error details",
      "status": 400,
      "transient": false
    }
  }
}
```

### 403

Forbidden

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `payload` | object | No | Contains the error message. |
| `payload.errors` | Array of object | No |  |
| `payload.errors[].title` | string | No | Displays the high-level error message, typically something succinct like `Forbidden`. |
| `payload.errors[].code` | string | No | Contains an alternative ID for the error type, which can be used to find relevant troubleshooting information. |

```json
{
  "payload": {
    "errors": [
      {
        "title": "Forbidden",
        "code": "authorization.forbidden"
      }
    ]
  }
}
```

### 500

Internal Server Error

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `payload` | object | No | Contains the error message. |
| `payload.error` | object | No | Contains the error message details. |
| `payload.error.title` | string | No | Displays the high-level error message, typically something succinct like `Failed in step X`. |
| `payload.error.code` | string | No | Contains an alternative ID for the error type, which can be used to find relevant troubleshooting information. |
| `payload.error.detail` | string | No | Contains the specific error details for this message. |
| `payload.error.status` | number | No | Displays the corresponding HTTP status code for the error. |
| `payload.error.transient` | boolean | No | Describes whether the error will resolve itself. If `true`, no further action needs to be taken. If `false`, you may need to troubleshoot on your end to resolve the issue before the error can be processed. |

```json
{
  "payload": {
    "error": {
      "title": "Internal Server Error",
      "code": "failed.db.lookup",
      "detail": "Error details",
      "status": 500,
      "transient": true
    }
  }
}
```
