Issues API
Issues leverage these custom mime types. You can read more about the use of mime types in the API here.
List your issues
GET /issues
Parameters
- filter
-
-
assigned: Issues assigned to you (default) -
created: Issues created by you -
mentioned: Issues mentioning you -
subscribed: Issues you’re subscribed to updates for
-
- state
-
open,closed, default:open - labels
-
String list of comma separated Label names. Example:
bug,ui,@high - sort
-
created,updated,comments, default:created. - direction
-
ascordesc, default:desc. - since
- Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ
Response
Status: 200 OK
Link: <https://api.github.com/resource?page=2>; rel="next",
<https://api.github.com/resource?page=5>; rel="last"
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
[
{
"url": "https://api.github.com/repos/octocat/Hello-World/issues/1",
"html_url": "https://github.com/octocat/Hello-World/issues/1",
"number": 1347,
"state": "open",
"title": "Found a bug",
"body": "I'm having a problem with this.",
"user": {
"login": "octocat",
"id": 1,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "somehexcode",
"url": "https://api.github.com/users/octocat"
},
"labels": [
{
"url": "https://api.github.com/repos/octocat/Hello-World/labels/bug",
"name": "bug",
"color": "f29513"
}
],
"assignee": {
"login": "octocat",
"id": 1,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "somehexcode",
"url": "https://api.github.com/users/octocat"
},
"milestone": {
"url": "https://api.github.com/repos/octocat/Hello-World/milestones/1",
"number": 1,
"state": "open",
"title": "v1.0",
"description": "",
"creator": {
"login": "octocat",
"id": 1,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "somehexcode",
"url": "https://api.github.com/users/octocat"
},
"open_issues": 4,
"closed_issues": 8,
"created_at": "2011-04-10T20:09:31Z",
"due_on": null
},
"comments": 0,
"pull_request": {
"html_url": "https://github.com/octocat/Hello-World/issues/1",
"diff_url": "https://github.com/octocat/Hello-World/issues/1.diff",
"patch_url": "https://github.com/octocat/Hello-World/issues/1.patch"
},
"closed_at": null,
"created_at": "2011-04-22T13:33:48Z",
"updated_at": "2011-04-22T13:33:48Z"
}
]
List issues for a repository
GET /repos/:user/:repo/issues
Parameters
- milestone
-
- Integer Milestone number
-
nonefor Issues with no Milestone. -
*for Issues with any Milestone.
- state
-
open,closed, default:open - assignee
-
- String User login
-
nonefor Issues with no assigned User. -
*for Issues with any assigned User.
- mentioned
- String User login.
- labels
-
String list of comma separated Label names. Example:
bug,ui,@high - sort
-
created,updated,comments, default:created - direction
-
ascordesc, default:desc. - since
- Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ
Response
Status: 200 OK
Link: <https://api.github.com/resource?page=2>; rel="next",
<https://api.github.com/resource?page=5>; rel="last"
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
[
{
"url": "https://api.github.com/repos/octocat/Hello-World/issues/1",
"html_url": "https://github.com/octocat/Hello-World/issues/1",
"number": 1347,
"state": "open",
"title": "Found a bug",
"body": "I'm having a problem with this.",
"user": {
"login": "octocat",
"id": 1,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "somehexcode",
"url": "https://api.github.com/users/octocat"
},
"labels": [
{
"url": "https://api.github.com/repos/octocat/Hello-World/labels/bug",
"name": "bug",
"color": "f29513"
}
],
"assignee": {
"login": "octocat",
"id": 1,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "somehexcode",
"url": "https://api.github.com/users/octocat"
},
"milestone": {
"url": "https://api.github.com/repos/octocat/Hello-World/milestones/1",
"number": 1,
"state": "open",
"title": "v1.0",
"description": "",
"creator": {
"login": "octocat",
"id": 1,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "somehexcode",
"url": "https://api.github.com/users/octocat"
},
"open_issues": 4,
"closed_issues": 8,
"created_at": "2011-04-10T20:09:31Z",
"due_on": null
},
"comments": 0,
"pull_request": {
"html_url": "https://github.com/octocat/Hello-World/issues/1",
"diff_url": "https://github.com/octocat/Hello-World/issues/1.diff",
"patch_url": "https://github.com/octocat/Hello-World/issues/1.patch"
},
"closed_at": null,
"created_at": "2011-04-22T13:33:48Z",
"updated_at": "2011-04-22T13:33:48Z"
}
]
Get a single issue
GET /repos/:user/:repo/issues/:number
Response
Status: 200 OK
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
{
"url": "https://api.github.com/repos/octocat/Hello-World/issues/1",
"html_url": "https://github.com/octocat/Hello-World/issues/1",
"number": 1347,
"state": "open",
"title": "Found a bug",
"body": "I'm having a problem with this.",
"user": {
"login": "octocat",
"id": 1,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "somehexcode",
"url": "https://api.github.com/users/octocat"
},
"labels": [
{
"url": "https://api.github.com/repos/octocat/Hello-World/labels/bug",
"name": "bug",
"color": "f29513"
}
],
"assignee": {
"login": "octocat",
"id": 1,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "somehexcode",
"url": "https://api.github.com/users/octocat"
},
"milestone": {
"url": "https://api.github.com/repos/octocat/Hello-World/milestones/1",
"number": 1,
"state": "open",
"title": "v1.0",
"description": "",
"creator": {
"login": "octocat",
"id": 1,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "somehexcode",
"url": "https://api.github.com/users/octocat"
},
"open_issues": 4,
"closed_issues": 8,
"created_at": "2011-04-10T20:09:31Z",
"due_on": null
},
"comments": 0,
"pull_request": {
"html_url": "https://github.com/octocat/Hello-World/issues/1",
"diff_url": "https://github.com/octocat/Hello-World/issues/1.diff",
"patch_url": "https://github.com/octocat/Hello-World/issues/1.patch"
},
"closed_at": null,
"created_at": "2011-04-22T13:33:48Z",
"updated_at": "2011-04-22T13:33:48Z"
}
Create an issue
POST /repos/:user/:repo/issues
Input
- title
- Required string
- body
- Optional string
- assignee
- Optional string - Login for the user that this issue should be assigned to.
- milestone
- Optional number - Milestone to associate this issue with.
- labels
- Optional array of strings - Labels to associate with this issue.
{
"title": "Found a bug",
"body": "I'm having a problem with this.",
"assignee": "octocat",
"milestone": 1,
"labels": [
"Label1",
"Label2"
]
}
Response
Status: 201 Created
Location: https://api.github.com/repos/user/repo/issues/1
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
{
"url": "https://api.github.com/repos/octocat/Hello-World/issues/1",
"html_url": "https://github.com/octocat/Hello-World/issues/1",
"number": 1347,
"state": "open",
"title": "Found a bug",
"body": "I'm having a problem with this.",
"user": {
"login": "octocat",
"id": 1,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "somehexcode",
"url": "https://api.github.com/users/octocat"
},
"labels": [
{
"url": "https://api.github.com/repos/octocat/Hello-World/labels/bug",
"name": "bug",
"color": "f29513"
}
],
"assignee": {
"login": "octocat",
"id": 1,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "somehexcode",
"url": "https://api.github.com/users/octocat"
},
"milestone": {
"url": "https://api.github.com/repos/octocat/Hello-World/milestones/1",
"number": 1,
"state": "open",
"title": "v1.0",
"description": "",
"creator": {
"login": "octocat",
"id": 1,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "somehexcode",
"url": "https://api.github.com/users/octocat"
},
"open_issues": 4,
"closed_issues": 8,
"created_at": "2011-04-10T20:09:31Z",
"due_on": null
},
"comments": 0,
"pull_request": {
"html_url": "https://github.com/octocat/Hello-World/issues/1",
"diff_url": "https://github.com/octocat/Hello-World/issues/1.diff",
"patch_url": "https://github.com/octocat/Hello-World/issues/1.patch"
},
"closed_at": null,
"created_at": "2011-04-22T13:33:48Z",
"updated_at": "2011-04-22T13:33:48Z"
}
Edit an issue
PATCH /repos/:user/:repo/issues/:number
Input
- title
- Optional string
- body
- Optional string
- assignee
- Optional string - Login for the user that this issue should be assigned to.
- state
-
Optional string - State of the issue:
openorclosed. - milestone
- Optional number - Milestone to associate this issue with.
- labels
-
Optional array of strings - Labels to associate with this
issue. Pass one or more Labels to replace the set of Labels on this
Issue. Send an empty array (
[]) to clear all Labels from the Issue.
{
"title": "Found a bug",
"body": "I'm having a problem with this.",
"assignee": "octocat",
"milestone": 1,
"state": "open",
"labels": [
"Label1",
"Label2"
]
}
Response
Status: 200 OK
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
{
"url": "https://api.github.com/repos/octocat/Hello-World/issues/1",
"html_url": "https://github.com/octocat/Hello-World/issues/1",
"number": 1347,
"state": "open",
"title": "Found a bug",
"body": "I'm having a problem with this.",
"user": {
"login": "octocat",
"id": 1,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "somehexcode",
"url": "https://api.github.com/users/octocat"
},
"labels": [
{
"url": "https://api.github.com/repos/octocat/Hello-World/labels/bug",
"name": "bug",
"color": "f29513"
}
],
"assignee": {
"login": "octocat",
"id": 1,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "somehexcode",
"url": "https://api.github.com/users/octocat"
},
"milestone": {
"url": "https://api.github.com/repos/octocat/Hello-World/milestones/1",
"number": 1,
"state": "open",
"title": "v1.0",
"description": "",
"creator": {
"login": "octocat",
"id": 1,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "somehexcode",
"url": "https://api.github.com/users/octocat"
},
"open_issues": 4,
"closed_issues": 8,
"created_at": "2011-04-10T20:09:31Z",
"due_on": null
},
"comments": 0,
"pull_request": {
"html_url": "https://github.com/octocat/Hello-World/issues/1",
"diff_url": "https://github.com/octocat/Hello-World/issues/1.diff",
"patch_url": "https://github.com/octocat/Hello-World/issues/1.patch"
},
"closed_at": null,
"created_at": "2011-04-22T13:33:48Z",
"updated_at": "2011-04-22T13:33:48Z"
}
Custom Mime Types
These are the supported mime types for issues. You can read more about the use of mime types in the API here.
application/vnd.github.VERSION.raw+json
application/vnd.github.VERSION.text+json
application/vnd.github.VERSION.html+json
application/vnd.github.VERSION.full+json