---
title: "Replace all repository topics"
method: PUT
path: "/repos/{owner}/{repo}/topics"
tags: ["repos"]
---

# Replace all repository topics

`PUT /repos/{owner}/{repo}/topics`

## Path parameters

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

## Request body

- object
  - `names` string[], required — An array of topics to add to the repository. Pass one or more topics to _replace_ the set of existing topics. Send an empty array (`[]`) to clear all topics from the repository. **Note:** Topic `names` will be saved as lowercase.

## Response `200`

Response

- Topic — A topic aggregates entities that are related to a subject.
  - `names` string[], required

## Other responses

- `404` — Resource not found
- `422` — Validation failed, or the endpoint has been spammed.

---

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