---
title: "(BETA) Update the data source of an AILake Database instance"
method: PATCH
path: "/api/v1/ailake/database/instances/{instanceId}/dataSource"
tags: ["AI Lake - Databases"]
---

# (BETA) Update the data source of an AILake Database instance

`PATCH /api/v1/ailake/database/instances/{instanceId}/dataSource`

## Request

- Base URL: `https://www.gooddata.ai`
- URL: `https://www.gooddata.ai/api/v1/ailake/database/instances/{instanceId}/dataSource`
- Auth: none declared

(BETA) Updates the data source ID and name for an existing AI Lake database instance without deleting the underlying database. Use this to recover from a wrong data source ID provisioned on an existing database instance.

## Path parameters

- `instanceId` string, required: Database instance identifier. Accepts the database name (preferred) or UUID.

## Request body

- UpdateDatabaseDataSourceRequest: Request to update the data source associated with an AI Lake Database instance
  - `dataSourceId` string, required: New identifier for the data source in metadata-api. Must be unique within the organization.
  - `dataSourceName` string: New display name for the data source in metadata-api. Defaults to dataSourceId when omitted.
  - `oldDataSourceId` string, required: Identifier of the existing data source to replace.

## Response `200`

Data source successfully updated

- UpdateDatabaseDataSourceResponse: Updated data source details for an AI Lake Database instance
  - `dataSourceId` string, required: New identifier of the data source in metadata-api.
  - `dataSourceName` string, required: New display name of the data source in metadata-api.

---

[API](https://skmtc.dev/gooddata/apis/gooddata-cn-oapi-all-api.md) - [All operations](https://skmtc.dev/gooddata/apis/gooddata-cn-oapi-all-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gooddata/apis/gooddata-cn-oapi-all-api/revisions/c728ef303bfb?raw)
