Use the REST API to manage labels for repositories, issues and pull requests.
You can use the REST API to manage labels for a repository and add or remove labels to issues and pull requests. Every pull request is an issue, but not every issue is a pull request. For this reason, "shared" actions for both features, like managing assignees, labels, and milestones, are provided within the Issues endpoints.
Note
Most endpoints use Authorization: Bearer <YOUR-TOKEN> and Accept: application/vnd.github+json headers, plus X-GitHub-Api-Version: 2026-03-10. Curl examples below omit these standard headers for brevity.
GET /repos/{owner}/{repo}/issues/{issue_number}/labels
Lists all labels for an issue.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
issue_number (integer) (required)
The number that identifies the issue.
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
200 - OK
301 - Moved permanently
404 - Resource not found
410 - Gone
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/issues/ISSUE_NUMBER/labels
Response schema (Status: 200):
Array of Label:
id: required, integer, format: int64node_id: required, stringurl: required, string, format: uriname: required, stringdescription: required, string or nullcolor: required, stringdefault: required, booleanarchived_at: required, string or null, format: date-timearchived_by: required, all of:
name: string or nullemail: string or nulllogin: required, stringid: required, integer, format: int64node_id: required, stringavatar_url: required, string, format: urigravatar_id: required, string or nullurl: required, string, format: urihtml_url: required, string, format: urifollowers_url: required, string, format: urifollowing_url: required, stringgists_url: required, stringstarred_url: required, stringsubscriptions_url: required, string, format: uriorganizations_url: required, string, format: urirepos_url: required, string, format: urievents_url: required, stringreceived_events_url: required, string, format: uritype: required, stringsite_admin: required, booleanstarred_at: stringuser_view_type: stringPOST /repos/{owner}/{repo}/issues/{issue_number}/labels
Adds labels to an issue.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
issue_number (integer) (required)
The number that identifies the issue.
labels (array)200 - OK
301 - Moved permanently
404 - Resource not found
410 - Gone
422 - Validation failed, or the endpoint has been spammed.
Request:
curl -L \
-X POST \
https://api.github.com/repos/OWNER/REPO/issues/ISSUE_NUMBER/labels \
-d '{
"labels": [
"bug",
"enhancement"
]
}'
Response schema (Status: 200):
Same response schema as List labels for an issue.
PUT /repos/{owner}/{repo}/issues/{issue_number}/labels
Removes any previous labels and sets the new labels for an issue.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
issue_number (integer) (required)
The number that identifies the issue.
labels (array of strings)200 - OK
301 - Moved permanently
404 - Resource not found
410 - Gone
422 - Validation failed, or the endpoint has been spammed.
Request:
curl -L \
-X PUT \
https://api.github.com/repos/OWNER/REPO/issues/ISSUE_NUMBER/labels \
-d '{
"labels": [
"bug",
"enhancement"
]
}'
Response schema (Status: 200):
Same response schema as List labels for an issue.
DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels
Removes all labels from an issue.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
issue_number (integer) (required)
The number that identifies the issue.
204 - No Content
301 - Moved permanently
404 - Resource not found
410 - Gone
Request:
curl -L \
-X DELETE \
https://api.github.com/repos/OWNER/REPO/issues/ISSUE_NUMBER/labels
Response schema (Status: 204):
DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}
Removes the specified label from the issue, and returns the remaining labels on the issue. This endpoint returns a 404 Not Found status if the label does not exist.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
issue_number (integer) (required)
The number that identifies the issue.
name (string) (required)
200 - OK
301 - Moved permanently
404 - Resource not found
410 - Gone
Request:
curl -L \
-X DELETE \
https://api.github.com/repos/OWNER/REPO/issues/ISSUE_NUMBER/labels/NAME
Response schema (Status: 200):
Same response schema as List labels for an issue.
GET /repos/{owner}/{repo}/labels
Lists all labels for a repository.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
200 - OK
404 - Resource not found
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/labels
Response schema (Status: 200):
Same response schema as List labels for an issue.
POST /repos/{owner}/{repo}/labels
Creates a label for the specified repository with the given name and color. The name and color parameters are required. The color must be a valid hexadecimal color code.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
name (string) (required)
The name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing 🍓 will render the emoji . For a full list of available emoji and codes, see "Emoji cheat sheet."
color (string)
The hexadecimal color code for the label, without the leading #.
description (string)
A short description of the label. Must be 100 characters or fewer.
201 - Created
404 - Resource not found
422 - Validation failed, or the endpoint has been spammed.
Request:
curl -L \
-X POST \
https://api.github.com/repos/OWNER/REPO/labels \
-d '{
"name": "bug",
"description": "Something isn'\''t working",
"color": "f29513"
}'
Response schema (Status: 201):
id: required, integer, format: int64node_id: required, stringurl: required, string, format: uriname: required, stringdescription: required, string or nullcolor: required, stringdefault: required, booleanarchived_at: required, string or null, format: date-timearchived_by: required, all of:
name: string or nullemail: string or nulllogin: required, stringid: required, integer, format: int64node_id: required, stringavatar_url: required, string, format: urigravatar_id: required, string or nullurl: required, string, format: urihtml_url: required, string, format: urifollowers_url: required, string, format: urifollowing_url: required, stringgists_url: required, stringstarred_url: required, stringsubscriptions_url: required, string, format: uriorganizations_url: required, string, format: urirepos_url: required, string, format: urievents_url: required, stringreceived_events_url: required, string, format: uritype: required, stringsite_admin: required, booleanstarred_at: stringuser_view_type: stringGET /repos/{owner}/{repo}/labels/{name}
Gets a label using the given name.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
name (string) (required)
200 - OK
404 - Resource not found
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/labels/NAME
Response schema (Status: 200):
Same response schema as Create a label.
PATCH /repos/{owner}/{repo}/labels/{name}
Updates a label using the given label name.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
name (string) (required)
new_name (string)
The new name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing 🍓 will render the emoji . For a full list of available emoji and codes, see "Emoji cheat sheet."
color (string)
The hexadecimal color code for the label, without the leading #.
description (string)
A short description of the label. Must be 100 characters or fewer.
archived (boolean)
Whether to archive or unarchive the label. Archived labels cannot be added to issues or pull requests. For more information, see "Archiving labels."
Request:
curl -L \
-X PATCH \
https://api.github.com/repos/OWNER/REPO/labels/NAME \
-d '{
"new_name": "bug :bug:",
"description": "Small bug fix required",
"color": "b01f26"
}'
Response schema (Status: 200):
Same response schema as Create a label.
DELETE /repos/{owner}/{repo}/labels/{name}
Deletes a label using the given label name.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
name (string) (required)
Request:
curl -L \
-X DELETE \
https://api.github.com/repos/OWNER/REPO/labels/NAME
Response schema (Status: 204):
GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels
Lists labels for issues in a milestone.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
milestone_number (integer) (required)
The number that identifies the milestone.
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/milestones/MILESTONE_NUMBER/labels
Response schema (Status: 200):
Same response schema as List labels for an issue.