Skip to content

Get enterprise issue list

POST /api/v8/enterprises/{enterprise_id}/issues

Retrieves the list of issues under the specified enterprise.

Access token support

  • AtomGit user access tokens

Anonymous access

This endpoint does not allow anonymous access.

Request parameters

Parameter Location Type Required Description
enterprise_id path string Yes Enterprise ID
access_token query string Yes User authorization code

Request Body:

The request body is a JSON object; all fields are optional filters.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "page": {
      "description": "Current page number. Defaults to 1",
      "type": "integer",
      "default": 1
    },
    "per_page": {
      "description": "Number of items per page, up to 100. Defaults to 20",
      "type": "integer",
      "default": 20,
      "maximum": 100
    },
    "labels": {
      "description": "Labels, separated by commas",
      "type": "string"
    },
    "sort": {
      "description": "Sort basis: created (creation time), updated_at (update time). Defaults to created_at",
      "type": "string",
      "enum": ["created", "updated_at"],
      "default": "created_at"
    },
    "direction": {
      "description": "Sort order: asc (ascending), desc (descending). Defaults to desc",
      "type": "string",
      "enum": ["asc", "desc"],
      "default": "desc"
    },
    "since": {
      "description": "Start of the update time; the time must be in ISO 8601 format",
      "type": "string",
      "format": "date-time"
    },
    "assignees": {
      "description": "Usernames of the assignees",
      "type": "array",
      "items": {"type": "string"}
    },
    "milestone_ids": {
      "description": "Enterprise milestone ID",
      "type": "array",
      "items": {"type": "integer"}
    },
    "project_ids": {
      "description": "Project ID",
      "type": "array",
      "items": {"type": "integer"}
    },
    "create_at": {
      "description": "Task creation date, in the format 2024-11-09",
      "type": "string",
      "format": "date"
    },
    "created_before": {
      "description": "Task creation deadline, in the format 2024-11-09",
      "type": "string",
      "format": "date"
    },
    "search": {
      "description": "Search issue titles by keyword",
      "type": "string"
    },
    "issue_types": {
      "description": "Custom issue type",
      "type": "array",
      "items": {"type": "string"}
    },
    "issue_states": {
      "description": "Custom issue state",
      "type": "array",
      "items": {"type": "string"}
    },
    "custom_fields": {
      "description": "Custom field filters",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "field_name": {
            "description": "Field name",
            "type": "string"
          },
          "values": {
            "description": "List of field values",
            "type": "array",
            "items": {"type": "string"}
          },
          "operation": {
            "description": "Operation type: search (fuzzy search), greater_equal (greater than or equal), less_equal (less than or equal), between (between two values), in (exact match)",
            "type": "string",
            "enum": ["search", "greater_equal", "less_equal", "between", "in"]
          }
        },
        "required": ["operation"]
      }
    }
  },
  "required": []
}

Response parameters

The response body is an array of issue objects. Each element has the following structure:

Field Type Always returned Nullable Description
id integer Yes No Issue ID
html_url string Yes No HTML URL of the issue
number string Yes No Issue number
state string Yes No State
title string Yes No Title
body string Yes No Body
user object Yes No Author
repository object Yes No Repository information
assigner object Yes Yes Assignee
paas string Yes No PaaS identifier
created_at string Yes Yes Creation time
updated_at string Yes Yes Update time
finished_at string Yes Yes Completion time
deadline string Yes Yes Deadline
labels object[] Yes Yes List of labels
issue_state string No Yes Custom issue state
comments integer Yes No Number of comments
custom_fields object[] No Yes Custom issue fields
issue_type string No Yes Issue type
issue_priority string No Yes Issue priority
url string Yes No Issue URL
repository_url string Yes No Repository URL
visibility_reason string No Yes Visibility: public: publicly visible; confidential: private, visible to project members; other: visible only to project members for other reasons
related_branches string[] No Yes List of related branches
linked_pulls object[] No Yes List of linked pull requests

user object

Field Type Always returned Nullable Description
user.id string Yes No User ID
user.object_id string Yes No User object ID
user.login string Yes No Username
user.name string Yes No User name

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.human_name string Yes No Human-readable repository name
repository.path string Yes No Repository path
repository.name string Yes No Repository name
repository.url string Yes No Repository URL
repository.assigner object Yes Yes Assignee
repository.paas string Yes No PaaS identifier

labels array elements

Field Type Always returned Nullable Description
labels.id integer Yes No Label ID
labels.name string Yes No Label name
labels.color string Yes No Label color

custom_fields array elements

Field Type Always returned Nullable Description
custom_fields.field_name string Yes No Field name
custom_fields.field_values string[] Yes No List of field values

linked_pulls array elements

Field Type Always returned Nullable Description
linked_pulls.number integer Yes No Pull request number
linked_pulls.html_url string Yes No HTML URL of the pull request
linked_pulls.user object Yes No Pull request author
linked_pulls.id integer Yes No Pull request ID
linked_pulls.project_id integer Yes No Project ID
linked_pulls.title string Yes No Title
linked_pulls.body string Yes No Body
linked_pulls.state string Yes No State
linked_pulls.created_at string Yes No Creation time
linked_pulls.updated_at string Yes No Update time
linked_pulls.merged_at string Yes No Merge time
linked_pulls.merged_by object Yes No Merged by
linked_pulls.closed_at string Yes No Close time
linked_pulls.target_branch string Yes No Target branch
linked_pulls.source_branch string Yes No Source branch
linked_pulls.source_project_id integer Yes No Source project ID
linked_pulls.target_project_id integer Yes No Target project ID

linked_pulls.user object

Field Type Always returned Nullable Description
linked_pulls.user.id string Yes No User ID
linked_pulls.user.login string Yes No Username
linked_pulls.user.name string Yes No User name
linked_pulls.user.avatar_url string Yes No User avatar URL
linked_pulls.user.html_url string Yes No User profile URL

linked_pulls.merged_by object

Field Type Always returned Nullable Description
linked_pulls.merged_by.id string Yes No User ID
linked_pulls.merged_by.login string Yes No Username
linked_pulls.merged_by.name string Yes No User name
linked_pulls.merged_by.avatar_url string Yes No User avatar URL
linked_pulls.merged_by.html_url string Yes No User profile URL

Error response

This endpoint requires a user access token. If the token is missing or invalid, 401 is returned. The error field names are as actually returned by the backend.

401 Unauthenticated

{
  "error": "unauthorized",
  "message": "Missing or invalid access token"
}

403 Forbidden

{
  "error": "forbidden",
  "message": "You do not have permission to access the issue list of this enterprise"
}

HTTP response status codes

Status code Description
200 Success (OK)
401 Requires authentication
403 Forbidden

Request example

Parameter description

Replace <enterprise_id> with the enterprise ID; replace <token> with your AtomGit user access token.

cURL

curl -X POST 'https://api.atomgit.com/api/v8/enterprises/<enterprise_id>/issues?access_token=<token>' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -d '{
    "page": 1,
    "per_page": 20,
    "labels": "bug,ui",
    "sort": "created",
    "direction": "desc",
    "search": "login"
  }'

JavaScript

// Native fetch (Node.js 18+ / browsers)
const response = await fetch(
  "https://api.atomgit.com/api/v8/enterprises/<enterprise_id>/issues?access_token=<token>",
  {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "Accept": "application/json"
    },
    body: JSON.stringify({
      page: 1,
      per_page: 20,
      labels: "bug,ui",
      sort: "created",
      direction: "desc",
      search: "login"
    })
  }
);

if (!response.ok) {
  throw new Error(`Request failed: ${response.status}`);
}

const data = await response.json();
console.log(data);

Python

import requests

resp = requests.post(
    "https://api.atomgit.com/api/v8/enterprises/<enterprise_id>/issues",
    params={"access_token": "<token>"},
    json={
        "page": 1,
        "per_page": 20,
        "labels": "bug,ui",
        "sort": "created",
        "direction": "desc",
        "search": "login"
    },
    headers={"Accept": "application/json"},
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 200

[
  {
    "id": 12,
    "html_url": "https://api.atomgit.com/enterprises/example/issues/12",
    "number": "12",
    "state": "open",
    "title": "Improve login page styles",
    "body": "Fix the login page style issues on mobile",
    "user": {
      "id": "10001",
      "object_id": "a1b2c3d4",
      "login": "octocat",
      "name": "Octo Cat"
    },
    "repository": {
      "id": 100,
      "full_name": "example/repo",
      "human_name": "Example repository",
      "path": "example/repo",
      "name": "repo",
      "url": "https://api.atomgit.com/example/repo",
      "assigner": {},
      "paas": "gitcode"
    },
    "created_at": "2026-10-01T10:00:00+08:00",
    "updated_at": "2026-10-05T10:00:00+08:00",
    "finished_at": null,
    "deadline": null,
    "labels": [
      {
        "id": 1,
        "name": "bug",
        "color": "#d73a4a"
      }
    ],
    "issue_state": "In progress",
    "comments": 3,
    "custom_fields": [
      {
        "field_name": "Priority",
        "field_values": ["High"]
      }
    ],
    "issue_type": "Requirement",
    "issue_priority": "High",
    "url": "https://api.atomgit.com/api/v8/enterprises/example/issues/12",
    "repository_url": "https://api.atomgit.com/example/repo",
    "visibility_reason": "public",
    "related_branches": ["feature/login"],
    "linked_pulls": [
      {
        "number": 88,
        "html_url": "https://api.atomgit.com/example/repo/pulls/88",
        "user": {
          "id": "10001",
          "login": "octocat",
          "name": "Octo Cat",
          "avatar_url": "https://api.atomgit.com/avatar.png",
          "html_url": "https://api.atomgit.com/octocat"
        },
        "id": 88,
        "project_id": 100,
        "title": "Improve login page styles",
        "body": "Fix mobile styles",
        "state": "merged",
        "created_at": "2026-10-02T10:00:00+08:00",
        "updated_at": "2026-10-03T10:00:00+08:00",
        "merged_at": "2026-10-04T10:00:00+08:00",
        "merged_by": {
          "id": "10001",
          "login": "octocat",
          "name": "Octo Cat",
          "avatar_url": "https://api.atomgit.com/avatar.png",
          "html_url": "https://api.atomgit.com/octocat"
        },
        "closed_at": "2026-10-04T10:00:00+08:00",
        "target_branch": "main",
        "source_branch": "feature/login",
        "source_project_id": 100,
        "target_project_id": 100
      }
    ]
  }
]

Error codes

Error code Description
401 Unauthenticated or invalid credentials (missing/invalid access credential)
400 Invalid parameters or the request cannot be parsed
404 The request path does not exist
429 Too many requests; rate limit triggered
500 Internal system error

Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc