Upload a release asset

POST {{origin}}/repos/:owner/:repo/releases/:release_id/assets?name=<string>&label=<string>

This endpoint makes use of a Hypermedia relation to determine which URL to access. The endpoint you call to upload release assets is specific to your release. Use the upload_url returned in the response of the Create a release endpoint to upload a release asset.

You need to use an HTTP client which supports SNI to make calls to this endpoint.

Most libraries will set the required Content-Length header automatically. Use the required Content-Type header to provide the media type of the asset. For a list of media types, see Media Types. For example:

application/zip

GitHub expects the asset data in its raw binary form, rather than JSON. You will send the raw binary content of the asset as the request body. Everything else about the endpoint is the same as the rest of the API. For example, you'll still need to pass your authentication to be able to upload an asset.

When an upstream failure occurs, you will receive a 502 Bad Gateway status. This may leave an empty asset with a state of starter. It can be safely deleted.

Notes: * GitHub renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. The [List assets for a release](https://developer.github.com/v3/repos/releases/#list-assets-for-a-release) endpoint lists the renamed filenames. For more information and help, contact GitHub Support. * If you upload an asset with the same filename as another uploaded asset, you'll receive an error and must delete the old file before you can re-upload the new asset.

Request Params

KeyDatatypeRequiredDescription
namestringname parameter
labelstringlabel parameter

Request Body

["<", "s", "t", "r", "i", "n", "g", ">"]

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring

RESPONSES

status: Created

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