Get an issue
/repos/{owner}/{repo}/issues/{issue_number} The API returns a 301 Moved Permanently status if the issue was
transferred to another repository. If
the issue was transferred to or deleted from a repository where the authenticated user lacks read access, the API
returns a 404 Not Found status. If the issue was deleted from a repository where the authenticated user has read
access, the API returns a 410 Gone status. To receive webhook events for transferred and deleted issues, subscribe
to the issues webhook.
[!NOTE] GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the
pull_requestkey. Be aware that theidof a pull request returned from "Issues" endpoints will be an issue id. To find out the pull request id, use the "List pull requests" endpoint.
This endpoint supports the following custom media types. For more information, see "Media types."
application/vnd.github.raw+json: Returns the raw markdown body. Response will includebody. This is the default if you do not pass any specific media type.application/vnd.github.text+json: Returns a text only representation of the markdown body. Response will includebody_text.application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will includebody_html.application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will includebody,body_text, andbody_html.
Parameters
path Path Parameters
| Name | Type |
|---|---|
owner
required
The account owner of the repository. The name is not case sensitive. | string |
repo
required
The name of the repository without the | string |
issue_number
required
The number that identifies the issue. | number |
Responses
Response
id: number;
node_id: string;
url: string;
repository_url: string;
labels_url: string;
comments_url: string;
events_url: string;
html_url: string;
number: number;
state: string;
state_reason?: "completed" | "reopened" | "not_planned" | "duplicate" | null;
title: string;
body?: string | null;
user:
labels: ({
id?: number;
node_id?: string;
url?: string;
name?: string;
description?: string | null;
color?: string | null;
default?: boolean;
} | string)[];
assignee:
assignees?:
milestone:
locked: boolean;
active_lock_reason?: string | null;
comments: number;
pull_request?: {
merged_at?: string | null;
diff_url: string | null;
html_url: string | null;
patch_url: string | null;
url: string | null;
};
closed_at: string | null;
created_at: string;
updated_at: string;
draft?: boolean;
closed_by?:
body_html?: string;
body_text?: string;
timeline_url?: string;
type?:
repository?:
performed_via_github_app?:
author_association?:
reactions?:
sub_issues_summary?:
parent_issue_url?: string | null;
issue_dependencies_summary?:
issue_field_values?:
}
Redirects
Moved permanently
message?: string;
documentation_url?: string;
url?: string;
status?: string;
}
Not modified
Client Errors
Resource not found
message?: string;
documentation_url?: string;
url?: string;
status?: string;
}
Gone
message?: string;
documentation_url?: string;
url?: string;
status?: string;
}