> 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/variables/patch.md).

# patch

## Overview

This endpoint is used for updating metadata on a variable.

## HTTP Request

```http
PATCH /api/v1/tables/:tableReference/variables/:variableName
```

## Path parameters

| Parameter      |                                                                                                                      |
| -------------- | -------------------------------------------------------------------------------------------------------------------- |
| tableReference | A qualified reference to the table. See [referencing resources](/api/referencing-resources.md) for more information. |
| variableName   | The name of the variable (case insensitive)                                                                          |

{% 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 fields are optional. To unset a value, specify `null` for the given property.

| Property name   | Type               | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| --------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **label**       | **string**         | A human-readable label for the variable. Must be less than or equal to 256 characters.                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| **description** | **string**         | A longer description of the variable. Must be less than or equal to 5,000 characters.                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **valueLabels** | **array\[object]** | <p>A mapping between values in the data and human readable labels. Passed as an array of objects, each with "value" and "label" properties. E.g., <br><code>\[{</code> <br>  <code>"value": "1",</code> <br>  <code>"label": "Yes"</code><br><code>},{</code><br>  <code>"value": "2"</code><br>  <code>"label": "No"</code><br><code>}]</code>. <br><br>The total length of all values + labels cannot exceed 1 million characters.<br><br>Passing an empty array will remove all value labels from the variable.</p> |

## Authorization

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

* data.edit

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

## Response body

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


---

# 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/variables/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.
