List all issues in a repository¶
GET /api/v5/repos/{owner}/{repo}/issues
Retrieves all issues in the specified repository, with filtering by state, labels, milestone, assignee, creator, and time range, and keyword search of issue titles or content; also supports pagination and sorting, returning complete data including issue details, labels, and milestone information.
Access token support¶
- AtomGit user access token (AtomGit user access tokens)
Anonymous access¶
This endpoint allows anonymous access.
Request parameters¶
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
owner |
path | string | Yes | Address path of the namespace that owns the repository (the address path of an organization or an individual) |
repo |
path | string | Yes | Repository path (path) |
state |
query | string | No | State of the issue: open (open), closed (closed), all (all). Defaults to all |
labels |
query | string | No | Comma-separated labels, such as bug,performance |
sort |
query | string | No | Sort criterion: creation time (created), update time (updated). Defaults to created |
direction |
query | string | No | Sort direction: ascending (asc), descending (desc). Defaults to desc |
since |
query | string | No | Start of the update time range; the time format must be 2024-11-10T08:10:30.000+08:00 (note that + must be URL-encoded as %2B) |
page |
query | integer | No | Current page number |
per_page |
query | integer | No | Number of items per page; maximum 100, defaults to 20 |
created_at |
query | string | No | Task creation time, for example: 2024-11-20T13:00:21+08:00 |
milestone |
query | string | No | Filter by milestone title; none for issues without a milestone |
assignee |
query | string | No | ID of the issue assignee |
creator |
query | string | No | Username of the user who created the issue |
created_after |
query | string | No | Returns issues created after the specified time, for example: 2024-11-20T13:00:21+08:00 |
created_before |
query | string | No | Returns issues created before the specified time, for example: 2024-11-20T13:00:21+08:00 |
updated_after |
query | string | No | Returns issues updated after the specified time, for example: 2024-11-20T13:00:21+08:00 |
updated_before |
query | string | No | Returns issues updated before the specified time, for example: 2024-11-20T13:00:21+08:00 |
search |
query | string | No | Search issue titles or content by keyword |
Response parameters¶
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
id |
integer | Yes | No | ID of the issue |
html_url |
string | Yes | No | HTML link of the issue |
number |
string | Yes | No | Number of the issue |
state |
string | Yes | No | State of the issue |
title |
string | Yes | No | Title of the issue |
body |
string | Yes | No | Body of the issue |
user |
object | Yes | No | Information about the user who created the issue |
repository |
object | Yes | No | Information about the repository the issue belongs to |
created_at |
string | Yes | No | Creation time |
updated_at |
string | Yes | No | Update time |
finished_at |
string | Yes | Yes | Completion time; may be null |
labels |
object[] | Yes | No | List of labels on the issue |
issue_state |
string | Yes | No | Issue state |
comments |
integer | Yes | No | Comment count |
priority |
integer | Yes | Yes | Priority; may be null |
issue_type |
string | Yes | Yes | Issue type; may be null |
issue_state_detail |
object | Yes | Yes | Issue state details; may be null |
issue_type_detail |
object | Yes | No | Issue type details |
issue_priority_detail |
object | No | Yes | Issue priority details; may be null |
milestone |
object | Yes | No | Information about the linked milestone |
assignee |
object | Yes | No | Information about the assignee |
visibility_reason |
string | No | Yes | Visibility: public publicly visible, confidential private and visible to project members only, other visible to project members only for other reasons |
user object
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
user.avatar_url |
string | Yes | No | User avatar link |
user.html_url |
string | Yes | No | User homepage link |
user.id |
string | Yes | No | User ID |
user.login |
string | Yes | No | Login name |
user.name |
string | Yes | No | Username |
repository object
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
repository.id |
integer | Yes | No | Repository ID |
repository.full_name |
string | Yes | No | Full repository name |
repository.path |
string | Yes | No | Repository path |
repository.name |
string | Yes | No | Repository name |
repository.description |
string | Yes | No | Repository description |
repository.created_at |
string | Yes | No | Repository creation time |
repository.updated_at |
string | Yes | No | Repository update time |
repository.assigner |
object | Yes | Yes | Assigner object; the internal structure depends on the actual response |
repository.paas |
string | Yes | Yes | paas identifier; may be null |
labels array elements
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
labels[].id |
integer | No | Yes | Label ID |
labels[].name |
string | No | Yes | Label name |
labels[].color |
string | No | Yes | Label color |
labels[].created_at |
string | No | Yes | Label creation time |
labels[].updated_at |
string | No | Yes | Label time added |
issue_state_detail object
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
issue_state_detail.title |
string | Yes | No | State title |
issue_state_detail.serial |
integer | Yes | No | State ordinal |
issue_state_detail.id |
integer | No | Yes | State ID |
issue_type_detail object
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
issue_type_detail.title |
string | Yes | No | Type title |
issue_type_detail.id |
integer | Yes | No | Type ID |
issue_type_detail.is_system |
boolean | Yes | No | Whether this is a system type |
issue_priority_detail object
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
issue_priority_detail.id |
string | Yes | No | Priority ID |
issue_priority_detail.title |
string | Yes | No | Priority title |
milestone object
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
milestone.created_at |
string | Yes | No | Milestone creation time |
milestone.description |
string | Yes | No | Milestone description |
milestone.due_on |
string | Yes | No | Milestone due date |
milestone.number |
integer | Yes | No | Milestone number |
milestone.repository_id |
integer | Yes | No | Repository ID |
milestone.state |
string | Yes | No | Milestone state |
milestone.title |
string | Yes | No | Milestone title |
milestone.updated_at |
string | Yes | No | Milestone update time |
milestone.url |
string | Yes | No | Milestone link |
assignee object
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
assignee.avatar_url |
string | Yes | No | User avatar link |
assignee.html_url |
string | Yes | No | User homepage link |
assignee.id |
string | Yes | No | User ID |
assignee.login |
string | Yes | No | Login name |
assignee.name |
string | Yes | No | Username |
Error responses¶
This endpoint has no business-level error responses (the reference documentation provides no error response examples); the actual error field names returned by the backend take precedence.
HTTP status codes¶
| Status code | Description |
|---|---|
200 |
Success (OK) |
304 |
Not modified (Not modified) |
401 |
Requires authentication (Requires authentication) |
403 |
Forbidden (Forbidden) |
404 |
Resource not found (Not found) |
429 |
Too many requests (Rate limited) |
500 |
Internal server error (Internal server error) |
Request example¶
Parameter notes¶
Placeholder replacement rules in the examples:
replace
<owner>with the address path of the namespace that owns the repository (the address path of an organization or an individual); replace<repo>with the repository path (path).
This endpoint allows anonymous access, so the examples do not carry an access token; if you need to authenticate, you can also include an AtomGit user access token in the request.
cURL¶
curl -X GET 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/issues?state=all&sort=created&direction=desc&page=1&per_page=20' -H 'Accept: application/json'
JavaScript¶
// Native fetch (Node.js 18+ / browsers)
const response = await fetch(
"https://api.atomgit.com/api/v5/repos/<owner>/<repo>/issues?state=all&sort=created&direction=desc&page=1&per_page=20",
{
headers: {
"Accept": "application/json",
},
}
);
if (!response.ok) {
throw new Error(`Request failed: ${response.status}`);
}
const data = await response.json();
console.log(data);
Python¶
import requests
resp = requests.get(
"https://api.atomgit.com/api/v5/repos/<owner>/<repo>/issues",
params={
"state": "all",
"sort": "created",
"direction": "desc",
"page": 1,
"per_page": 20,
},
headers={"Accept": "application/json"},
timeout=10,
)
resp.raise_for_status()
print(resp.json())
Response example¶
Status code: 200
The response body is an array of issue objects; the following is a structural example of one record.
[
{
"id": 152642,
"html_url": "https://api.atomgit.com/dengmengmian/test01/issues/15",
"number": "15",
"state": "opened",
"title": "Sample issue title",
"body": "Sample issue body content",
"user": {
"avatar_url": "https://api.atomgit.com/avatar.png",
"html_url": "https://api.atomgit.com/dengmengmian",
"id": "661ce4eab470b1430d456154",
"login": "dengmengmian",
"name": "Ma Fan_"
},
"repository": {
"id": 280713,
"full_name": "dengmengmian / test01",
"path": "test01",
"name": "test01",
"description": "",
"created_at": "2024-04-15T16:27:45.090+08:00",
"updated_at": "2024-04-15T16:27:45.090+08:00",
"assigner": null,
"paas": null
},
"created_at": "2024-04-18T14:35:15.479+08:00",
"updated_at": "2024-04-20T15:20:30.111+08:00",
"finished_at": null,
"labels": [
{
"id": 382379,
"name": "bug",
"color": "#428BCA",
"created_at": "2024-04-18T10:00:00.000+08:00",
"updated_at": "2024-04-18T10:00:00.000+08:00"
}
],
"issue_state": "opened",
"comments": 3,
"priority": 1,
"issue_type": "bug",
"issue_state_detail": {
"title": "Open",
"serial": 1,
"id": 1
},
"issue_type_detail": {
"title": "Defect",
"id": 1,
"is_system": true
},
"issue_priority_detail": {
"id": "1",
"title": "High"
},
"milestone": {
"created_at": "2024-04-18T10:00:00.000+08:00",
"description": "Sample milestone",
"due_on": "2024-05-01T00:00:00.000+08:00",
"number": 1,
"repository_id": 280713,
"state": "open",
"title": "v1.0",
"updated_at": "2024-04-18T10:00:00.000+08:00",
"url": "https://api.atomgit.com/dengmengmian/test01/milestones/1"
},
"assignee": {
"avatar_url": "https://api.atomgit.com/avatar.png",
"html_url": "https://api.atomgit.com/dengmengmian",
"id": "661ce4eab470b1430d456154",
"login": "dengmengmian",
"name": "Ma Fan_"
},
"visibility_reason": "public"
}
]
Error codes¶
| Error code | Description |
|---|---|
401 |
Unauthenticated or invalid credentials (missing or invalid access credential) |
400 |
Invalid parameters or unparsable request |
404 |
Request path does not exist |
405 |
Unsupported request method |
429 |
Too many requests; rate limit triggered |
500 |
Internal server error |
OpenAPI¶
{"paths": {"/api/v5/repos/{owner}/{repo}/issues": {"get": {"tags": ["issues"], "summary": "List all issues in a repository", "responses": {"200": {"content": {"application/json": {"schema": {"type": "array", "items": {"type": "object", "properties": {"id": {"type": "integer", "description": "ID of the issue"}, "body": {"type": "string", "description": "Body of the issue"}, "user": {"type": "object", "properties": {"id": {"type": "string", "description": "User ID"}, "name": {"type": "string", "description": "Username"}, "login": {"type": "string", "description": "Login name"}, "html_url": {"type": "string", "description": "User homepage link"}, "avatar_url": {"type": "string", "description": "User avatar link"}}, "description": "Information about the user who created the issue"}, "state": {"type": "string", "description": "State of the issue"}, "title": {"type": "string", "description": "Title of the issue"}, "labels": {"type": "array", "items": {"type": "object", "properties": {"id": {"type": "integer", "description": "Label ID"}, "name": {"type": "string", "description": "Label name"}, "color": {"type": "string", "description": "Label color"}, "created_at": {"type": "string", "description": "Label creation time"}, "updated_at": {"type": "string", "description": "Label time added"}}}, "description": "List of labels on the issue"}, "number": {"type": "string", "description": "Number of the issue"}, "assignee": {"type": "object", "properties": {"id": {"type": "string", "description": "User ID"}, "name": {"type": "string", "description": "Username"}, "login": {"type": "string", "description": "Login name"}, "html_url": {"type": "string", "description": "User homepage link"}, "avatar_url": {"type": "string", "description": "User avatar link"}}, "description": "Information about the assignee"}, "comments": {"type": "integer", "description": "Comment count"}, "html_url": {"type": "string", "description": "HTML link of the issue"}, "priority": {"type": "integer", "description": "Priority"}, "milestone": {"type": "object", "properties": {"url": {"type": "string", "description": "Milestone link"}, "state": {"type": "string", "description": "Milestone state"}, "title": {"type": "string", "description": "Milestone title"}, "due_on": {"type": "string", "description": "Milestone due date"}, "number": {"type": "integer", "description": "Milestone number"}, "repository_id": {"type": "integer", "description": "Repository ID"}, "created_at": {"type": "string", "description": "Milestone creation time"}, "updated_at": {"type": "string", "description": "Milestone update time"}, "description": {"type": "string", "description": "Milestone description"}}, "description": "Information about the linked milestone"}, "issue_type": {"type": "string", "description": "Issue type"}, "issue_state": {"type": "string", "description": "Issue state"}, "created_at": {"type": "string", "description": "Creation time"}, "updated_at": {"type": "string", "description": "Update time"}, "finished_at": {"type": "string", "description": "Completion time"}, "issue_type_detail": {"type": "object", "properties": {"title": {"type": "string", "description": "Type title"}, "id": {"type": "integer", "description": "Type ID"}, "is_system": {"type": "boolean", "description": "Whether this is a system type"}}, "description": "Issue type details"}, "issue_state_detail": {"type": "object", "properties": {"title": {"type": "string", "description": "State title"}, "serial": {"type": "integer", "description": "State ordinal"}, "id": {"type": "integer", "description": "State ID"}}, "description": "Issue state details"}, "issue_priority_detail": {"type": "object", "properties": {"id": {"type": "string", "description": "Priority ID"}, "title": {"type": "string", "description": "Priority title"}}, "description": "Issue priority details"}, "repository": {"type": "object", "properties": {"id": {"type": "integer", "description": "Repository ID"}, "path": {"type": "string", "description": "Repository path"}, "name": {"type": "string", "description": "Repository name"}, "paas": {"type": "string", "description": "paas identifier"}, "assigner": {"type": "object", "description": "Assigner object"}, "full_name": {"type": "string", "description": "Full repository name"}, "created_at": {"type": "string", "description": "Repository creation time"}, "updated_at": {"type": "string", "description": "Repository update time"}, "description": {"type": "string", "description": "Repository description"}}, "description": "Information about the repository the issue belongs to"}, "visibility_reason": {"type": "string", "description": "Visibility: public publicly visible, confidential private and visible to project members only, other visible to project members only for other reasons"}}}}, "description": "Success"}}, "parameters": [{"in": "path", "name": "owner", "schema": {"type": "string"}, "required": true, "description": "Address path of the namespace that owns the repository (the address path of an organization or an individual)"}, {"in": "path", "name": "repo", "schema": {"type": "string"}, "required": true, "description": "Repository path (path)"}, {"in": "query", "name": "state", "schema": {"type": "string"}, "required": false, "description": "State of the issue: open (open), closed (closed), all (all). Defaults to all"}, {"in": "query", "name": "labels", "schema": {"type": "string"}, "required": false, "description": "Comma-separated labels, such as bug,performance"}, {"in": "query", "name": "sort", "schema": {"type": "string"}, "required": false, "description": "Sort criterion: creation time (created), update time (updated). Defaults to created"}, {"in": "query", "name": "direction", "schema": {"type": "string"}, "required": false, "description": "Sort direction: ascending (asc), descending (desc). Defaults to desc"}, {"in": "query", "name": "since", "schema": {"type": "string"}, "required": false, "description": "Start of the update time range; the time format must be 2024-11-10T08:10:30.000+08:00 (note that + must be URL-encoded as %2B)"}, {"in": "query", "name": "page", "schema": {"type": "integer"}, "required": false, "description": "Current page number"}, {"in": "query", "name": "per_page", "schema": {"type": "integer"}, "required": false, "description": "Number of items per page; maximum 100, defaults to 20"}, {"in": "query", "name": "created_at", "schema": {"type": "string"}, "required": false, "description": "Task creation time, for example: 2024-11-20T13:00:21+08:00"}, {"in": "query", "name": "milestone", "schema": {"type": "string"}, "required": false, "description": "Filter by milestone title; none for issues without a milestone"}, {"in": "query", "name": "assignee", "schema": {"type": "string"}, "required": false, "description": "ID of the issue assignee"}, {"in": "query", "name": "creator", "schema": {"type": "string"}, "required": false, "description": "Username of the user who created the issue"}, {"in": "query", "name": "created_after", "schema": {"type": "string"}, "required": false, "description": "Returns issues created after the specified time, for example: 2024-11-20T13:00:21+08:00"}, {"in": "query", "name": "created_before", "schema": {"type": "string"}, "required": false, "description": "Returns issues created before the specified time, for example: 2024-11-20T13:00:21+08:00"}, {"in": "query", "name": "updated_after", "schema": {"type": "string"}, "required": false, "description": "Returns issues updated after the specified time, for example: 2024-11-20T13:00:21+08:00"}, {"in": "query", "name": "updated_before", "schema": {"type": "string"}, "required": false, "description": "Returns issues updated before the specified time, for example: 2024-11-20T13:00:21+08:00"}, {"in": "query", "name": "search", "schema": {"type": "string"}, "required": false, "description": "Search issue titles or content by keyword"}], "description": "Call this endpoint to list all issues in a repository."}}}}
Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc