GitHub v3 REST API

List release assets

get
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/releases/{release_id}/assets

Query Parameters

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Path Parameters

ownerstringrequired
repostringrequired
release_idintegerrequired

release_id parameter

Response

200 application/json

Response

Data related to a release.

urlstring(uri)required
browser_download_urlstring(uri)required
idintegerrequired
node_idstringrequired
namestringrequired

The file name of the asset.

Example:Team Environment

labelstring | nullrequired
statestringrequired

State of the release asset.

Allowed values:uploadedopen

content_typestringrequired
sizeintegerrequired
download_countintegerrequired
created_atstring(date-time)required
updated_atstring(date-time)required
uploaderobject | nullrequired

Simple User

Show Child Parameters
get/repos/{owner}/{repo}/releases/{release_id}/assets
 
200 application/json

Upload a release asset

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 Enterprise Server 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 Enterprise Server renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. The “List assets for a release
    endpoint lists the renamed filenames. For more information and help, contact GitHub Enterprise Server 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.
post
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/releases/{release_id}/assets

Query Parameters

namestringrequired
labelstring

Path Parameters

ownerstringrequired
repostringrequired
release_idintegerrequired

release_id parameter

Body

*/*
string

The raw file data

Response

application/json

Response for successful upload

Release Asset

Data related to a release.

urlstring(uri)required
browser_download_urlstring(uri)required
idintegerrequired
node_idstringrequired
namestringrequired

The file name of the asset.

Example:Team Environment

labelstring | nullrequired
statestringrequired

State of the release asset.

Allowed values:uploadedopen

content_typestringrequired
sizeintegerrequired
download_countintegerrequired
created_atstring(date-time)required
updated_atstring(date-time)required
uploaderobject | nullrequired

Simple User

Show Child Parameters
post/repos/{owner}/{repo}/releases/{release_id}/assets

Body

{}
 
application/json

Get the weekly commit activity

Returns a weekly aggregate of the number of additions and deletions pushed to a repository.

get
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/stats/code_frequency

Path Parameters

ownerstringrequired
repostringrequired

Response

application/json

Returns a weekly aggregate of the number of additions and deletions pushed to a repository.

Code Frequency Statarray[array]

Code Frequency Stat

get/repos/{owner}/{repo}/stats/code_frequency
 
application/json

Get the last year of commit activity

Returns the last year of commit activity grouped by week. The days array is a group of commits per day, starting on Sunday.

get
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/stats/commit_activity

Path Parameters

ownerstringrequired
repostringrequired

Response

application/json

Response

Commit Activity

daysarray[integer]required

Example:[0,3,26,20,39,1,0]

totalintegerrequired

Example:89

weekintegerrequired

Example:1336280400

get/repos/{owner}/{repo}/stats/commit_activity
 
application/json

Get all contributor commit activity

Returns the total number of commits authored by the contributor. In addition, the response includes a Weekly Hash (weeks array) with the following information:

  • w - Start of the week, given as a Unix timestamp.
  • a - Number of additions
  • d - Number of deletions
  • c - Number of commits
get
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/stats/contributors

Path Parameters

ownerstringrequired
repostringrequired

Response

application/json
  • w - Start of the week, given as a Unix timestamp.
  • a - Number of additions
  • d - Number of deletions
  • c - Number of commits

Contributor Activity

authorobject | nullrequired

Simple User

Show Child Parameters
totalintegerrequired

Example:135

weeksarray[object]required

Example:[{"w":"1367712000","a":6898,"d":77,"c":10}]

Show Child Parameters
get/repos/{owner}/{repo}/stats/contributors
 
application/json