# Update a release asset

From **GitHub v3 REST API**.

`PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}`

Users with push access to the repository can edit a release asset.

## Parameters

### `owner`

- Location: path
- Required: true
- Type: `string`

### `repo`

- Location: path
- Required: true
- Type: `string`

### `asset_id`

- Location: path
- Required: true
- Type: `integer`

asset_id parameter

## Request body

- Required: false
### `application/json`

- Type: `object`

```json
{
  "label": "Mac binary",
  "name": "foo-1.0.0-osx.zip"
}
```

```json
{"properties":{"label":{"description":"An alternate short description of the asset. Used in place of the filename.","type":"string"},"name":{"description":"The file name of the asset.","type":"string"},"state":{"example":"\"uploaded\"","type":"string"}},"type":"object"}
```

## Responses

### `200`

Response

### `application/json`

- Type: `object`

Data related to a release.

```json
{
  "browser_download_url": "https://github.com/octocat/Hello-World/releases/download/v1.0.0/example.zip",
  "content_type": "application/zip",
  "created_at": "2013-02-27T19:35:32Z",
  "download_count": 42,
  "id": 1,
  "label": "short description",
  "name": "example.zip",
  "node_id": "MDEyOlJlbGVhc2VBc3NldDE=",
  "size": 1024,
  "state": "uploaded",
  "updated_at": "2013-02-27T19:35:32Z",
  "uploader": {
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    "followers_url": "https://api.github.com/users/octocat/followers",
    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    "gravatar_id": "",
    "html_url": "https://github.com/octocat",
    "id": 1,
    "login": "octocat",
    "node_id": "MDQ6VXNlcjE=",
    "organizations_url": "https://api.github.com/users/octocat/orgs",
    "received_events_url": "https://api.github.com/users/octocat/received_events",
    "repos_url": "https://api.github.com/users/octocat/repos",
    "site_admin": false,
    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    "type": "User",
    "url": "https://api.github.com/users/octocat"
  },
  "url": "https://api.github.com/repos/octocat/Hello-World/releases/assets/1"
}
```

```json
{"description":"Data related to a release.","properties":{"browser_download_url":{"format":"uri","type":"string"},"content_type":{"type":"string"},"created_at":{"format":"date-time","type":"string"},"download_count":{"type":"integer"},"id":{"type":"integer"},"label":{"nullable":true,"type":"string"},"name":{"description":"The file name of the asset.","example":"Team Environment","type":"string"},"node_id":{"type":"string"},"size":{"type":"integer"},"state":{"description":"State of the release asset.","enum":["uploaded","open"],"type":"string"},"updated_at":{"format":"date-time","type":"string"},"uploader":{"$ref":"#/components/schemas/nullable-simple-user"},"url":{"format":"uri","type":"string"}},"required":["id","name","content_type","size","state","url","node_id","download_count","label","uploader","browser_download_url","created_at","updated_at"],"title":"Release Asset","type":"object"}
```

## Request examples

### cURL

```shell
curl --request PATCH \
  --url {protocol}://{hostname}/api/v3/repos/{owner}/{repo}/releases/assets/{asset_id} \
  --header 'content-type: application/json' \
  --data '{
  "label": "Mac binary",
  "name": "foo-1.0.0-osx.zip"
}'
```
