markdown · 1736 bytes Raw Blame History

Labels

Repo-scoped labels for issues and pull requests. The default label set is seeded at repo create and can be edited or removed freely.

Label shape

{
  "id": 7,
  "name": "bug",
  "color": "ee0701",
  "description": "Something isn't working",
  "created_at": "2026-05-12T05:00:00Z"
}

color is six hex chars without the leading #.

List labels

GET /api/v1/repos/{owner}/{repo}/labels

Required scope: repo:read. Sorted alphabetically by name.

Get a single label

GET /api/v1/repos/{owner}/{repo}/labels/{name}

Required scope: repo:read. 404 when the label does not exist.

Create a label

POST /api/v1/repos/{owner}/{repo}/labels

Required scope: repo:write. Policy: ActionIssueLabel.

{ "name": "needs-triage", "color": "ff00aa", "description": "triage me" }
Field Type Notes
name string Required, 1–50 chars.
color string Required, six hex chars (no #).
description string Optional, ≤100 chars.

Returns 201. 409 when the name is already taken on the repo; 422 on invalid color or empty name.

Update a label

PATCH /api/v1/repos/{owner}/{repo}/labels/{name}

Required scope: repo:write. Send only the fields you want to change. Renaming a label is allowed via name.

{ "color": "00ff00", "description": "ready for triage" }

Delete a label

DELETE /api/v1/repos/{owner}/{repo}/labels/{name}

Required scope: repo:write. Returns 204. Issue / PR label associations cascade away automatically.

View source
1 # Labels
2
3 Repo-scoped labels for issues and pull requests. The default
4 label set is seeded at repo create and can be edited or removed
5 freely.
6
7 ## Label shape
8
9 ```json
10 {
11 "id": 7,
12 "name": "bug",
13 "color": "ee0701",
14 "description": "Something isn't working",
15 "created_at": "2026-05-12T05:00:00Z"
16 }
17 ```
18
19 `color` is six hex chars without the leading `#`.
20
21 ## List labels
22
23 ```
24 GET /api/v1/repos/{owner}/{repo}/labels
25 ```
26
27 Required scope: `repo:read`. Sorted alphabetically by name.
28
29 ## Get a single label
30
31 ```
32 GET /api/v1/repos/{owner}/{repo}/labels/{name}
33 ```
34
35 Required scope: `repo:read`. `404` when the label does not exist.
36
37 ## Create a label
38
39 ```
40 POST /api/v1/repos/{owner}/{repo}/labels
41 ```
42
43 Required scope: `repo:write`. Policy: `ActionIssueLabel`.
44
45 ```json
46 { "name": "needs-triage", "color": "ff00aa", "description": "triage me" }
47 ```
48
49 | Field | Type | Notes |
50 |---------------|--------|----------------------------------------|
51 | `name` | string | Required, 1–50 chars. |
52 | `color` | string | Required, six hex chars (no `#`). |
53 | `description` | string | Optional, ≤100 chars. |
54
55 Returns `201`. `409` when the name is already taken on the repo;
56 `422` on invalid color or empty name.
57
58 ## Update a label
59
60 ```
61 PATCH /api/v1/repos/{owner}/{repo}/labels/{name}
62 ```
63
64 Required scope: `repo:write`. Send only the fields you want to
65 change. Renaming a label is allowed via `name`.
66
67 ```json
68 { "color": "00ff00", "description": "ready for triage" }
69 ```
70
71 ## Delete a label
72
73 ```
74 DELETE /api/v1/repos/{owner}/{repo}/labels/{name}
75 ```
76
77 Required scope: `repo:write`. Returns `204`. Issue / PR label
78 associations cascade away automatically.