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

Replace all repository topics

Replaces all topics associated with a repository. Supply names with the complete topic list; send an empty array to clear all topics, and note that topic names are saved as lowercase.

2 parameters · 1 body field
ownerstringrequired
The account owner of the repository; the name is not case-sensitive.
repostringrequired
The repository name without the `.git` extension; the name is not case-sensitive.

The complete set of repository topics to apply.

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

3 status codes
200Returns an object containing the repository's updated topic names.
namesarray<string>required
404Returned when the repository cannot be found.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
422Returned when validation fails or the endpoint has been spammed.
messagestringrequired
documentation_urlstringrequired
errorsarray<string>optional

Error handling

A 404 is returned when the repository cannot be found. A 422 is returned when validation fails or the endpoint has been spammed. The names body field is required and must be an array of strings; pass [] to clear all topics, and topic names are saved as lowercase.