Sample - GitHub REST API
PATCH/repos/{owner}/{repo}/releases/assets/{asset_id}

Update a release asset

Updates the metadata for a release asset in a repository. Use name, label, or state to change the asset's displayed filename, alternate description, or lifecycle state; omit fields you do not want to change. The authenticated user must have push access to the repository.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

3 parameters · 3 body fields
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.
asset_idintegerrequired
The unique identifier of the release asset to update.

Optional release asset metadata to update.

namestringoptional
The file name of the asset.
labelstringoptional
An alternate short description of the asset. Used in place of the filename.
statestringoptional
The lifecycle state to assign to the release asset.

1 status code
200Returns the updated release asset, including its identifiers, download URLs, filename, label, state, content type, size, digest, download count, timestamps, and uploader.
urlstringrequired
browser_download_urlstringrequired
idintegerrequired
node_idstringrequired
namestringrequired
The file name of the asset.
labelstringrequired
statestringrequired
State of the release asset.
Allowed:uploadedopen
content_typestringrequired
sizeintegerrequired
digeststringrequired
download_countintegerrequired
created_atstringrequired
updated_atstringrequired
uploaderobjectrequired
A GitHub user.

Error handling

owner, repo, and asset_id must identify an existing release asset, and repo must omit the .git extension. The request body is optional; if supplied, use name, label, or state as the asset metadata fields.