GitHub v3 REST API

Lock an issue

Users with push access can lock an issue or pull request’s conversation.

Note that, if you choose not to pass any parameters, you’ll need to set Content-Length to zero when calling out to this endpoint. For more information, see “HTTP verbs.”

put
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/issues/{issue_number}/lock

Path Parameters

ownerstringrequired
repostringrequired
issue_numberintegerrequired

issue_number parameter

Body

application/json
lock_reasonstring

The reason for locking the issue or pull request conversation. Lock will fail if you don’t use one of these reasons:
* off-topic
* too heated
* resolved
* spam

Allowed values:off-topictoo heatedresolvedspam

Response

Response

put/repos/{owner}/{repo}/issues/{issue_number}/lock

Body

{}
 

Unlock an issue

Users with push access can unlock an issue’s conversation.

delete
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/issues/{issue_number}/lock

Path Parameters

ownerstringrequired
repostringrequired
issue_numberintegerrequired

issue_number parameter

Response

Response

delete/repos/{owner}/{repo}/issues/{issue_number}/lock
 

List timeline events for an issue

get
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/issues/{issue_number}/timeline

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
issue_numberintegerrequired

issue_number parameter

Response

application/json

Response

Timeline Eventarray[object]

Timeline Event

Any Of
idintegerrequired
node_idstringrequired
urlstringrequired
actorobjectrequired

Simple User

Show Child Parameters
eventstringrequired
commit_idstring | nullrequired
commit_urlstring | nullrequired
created_atstringrequired
performed_via_github_appobject | nullrequired

GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub.

Show Child Parameters
labelobjectrequired
Show Child Parameters
get/repos/{owner}/{repo}/issues/{issue_number}/timeline
 
application/json

List labels for a repository

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

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

Response

application/json

Response

Color-coded labels help you categorize and filter your issues (just like labels in Gmail).

idinteger(int64)required

Example:208045946

node_idstringrequired

Example:MDU6TGFiZWwyMDgwNDU5NDY=

urlstring(uri)required

URL for the label

Example:https://api.github.com/repositories/42/labels/bug

namestringrequired

The name of the label.

Example:bug

descriptionstring | nullrequired

Example:Something isn't working

colorstringrequired

6-character hex code, without the leading #, identifying the color

Example:FFFFFF

defaultbooleanrequired

Example:true

get/repos/{owner}/{repo}/labels
 
application/json

Create a label

post
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/labels

Path Parameters

ownerstringrequired
repostringrequired

Body

application/json
namestringrequired

The name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing :strawberry: will render the emoji :strawberry:. For a full list of available emoji and codes, see “Emoji cheat sheet.”

colorstring

The hexadecimal color code for the label, without the leading #.

descriptionstring

A short description of the label. Must be 100 characters or fewer.

Response

application/json

Response

Label

Color-coded labels help you categorize and filter your issues (just like labels in Gmail).

idinteger(int64)required

Example:208045946

node_idstringrequired

Example:MDU6TGFiZWwyMDgwNDU5NDY=

urlstring(uri)required

URL for the label

Example:https://api.github.com/repositories/42/labels/bug

namestringrequired

The name of the label.

Example:bug

descriptionstring | nullrequired

Example:Something isn't working

colorstringrequired

6-character hex code, without the leading #, identifying the color

Example:FFFFFF

defaultbooleanrequired

Example:true

post/repos/{owner}/{repo}/labels

Body

{ "name": "bug", "description": "Something isn't working", "color": "f29513" }
 
application/json