# patch

## Overview

This endpoint is used for updating information about a dataset's tables.

## HTTP Request

```http
PATCH /api/v1/workflows/:workflowReference/dataSources/:dataSourceReference
```

## Path parameters

| Parameter           |                                                                                                                                                               |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| workflowReference   | A qualified reference to the workflow. See [referencing resources](https://docs.redivis.com/api/referencing-resources) for more information.                  |
| dataSourceReference | <p>A qualified reference to the dataSource's current source dataset or workflow.<br><br>Alternatively, can provide the <code>id</code> of the dataSource.</p> |

{% hint style="info" %}
This endpoint extends the [general API structure](https://docs.redivis.com/api/rest-api/general-structure)
{% endhint %}

## Request body

Provide a JSON object with information about the dataSource.

<table><thead><tr><th width="206.20703125">Property name</th><th width="153.40755208333331">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>sourceDataset</strong></td><td><strong>string</strong></td><td><p>A qualified reference to the (new) source dataset for this dataSource. </p><p></p><p>Include version / sample information in the reference to update a dataSource's version or sample status.</p><p></p><p>Either a sourceDataset or sourceWorkflow must be provided, but not both.</p></td></tr><tr><td><strong>sourceWorkflow</strong></td><td><strong>string</strong></td><td><p>A qualified reference to the (new) source workflow for this dataSource. </p><p></p><p>Either a sourceDataset or sourceWorkflow must be provided, but not both.</p></td></tr><tr><td><strong>mappedTables</strong></td><td><strong>object</strong></td><td><p>An object whose keys represent the current tables that are referenced on the dataSource, and whose values represent the corresponding tables in the new source dataset or workflow. E.g.,</p><pre><code># Reference id suffixes are optional, but take precedence over names
{ "old_table:xje9": "new_table:a842" }
</code></pre><p>In many circumstances, tables can be automatically mapped based on their name and identifier, and this parameter isn't needed. <br><br>However, if a previously-referenced table doesn't exist under the new data source – e.g., a table is deleted in subsequent versions – you'll need to provide information so that any downstream notebooks or transforms can be updates.<br><br>It is only necessary to map tables that are referenced by a downstream node, not all tables associated with the dataSource.</p></td></tr></tbody></table>

## Authorization

Edit access to the corresponding workflow is required. Your access token must have the following scope:

* workflow\.write

[Learn more about authorization.](https://docs.redivis.com/api/rest-api/authorization)

## Response body

Returns the JSON-encoded "get" representation of a [dataSource resource](https://docs.redivis.com/api/resource-definitions/datasource).
