---
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

---

[API](https://skmtc.net/github/apis/rest-api.md) · [All operations](https://skmtc.net/github/apis/rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/rest-api/versions/80850db290cd/schema)
