CARVIEW |
Issues API
- List issues
- List issues for a repository
- Get a single issue
- Create an issue
- Edit an issue
- Custom media types
Issues use these custom media types. You can read more about the use of media types in the API here.
List issues
List all issues across all the authenticated user’s visible repositories including owned repositories, member repositories, and organization repositories:
GET /issues
List all issues across owned and member repositories for the authenticated user:
GET /user/issues
List all issues for a given organization for the authenticated user:
GET /orgs/:org/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 -
all
: All issues the authenticated user can see, regardless of participation or creation
-
- state
-
open
,closed
, default:open
- labels
-
String list of comma separated Label names. Example:
bug,ui,@high
- sort
-
created
,updated
,comments
, default:created
. - direction
-
asc
ordesc
, default:desc
. - since
- Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. Only issues updated at or after this time are returned.
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/1347",
"html_url": "https://github.com/octocat/Hello-World/issues/1347",
"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/1347",
"diff_url": "https://github.com/octocat/Hello-World/issues/1347.diff",
"patch_url": "https://github.com/octocat/Hello-World/issues/1347.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/:owner/:repo/issues
Parameters
- milestone
-
- Integer Milestone number
-
none
for Issues with no Milestone. -
*
for Issues with any Milestone.
- state
-
open
,closed
, default:open
- assignee
-
- String User login
-
none
for Issues with no assigned User. -
*
for Issues with any assigned User.
- creator
- String User login.
- mentioned
- String User login.
- labels
-
String list of comma separated Label names. Example:
bug,ui,@high
- sort
-
created
,updated
,comments
, default:created
- direction
-
asc
ordesc
, default:desc
. - since
- Optional String of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. Only issues updated at or after this time are returned.
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/1347",
"html_url": "https://github.com/octocat/Hello-World/issues/1347",
"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/1347",
"diff_url": "https://github.com/octocat/Hello-World/issues/1347.diff",
"patch_url": "https://github.com/octocat/Hello-World/issues/1347.patch"
},
"closed_at": null,
"created_at": "2011-04-22T13:33:48Z",
"updated_at": "2011-04-22T13:33:48Z"
}
]
Get a single issue
GET /repos/:owner/: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/1347",
"html_url": "https://github.com/octocat/Hello-World/issues/1347",
"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/1347",
"diff_url": "https://github.com/octocat/Hello-World/issues/1347.diff",
"patch_url": "https://github.com/octocat/Hello-World/issues/1347.patch"
},
"closed_at": null,
"created_at": "2011-04-22T13:33:48Z",
"updated_at": "2011-04-22T13:33:48Z"
}
Create an issue
Any user with pull access to a repository can create an issue.
POST /repos/:owner/:repo/issues
Input
- title
- Required string
- body
- Optional string
- assignee
- Optional string - Login for the user that this issue should be assigned to. NOTE: Only users with push access can set the assignee for new issues. The assignee is silently dropped otherwise.
- milestone
- Optional number - Milestone to associate this issue with. NOTE: Only users with push access can set the milestone for new issues. The milestone is silently dropped otherwise.
- labels
- Optional array of strings - Labels to associate with this issue. NOTE: Only users with push access can set labels for new issues. Labels are silently dropped otherwise.
{
"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/1347",
"html_url": "https://github.com/octocat/Hello-World/issues/1347",
"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/1347",
"diff_url": "https://github.com/octocat/Hello-World/issues/1347.diff",
"patch_url": "https://github.com/octocat/Hello-World/issues/1347.patch"
},
"closed_at": null,
"created_at": "2011-04-22T13:33:48Z",
"updated_at": "2011-04-22T13:33:48Z"
}
Edit an issue
Issue owners and users with push access can edit an issue.
PATCH /repos/:owner/: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:
open
orclosed
. - 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/1347",
"html_url": "https://github.com/octocat/Hello-World/issues/1347",
"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/1347",
"diff_url": "https://github.com/octocat/Hello-World/issues/1347.diff",
"patch_url": "https://github.com/octocat/Hello-World/issues/1347.patch"
},
"closed_at": null,
"created_at": "2011-04-22T13:33:48Z",
"updated_at": "2011-04-22T13:33:48Z"
}
Custom media types
These are the supported media types for issues. You can read more about the use of media 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
This website is a public GitHub repository. Please help us by forking the project and adding to it.
Except where otherwise noted, content on this site is licensed under a Creative Commons CC-BY license.