> For the complete documentation index, see [llms.txt](https://docs.redivis.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.redivis.com/api/rest-api/datasets/patch.md).

# patch

## Overview

This endpoint is used for updating information about a dataset

## HTTP Request

```http
PATCH /api/v1/datasets/:datasetReference
```

## Path parameters

| Parameter        |                                                                                                                        |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------- |
| datasetReference | A qualified reference to the dataset. See [referencing resources](/api/referencing-resources.md) for more information. |

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

## Request body

Provide a JSON object with the properties you would like to update. All properties are optional, and only the properties that are provided will be updated.

| Property name           | Type          | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ----------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **name**                | **string**    | The name of the dataset. Must be unique (non-word characters ignored) within the user or organization that owns the dataset.                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| **publicAccessLevel**   | **string**    | <p>The public access level of the dataset. Must be one of:</p><ul><li><strong>none</strong> - Only specific people will be able to see the existence of the dataset.</li><li><strong>overview</strong> - Anyone can see the existence of the dataset</li><li><strong>metadata</strong> - Anyone can view any variables and summary statistics on the dataset.</li><li><strong>sample</strong> - Anyone can view, query, and download the dataset's sample data.</li><li><strong>data</strong> - Anyone can view, query, and download the dataset's data.</li></ul> |
| **description**         | **string**    | A short description of the dataset that will show up in search results. Limited to 256 characters. Pass an empty string to clear the description.                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **methodologyMarkdown** | **string**    | Free text, using markdown format, containing methodological information about the dataset.                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **usageMarkdown**       | **string**    | Free text, using markdown format, containing usage information about the dataset.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **labels**              | **string\[]** | A list of labels to assign to the dataset, replacing any existing labels. Labels cannot contain spaces, and may have a single colon to delineate a categorical label (e.g., `quality:good`). Labels are case-insensitive, and are stored lowercase. Cannot be combined with `labelsToAdd` or `labelsToRemove`.                                                                                                                                                                                                                                                     |
| **labelsToAdd**         | **string\[]** | A list of labels to add to the dataset, keeping any existing labels. Cannot be combined with `labels`.                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **labelsToRemove**      | **string\[]** | A list of labels to remove from the dataset. Labels that aren't on the dataset are ignored. Cannot be combined with `labels`, and a label can't appear in both `labelsToAdd` and `labelsToRemove`.                                                                                                                                                                                                                                                                                                                                                                 |
| **tags**                | **string\[]** | A list of tags to assign to the dataset, replacing any existing tags. Tags are case-insensitive, and are stored lowercase. Cannot be combined with `tagsToAdd` or `tagsToRemove`.                                                                                                                                                                                                                                                                                                                                                                                  |
| **tagsToAdd**           | **string\[]** | A list of tags to add to the dataset, keeping any existing tags. Cannot be combined with `tags`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| **tagsToRemove**        | **string\[]** | A list of tags to remove from the dataset. Tags that aren't on the dataset are ignored. Cannot be combined with `tags`, and a tag can't appear in both `tagsToAdd` and `tagsToRemove`.                                                                                                                                                                                                                                                                                                                                                                             |

{% hint style="info" %}
The `description`, `methodologyMarkdown`, `usageMarkdown`, and tags are documented separately for each version of the dataset, and are applied to the version identified by `datasetReference`.
{% endhint %}

{% hint style="warning" %}
A dataset can have at most 25 labels, and each version of a dataset can have at most 25 tags.
{% endhint %}

## Authorization

You must have edit access to the dataset, and your access token must have the following scope:

* data.edit

Labels can only be assigned to datasets owned by an organization. To update labels, you must be an administrator of that organization, and your access token must also have the `organization.write` scope.

[Learn more about authorization.](/api/rest-api/authorization.md)

## Response body

Returns the JSON-encoded "get" representation of a [dataset resource](/api/resource-definitions/dataset.md).

## Examples

{% tabs %}
{% tab title="curl" %}

```bash
# Add a tag to a dataset, and remove one of its labels
curl -X PATCH \
  -H "Authorization: Bearer $REDIVIS_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"tagsToAdd": ["health"], "labelsToRemove": ["status:draft"]}' \
  "https://redivis.com/api/v1/datasets/my_organization.my_dataset"
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.redivis.com/api/rest-api/datasets/patch.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
