---
title: "Update a repository variable"
method: PATCH
path: "/repos/{owner}/{repo}/agents/variables/{name}"
tags: ["agents"]
---

# Update a repository variable

`PATCH /repos/{owner}/{repo}/agents/variables/{name}`

Updates a repository variable that you can reference in a GitHub Actions workflow.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.

## Path parameters

- `owner` string, required
- `repo` string, required
- `name` string, required

## Request body

- object
  - `name` string — The name of the variable.
  - `value` string — The value of the variable.

## Response `204`

Response

## Changes

> 62 revisions in range; 1 not diffed, 8 could not be searched.

- **2026-05-06** (2022-11-28) `283303416f96` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/github/apis/rest/changes/repos/:owner/:repo/agents/variables/:name/patch.md)

---

[API](https://skmtc.dev/github/apis/rest.md) · [All operations](https://skmtc.dev/github/apis/rest/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/github/rest/revisions/5bded2c77b93/schema)
