# GitCode API v5 完整文档（全量接口一览）

本文档整理自 [GitCode 官方 API 文档](https://docs.gitcode.com/docs/apis/)，按分类列出 **全部** v5 接口的路径、说明及官方单独文档链接，形成详细界面便于查阅与对接。

---

## 目录

- [通用说明](#通用说明)
- [Repositories（仓库）](#repositories仓库)
- [Branch（分支）](#branch分支)
- [Issues（议题）](#issues议题)
- [Search（搜索）](#search搜索)
- [Pull Requests（合并请求）](#pull-requests合并请求)
- [Commit（提交）](#commit提交)
- [Tag（标签）](#tag标签)
- [Labels（标签）](#labels标签)
- [Milestone（里程碑）](#milestone里程碑)
- [Users（用户）](#users用户)
- [Organizations（组织）](#organizations组织)
- [Webhooks](#webhooks)
- [Member（成员）](#member成员)
- [Release（发布）](#release发布)
- [Enterprise（企业，v8）](#enterprise企业v8)
- [Dashboard（看板）](#dashboard看板)
- [OAuth2.0 / AI hub](#oauth20--ai-hub)
- [响应与文档说明](#响应与文档说明)
- [文档来源与更新](#文档来源与更新)

**约定**：官方文档链接格式为 `https://docs.gitcode.com/docs/apis/{slug}`，表中「官方文档」列可直接点击进入该接口的请求参数、响应示例与 Demo。

---

## 通用说明

| 项目 | 说明 |
|------|------|
| **Base URL** | `https://api.gitcode.com/api/v5` |
| **认证** | 请求头 `PRIVATE-TOKEN: {token}` 或 `Authorization: Bearer {token}`，或 query `access_token={token}`；多数列表/获取接口必选。 |
| **状态码** | 200/201/204 成功；400 缺参或未认证；401 无效/缺失 Token；403/404/409/422 禁止/未找到/冲突；429 限流（默认 50/分、4000/小时）。 |
| **官方入口** | [API 文档总览](https://docs.gitcode.com/docs/apis/)（侧栏展开各分类可看到全部接口）。 |

---

## Repositories（仓库）

| Method | Path | 功能说明 | 可获取信息 | 官方文档 |
|--------|------|----------|------------|----------|
| GET | `/repos/{owner}/{repo}` | 获取仓库详情（含 star/fork/watch 数量等） | `stargazers_count`（星标数，该仓库被 star 的总数）、`forks_count`（Fork 数，被 fork 的次数）、`watchers_count`（关注数，watch 该仓库的用户数）、`full_name`（仓库全名，如 owner/repo）、`description`（仓库描述）、`default_branch`（默认分支名）、`open_issues_count`（未关闭的 Issue 数）等 | [获取仓库详情](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo) |
| GET | `/repos/{owner}/{repo}/git/trees/{sha}` | 获取仓库目录Tree | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`sha`（string，必填） 可以是分支名(如master)、Commit或者目录Tree的SHA；查询参数：`access_token`（string，必填） 用户授权码、`page`（integer，可选） 当前的页码、`per_page`（integer，可选） 每页的数量，最大为 100，默认 20、`recursive`（integer，可选） 赋值为1递归获取目录、`file_path`（string，可选） 文件树路径；响应：`tree`（object[]）、`sha`（string）、`name`（string）、`type`（string）、`path`（string）、`mode`（string）、`md5`（string） | [获取仓库目录Tree](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-git-trees-sha) |
| GET | `/repos/{owner}/{repo}/contents/{path}` | 获取仓库具体路径下的内容 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`path`（string，必填） 文件的路径；查询参数：`access_token`（string，必填） 用户授权码、`ref`（string，可选） 分支、tag或commit。默认: 仓库的默认分支(main)；响应：`type`（string）、`encoding`（string）、`size`（integer）、`name`（string）、`path`（string）、`content`（string）、`sha`（string）、`url`（string）、`html_url`（string）、`download_url`（string）、`_links`（object）、`self`（string）、`html`（string） | [获取仓库具体路径下的内容](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-contents-path) |
| POST | `/repos/{owner}/{repo}/contents/{path}` | 新建文件 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`path`（string，必填） 文件路径；查询参数：`access_token`（string，必填） 用户授权码；响应：`commit`（object）、`sha`（string）、`author`（object）、`name`（string）、`email`（string）、`date`（string）、`committer`（object）、`name`（string）、`email`（string）、`date`（string）、`message`（string）、`parents`（object[]）、`sha`（string） | [新建文件](https://docs.gitcode.com/docs/apis/post-api-v-5-repos-owner-repo-contents-path) |
| PUT | `/repos/{owner}/{repo}/contents/{path}` | 更新文件 | 路径参数：`owner`（string） 仓库所属空间地址(组织或个人的地址path)、`repo`（string） 仓库路径(path)、`path`（string） 文件的路径；查询参数：`access_token`（string） 用户授权码；响应：`commit`（object）、`sha`（string）、`author`（object）、`name`（string）、`email`（string）、`date`（string）、`committer`（object）、`name`（string）、`email`（string）、`date`（string）、`message`（string）、`tree`（string）、`parents`（string[]）、`content`（object） 等 | [更新文件](https://docs.gitcode.com/docs/apis/put-api-v-5-repos-owner-repo-contents-path) |
| DELETE | `/repos/{owner}/{repo}/contents/{path}` | 删除文件 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`path`（string，必填） 文件的路径；查询参数：`access_token`（string，必填） 用户授权码；响应：`commit`（object）、`sha`（string）、`author`（object）、`name`（string）、`email`（string）、`date`（string）、`committer`（object）、`name`（string）、`email`（string）、`date`（string）、`message`（string）、`tree`（string）、`parents`（string[]） | [删除文件](https://docs.gitcode.com/docs/apis/delete-api-v-5-repos-owner-repo-contents-path) |
| GET | `/repos/{owner}/{repo}/file_list` | 获取文件列表 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码、`ref_name`（string，可选） ref(分支、tag、commit)、`file_name`（string，可选） 要查找的文件名称；响应：`ref_name`（string）、`file_name`（string） | [获取文件列表](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-file-list) |
| GET | `/repos/{owner}/{repo}/git/blobs/{sha}` | 获取文件Blob | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`sha`（string，必填） 文件的 Blob SHA，可通过 [获取仓库具体路径下的内容] API 获取；查询参数：`access_token`（string，必填） 用户授权码；响应：`sha`（string）、`size`（integer）、`url`（string）、`content`（string）、`encoding`（string） | [获取文件Blob](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-git-blobs-sha) |
| GET | `/repos/{owner}/{repo}/languages` | 获取仓库的语言 | 路径参数：`owner`（string） 仓库所属空间地址(组织或个人的地址path)、`repo`（string） 仓库路径(path)；查询参数：`access_token`（string） 用户授权码；响应：`Shell`（number）、`Python`（number） | [获取仓库的语言](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-languages) |
| GET | `/repos/{owner}/{repo}/contributors` | 获取仓库贡献者 | 路径参数：`owner`（string，必填） 仓库所属空间地址（企业、组织或个人的地址path）、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码、`type`（string，可选） 贡献者类型(committers/authors)；响应：`name`（string）、`contributions`（integer）、`email`（string） | [获取仓库贡献者](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-contributors) |
| PUT | `/repos/{owner}/{repo}/module/setting` | 设置项目模块 | 操作结果 | [设置项目模块](https://docs.gitcode.com/docs/apis/put-api-v-5-repos-owner-repo-module-setting) |
| PATCH | `/repos/{owner}/{repo}` | 更新仓库设置 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码；响应：`id`（integer）、`full_name`（string）、`human_name`（string）、`url`（string）、`path`（string）、`name`（string）、`description`（string）、`private`（integer）、`public`（integer）、`namespace`（object）、`id`（integer）、`name`（string）、`path`（string）、`develop_mode`（string） 等 | [更新仓库设置](https://docs.gitcode.com/docs/apis/patch-api-v-5-repos-owner-repo) |
| DELETE | `/repos/{owner}/{repo}` | 删除一个仓库 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码 | [删除一个仓库](https://docs.gitcode.com/docs/apis/delete-api-v-5-repos-owner-repo) |
| PUT | `/repos/{owner}/{repo}/reviewer` | 修改项目代码审查设置 | 操作结果 | [修改项目代码审查设置](https://docs.gitcode.com/docs/apis/put-api-v-5-repos-owner-repo-reviewer) |
| PUT | `/org/{org}/repo/{repo}/status` | 仓库归档 | 路径参数：`org`（string，必填） 仓库所属组织、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码；响应：`code`（integer）、`msg`（string） | [仓库归档](https://docs.gitcode.com/docs/apis/put-api-v-5-org-org-repo-repo-status) |
| POST | `/org/{org}/projects/{repo}/transfer` | 转移仓 | 路径参数：`org`（string，必填） 仓库所属组织、`repo`（string，必填） 仓库路径；查询参数：`access_token`（string，必填） 用户授权码；响应：`code`（integer）、`msg`（string） | [转移仓](https://docs.gitcode.com/docs/apis/post-api-v-5-org-org-projects-repo-transfer) |
| GET | `/repos/{owner}/{repo}/transition` | 获取项目的权限模式 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码；响应：`memberMgntMode`（integer） | [获取项目的权限模式](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-transition) |
| PUT | `/repos/{owner}/{repo}/transition` | 更新仓库的权限模式 | 操作结果 | [更新仓库的权限模式](https://docs.gitcode.com/docs/apis/put-api-v-5-repos-owner-repo-transition) |
| PUT | `/repos/{owner}/{repo}/push_config` | 设置项目推送规则 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码；响应：`reject_not_signed_by_gpg`（integer）、`deny_force_push`（integer）、`max_file_size`（integer）、`skip_rule_for_owner`（integer） | [设置项目推送规则](https://docs.gitcode.com/docs/apis/put-api-v-5-repos-owner-repo-push-config) |
| GET | `/repos/{owner}/{repo}/push_config` | 获取项目推送规则 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码；响应：`reject_not_signed_by_gpg`（integer）、`deny_force_push`（integer）、`max_file_size`（integer）、`skip_rule_for_owner`（integer） | [获取项目推送规则](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-push-config) |
| POST | `/repos/{owner}/{repo}/forks` | Fork一个仓库 | 路径参数：`owner`（string，必填） 仓库所属空间地址(企业、组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码；响应：`id`（integer）、`full_name`（string）、`human_name`（string）、`url`（string）、`namespace`（object）、`id`（integer）、`name`（string）、`path`（string）、`develop_mode`（string）、`cell`（string）、`kind`（string）、`full_path`（string）、`full_name`（string）、`visibility_level`（integer） 等 | [Fork一个仓库](https://docs.gitcode.com/docs/apis/post-api-v-5-repos-owner-repo-forks) |
| GET | `/repos/{owner}/{repo}/forks` | 查看仓库的Forks | 路径参数：`owner`（string，必填） 仓库所属空间地址(企业、组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码、`sort`（string，可选） 排序方式: fork的时间(newest, oldest)，star的人数(stargazers)、`page`（integer，可选） 当前的页码、`per_page`（integer，可选） 每页的数量，最大为 100，默认 20、`created_after`（string，可选） 在此之后创建的、`created_before`（string，可选） 在此之前创建的；响应：`id`（integer）、`full_name`（string）、`human_name`（string）、`url`（string）、`namespace`（object）、`id`（integer）、`type`（string）、`name`（string）、`path`（string）、`html_url`（string）、`description`（string）、`status`（string）、`created_at`（string）、`updated_at`（string） 等 | [查看仓库的Forks](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-forks) |
| POST | `/repos/{owner}/{repo}/img/upload` | 上传图片 | 路径参数：`owner`（string，必填） 仓库所属空间地址(企业、组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码；响应：`success`（integer）、`path`（string）、`full_path`（string） | [上传图片](https://docs.gitcode.com/docs/apis/post-api-v-5-repos-owner-repo-img-upload) |
| POST | `/repos/{owner}/{repo}/file/upload` | 上传文件 | 文件 URL 等信息 | [上传文件](https://docs.gitcode.com/docs/apis/post-api-v-5-repos-owner-repo-file-upload) |
| GET | `/repos/{owner}/{repo}/subscribers` | 列出 watch 了仓库的用户 | 路径参数：`owner`（string，必填） 仓库所属空间地址(企业、组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码、`page`（integer，可选） 当前的页码、`per_page`（integer，可选） 每页的数量，最大为 100，默认 20、`watched_after`（string，可选） 在此之后watch的、`watched_before`（string，可选） 在此之前watch的；响应：`id`（integer）、`login`（string）、`name`（string）、`avatar_url`（string）、`watch_at`（string） | [列出 watch 了仓库的用户](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-subscribers) |
| GET | `/repos/{owner}/{repo}/stargazers` | 列出 star 了仓库的用户 | 路径参数：`owner`（string，必填） 仓库所属空间地址(企业、组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码、`page`（integer，可选） 当前的页码、`per_page`（integer，可选） 每页的数量，最大为 100，默认 20、`starred_after`（string，可选） 在此之后star的、`starred_before`（string，可选） 在此之前star的；响应：`id`（integer）、`login`（string）、`name`（string）、`avatar_url`（string）、`starred_at`（string） | [列出 star 了仓库的用户](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-stargazers) |
| PUT | `/repos/{owner}/{repo}/repo_settings` | 更新仓库设置 | 操作结果 | [更新仓库设置](https://docs.gitcode.com/docs/apis/put-api-v-5-repos-owner-repo-repo-settings) |
| GET | `/repos/{owner}/{repo}/repo_settings` | 获取仓库设置 | 路径参数：`owner`（string，必填） 仓库所属空间地址(企业、组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码；响应：`disable_fork`（integer）、`forbidden_developer_create_branch`（integer）、`forbidden_developer_create_tag`（integer）、`forbidden_committer_create_branch`（integer）、`generate_pre_merge_ref`（integer）、`forbidden_gitlab_access`（integer）、`rebase_disable_trigger_webhook`（integer）、`include_lfs_objects`（integer） | [获取仓库设置](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-repo-settings) |
| GET | `/repos/{owner}/{repo}/pull_request_settings` | 获取 Pull Request设置 | 路径参数：`owner`（string，必填） 仓库所属空间地址(企业、组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码；响应：`merge_request_setting`（object）、`id`（integer）、`project_id`（integer）、`disable_merge_by_self`（boolean）、`created_at`（string）、`updated_at`（string）、`can_force_merge`（boolean）、`disable_squash_merge`（boolean）、`approval_required_reviewers`（integer）、`approval_required_approvers`（integer）、`add_notes_after_merged`（boolean）、`merged_commit_author`（string）、`mark_auto_merged_mr_as_closed`（boolean）、`delete_source_branch_when_merged`（boolean） 等 | [获取 Pull Request设置](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-pull-request-settings) |
| PUT | `/repos/{owner}/{repo}/pull_request_settings` | 更新 Pull Request设置 | 操作结果 | [更新 Pull Request设置](https://docs.gitcode.com/docs/apis/put-api-v-5-repos-owner-repo-pull-request-settings) |
| PUT | `/repos/{owner}/{repo}/members/{username}` | 更新项目成员角色 | 操作结果 | [更新项目成员角色](https://docs.gitcode.com/docs/apis/put-api-v-5-repos-owner-repo-members-username) |
| POST | `/repos/{owner}/{repo}/transfer` | 仓库转移 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码；响应：`new_owner`（string）、`new_name`（string） | [仓库转移](https://docs.gitcode.com/docs/apis/post-api-v-5-repos-owner-repo-transfer) |
| GET | `/repos/{owner}/{repo}/customized_roles` | 获取项目自定义角色 | 自定义角色列表 | [获取项目自定义角色](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-customized-roles) |
| GET | `/repos/{owner}/{repo}/download_statistics` | 下载次数统计 | 路径参数：`owner`（string，必填） 仓库所属空间地址(企业、组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码、`start_date`（string，可选） 统计起始日期包含当前日期（eg:2024-01-06)、`end_date`（string，可选） 统计截止日期包含当前日期 (eg: 2024-12-06)、`direction`（string，可选） 排序方式: 升序(asc)，降序(desc)。默认: desc；响应：`download_statistics_detail`（object[]）、`pdate`（string）、`repo_id`（string）、`today_dl_cnt`（integer）、`total_dl_cnt`（integer）、`download_statistics_total`（integer）、`download_statistics_history_total`（integer） | [下载次数统计](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-download-statistics) |
| GET | `/repos/{owner}/{repo}/raw/{path}` | 获取 raw 文件 | 路径参数：`owner`（string，必填） 仓库所属空间地址(企业、组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`path`（string，必填） 文件的路径，特殊字符需转码；查询参数：`access_token`（string，必填） 用户授权码、`ref`（string，可选） 分支、tag 或 commit(默认: 仓库的默认分支)；响应：`ref`（string） | [获取 raw 文件](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-raw-path) |
| GET | `/repos/{owner}/{repo}/contributors/statistic` | 获取仓库贡献者统计信息 | 各贡献者的统计明细 | [获取仓库贡献者统计信息](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-contributors-statistic) |
| GET | `/repos/{owner}/{repo}/events` | 获取仓库动态 | 动态事件列表 | [获取仓库动态](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-events-access-token-your-token) |
---

## Branch（分支）

| Method | Path | 功能说明 | 可获取信息 | 官方文档 |
|--------|------|----------|------------|----------|
| GET | `/repos/{owner}/{repo}/branches` | 获取项目所有分支 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码、`sort`（string，可选） 排序字段 name/updated、`direction`（string，可选） 排序方向 asc/desc、`page`（integer，可选） 当前的页码、`per_page`（integer，可选） 每页的数量，最大为 100，默认 20；响应：`name`（string）、`commit`（object）、`commit`（object）、`author`（object）、`name`（string）、`date`（string）、`email`（string）、`committer`（object）、`name`（string）、`date`（string）、`email`（string）、`message`（string）、`sha`（string）、`url`（string） 等 | [获取项目所有分支](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-branches) |
| POST | `/repos/{owner}/{repo}/branches` | 创建分支（body: ref, branch 名） | 路径参数：`owner`（string，必填） 仓库所属空间地址（企业、组织或个人的地址path）、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码；响应：`name`（string）、`commit`（object）、`commit`（object）、`author`（object）、`name`（string）、`date`（string）、`email`（string）、`committer`（object）、`name`（string）、`date`（string）、`email`（string）、`message`（string）、`sha`（string）、`url`（string） 等 | [创建分支](https://docs.gitcode.com/docs/apis/post-api-v-5-repos-owner-repo-branches) |
| DELETE | `/repos/{owner}/{repo}/branches/{name}` | 删除指定分支 | 路径参数：`owner`（string，必填） 仓库所属空间地址（企业、组织或个人的地址path）、`repo`（string，必填） 仓库路径(path)、`name`（string，必填） 分支名称；查询参数：`access_token`（string，必填） 用户授权码 | [删除分支](https://docs.gitcode.com/docs/apis/delete-api-v-5-repos-owner-repo-branches-name) |
| GET | `/repos/{owner}/{repo}/branches/{branch}` | 获取单个分支 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`branch`（string，必填） 分支名称；查询参数：`access_token`（string，必填） 用户授权码；响应：`name`（string）、`commit`（object）、`id`（string）、`message`（string）、`parent_ids`（string[]）、`authored_date`（string）、`author_name`（string）、`author_iam_id`（null）、`author_email`（string）、`author_user_name`（null）、`committed_date`（string）、`committer_name`（string）、`committer_email`（string）、`committer_user_name`（null） 等 | [获取单个分支](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-branches-branch) |
| PUT | `/repos/{owner}/{repo}/branches/setting/new` | 新建保护分支规则 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码 | [新建保护分支规则](https://docs.gitcode.com/docs/apis/put-api-v-5-repos-owner-repo-branches-setting-new) |
| DELETE | `/repos/{owner}/{repo}/branches/{wildcard}/setting` | 删除保护分支规则 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`wildcard`（string，必填） 分支名；查询参数：`access_token`（string，必填） 用户授权码 | [删除保护分支规则](https://docs.gitcode.com/docs/apis/delete-api-v-5-repos-owner-repo-branches-wildcard-setting) |
| GET | `/repos/{owner}/{repo}/protect_branches` | 获取保护分支规则列表 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码；响应：`name`（string）、`updated_at`（string）、`push_users`（object[]）、`merge_users`（object[]）、`merged`（integer）、`developers_can_push`（integer）、`developers_can_merge`（integer）、`committer_can_push`（integer）、`committer_can_merge`（integer）、`master_can_push`（integer）、`master_can_merge`（integer）、`maintainer_can_push`（integer）、`maintainer_can_merge`（integer）、`owner_can_push`（integer） 等 | [获取保护分支规则列表](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-protect-branches) |
| PUT | `/repos/{owner}/{repo}/branches/{wildcard}/setting` | 更新保护分支规则 | 操作结果 | [更新保护分支规则](https://docs.gitcode.com/docs/apis/put-api-v-5-repos-owner-repo-branches-wildcard-setting) |

---

## Issues（议题）

| Method | Path | 功能说明 | 可获取信息 | 官方文档 |
|--------|------|----------|------------|----------|
| POST | `/repos/{owner}/issues` | 创建Issue | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)；查询参数：`access_token`（string，必填） 用户授权码；响应：`id`（integer）、`html_url`（string）、`number`（integer）、`state`（string）、`title`（string）、`body`（string）、`user`（object）、`avatar_url`（string）、`events_url`（null）、`followers_url`（null）、`following_url`（null）、`gists_url`（null）、`html_url`（string）、`id`（string） 等 | [创建Issue](https://docs.gitcode.com/docs/apis/post-api-v-5-repos-owner-issues) |
| PATCH | `/repos/{owner}/issues/{number}` | 更新Issue | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`number`（string，必填） 第几个 issue，即本仓库 issue 的序数；查询参数：`access_token`（string，必填） 用户授权码；响应：`id`（integer）、`html_url`（string）、`number`（integer）、`state`（string）、`title`（string）、`body`（string）、`user`（object）、`avatar_url`（string）、`events_url`（null）、`followers_url`（null）、`following_url`（null）、`gists_url`（null）、`html_url`（string）、`id`（string） 等 | [更新Issue](https://docs.gitcode.com/docs/apis/patch-api-v-5-repos-owner-issues-number) |
| GET | `/repos/{owner}/{repo}/issues/{number}` | 获取仓库的某个Issue | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（string，必填） Issue 编号(区分大小写，无需添加 # 号)；查询参数：`access_token`（string，必填） 用户授权码；响应：`id`（integer）、`html_url`（string）、`number`（string）、`state`（string）、`title`（string）、`body`（string）、`user`（object）、`avatar_url`（string）、`html_url`（string）、`id`（string）、`login`（string）、`name`（string）、`repository`（object）、`id`（integer） 等 | [获取仓库的某个Issue](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-issues-number) |
| GET | `/repos/{owner}/{repo}/issues` | 获取仓库所有 issues（可 state、per_page、page 筛选） | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码、`state`（string，可选） Issue的状态: open（开启的）, closed（关闭的）， all (所有)。 默认: all、`labels`（string，可选） 用逗号分开的标签。如: bug,performance、`sort`（string，可选） 排序依据: 创建时间(created)，更新时间(updated)。默认: created、`direction`（string，可选） 排序方式: 升序(asc)，降序(desc)。默认: desc、`since`（string，可选） 起始的更新时间，要求时间格式为 2024-11-10T08:10:30.000+08:00（注意+号要url编码为%2B）、`page`（integer，可选） 当前的页码、`per_page`（integer，可选） 每页的数量，最大为 100，默认 20 等；响应：`id`（integer）、`html_url`（string）、`number`（string）、`state`（string）、`title`（string）、`body`（string）、`user`（object）、`avatar_url`（string）、`html_url`（string）、`id`（string）、`login`（string）、`name`（string）、`repository`（object）、`id`（integer） 等 | [获取仓库所有 issues](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-issues) |
| GET | `/repos/{owner}/{repo}/issues/{number}/comments` | 获取仓库某个Issue所有的评论 | 路径参数：`owner`（string，必填） 仓库所属空间地址(企业、组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（string，必填） Issue 编号(区分大小写，无需添加 # 号)；查询参数：`access_token`（string，必填） 用户授权码、`page`（integer，可选） 当前的页码、`per_page`（integer，可选） 每页的数量，最大为 100，默认 20、`order`（string，可选） 排序顺序: asc(default),desc、`since`（string，可选） 起始的更新时间，要求时间格式为 2024-11-10T08:10:30.000+08:00（注意+号要url编码为%2B）；响应：`id`（integer）、`body`（string）、`user`（object）、`avatar_url`（string）、`events_url`（null）、`followers_url`（null）、`following_url`（null）、`gists_url`（null）、`html_url`（string）、`id`（string）、`login`（string）、`member_role`（null）、`name`（string）、`organizations_url`（null） 等 | [获取仓库某个Issue所有的评论](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-issues-number-comments) |
| POST | `/repos/{owner}/{repo}/issues/{number}/comments` | 创建Issue评论 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（string，必填） issue编号；查询参数：`access_token`（string，必填） 用户授权码；响应：`id`（integer）、`body`（string）、`user`（object）、`avatar_url`（string）、`events_url`（null）、`followers_url`（null）、`following_url`（null）、`gists_url`（null）、`html_url`（string）、`id`（string）、`login`（string）、`member_role`（null）、`name`（string）、`organizations_url`（null） 等 | [创建Issue评论](https://docs.gitcode.com/docs/apis/post-api-v-5-repos-owner-repo-issues-number-comments) |
| GET | `/repos/{owner}/{repo}/issues/comments` | 获取仓库所有 Issue 评论 | 路径参数：`owner`（string，必填） 仓库所属空间地址(企业、组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码、`sort`（string，可选） Either created or updated. Default: created、`direction`（string，可选） Either asc or desc. Ignored without the sort parameter.、`since`（string，可选） Only comments updated at or after this time are returned. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ、`page`（integer，可选） 当前的页码、`per_page`（integer，可选） 每页的数量，最大为 100，默认 20；响应：`id`（integer）、`body`（string）、`user`（object）、`avatar_url`（string）、`events_url`（null）、`followers_url`（null）、`following_url`（null）、`gists_url`（null）、`html_url`（string）、`id`（string）、`login`（string）、`member_role`（null）、`name`（string）、`organizations_url`（null） 等 | [获取仓库所有 Issue 评论](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-issues-comments) |
| GET | `/repos/{owner}/{repo}/issues/{number}/pull_requests` | 获取 issue 关联的 pull requests | 路径参数：`owner`（string，必填） 仓库所属空间地址(企业、组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（string，必填） Issue 编号(区分大小写，无需添加 # 号)；查询参数：`access_token`（string，必填） 用户授权码、`mode`（integer，可选） 1 (增强模式，传上述参数，返回 pr 的 mergeable 状态）; 0(默认，不返回mergeable 状态)；响应：`id`（integer）、`html_url`（string）、`diff_url`（string）、`number`（integer）、`state`（string）、`title`（string）、`body`（string）、`created_at`（string）、`updated_at`（string）、`merged_at`（null）、`closed_at`（null）、`head`（object）、`ref`（string）、`sha`（string） 等 | [获取 issue 关联的 pull requests](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-issues-number-pull-requests) |
| GET | `/enterprises/{enterprise}/issues/{issue_id}/labels` | 获取企业某个Issue所有标签 | 路径参数：`enterprise`（string，必填） 企业名(path)、`issue_id`（string，必填） issue 全局唯一id；查询参数：`access_token`（string，必填） 用户授权码、`page`（integer，可选） 当前的页码、`per_page`（integer，可选） 每页的数量，最大为 100，默认 20；响应：`color`（string）、`name`（string）、`id`（integer）、`url`（string） | [获取企业某个Issue所有标签](https://docs.gitcode.com/docs/apis/get-api-v-5-enterprises-enterprise-issues-issue-id-labels) |
| POST | `/repos/{owner}/{repo}/issues/{number}/labels` | 创建Issue标签 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（string，必填） issue编号；查询参数：`access_token`（string，必填） 用户授权码；响应：`color`（string）、`name`（string）、`id`（integer）、`title`（string）、`type`（null）、`textColor`（string） | [创建Issue标签](https://docs.gitcode.com/docs/apis/post-api-v-5-repos-owner-repo-issues-number-labels) |
| DELETE | `/repos/{owner}/{repo}/issues/{number}/labels/{name}` | 删除Issue标签 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（string，必填） 第几个Issue，即本仓库Issue的序数、`name`（string，必填） 标签名称(批量删除用英文逗号分隔，如: bug,feature)；查询参数：`access_token`（string，必填） 用户授权码 | [删除Issue标签](https://docs.gitcode.com/docs/apis/delete-api-v-5-repos-owner-repo-issues-number-labels-name) |
| GET | `/repos/{owner}/issues/{number}/operate_logs` | 获取某个issue下的操作日志 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`number`（string，必填） issue编号；查询参数：`access_token`（string，必填） 用户授权码、`repo`（string，必填） 仓库路径(path)；响应：`id`（integer）、`user`（object）、`avatar_url`（string）、`events_url`（null）、`followers_url`（null）、`following_url`（null）、`gists_url`（null）、`html_url`（string）、`id`（string）、`login`（string）、`member_role`（null）、`name`（string）、`organizations_url`（null）、`received_events_url`（null） 等 | [获取某个issue下的操作日志](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-issues-number-operate-logs) |
| GET | `/enterprises/{enterprise}/issues` | 获取某个企业的所有Issues | 路径参数：`enterprise`（string，必填） 企业的路径(path/login)；查询参数：`access_token`（string，必填） 用户授权码、`state`（string，可选） Issue的状态: open（开启的）, closed（关闭的）, all（所有） 默认: open、`labels`（string，可选） 用逗号分开的标签。如: bug,performance、`sort`（string，可选） 排序依据: 创建时间(created)，更新时间(updated_at)。默认: created_at、`direction`（string，可选） 排序方式: 升序(asc)，降序(desc)。默认: desc、`since`（string，可选） 起始的更新时间，要求时间格式为 ISO 8601、`page`（integer，可选） 当前的页码、`per_page`（integer，可选） 每页的数量，最大为 100，默认 20 等；响应：`id`（integer）、`html_url`（string）、`number`（string）、`state`（string）、`title`（string）、`body`（string）、`user`（object）、`id`（string）、`login`（string）、`name`（string）、`repository`（object）、`id`（integer）、`full_name`（string）、`human_name`（string） 等 | [获取某个企业的所有Issues](https://docs.gitcode.com/docs/apis/get-api-v-5-enterprises-enterprise-issues) |
| GET | `/user/issues` | 获取授权用户的所有Issues | 查询参数：`access_token`（string，必填） 用户授权码、`filter`（string，可选） 筛选参数: 授权用户负责的(assigned)，授权用户创建的(created)，包含前两者的(all)。默认: assigned、`state`（string，可选） Issue的状态: open（开启的）, progressing(进行中), closed（关闭的）, rejected（拒绝的）。默认: open、`labels`（string，可选） 用逗号分开的标签。如: bug,performance、`sort`（string，可选） 排序依据: 创建时间(created)，更新时间(updated_at)。默认: created_at、`direction`（string，可选） 排序方式: 升序(asc)，降序(desc)。默认: desc、`since`（string，可选） 起始的更新时间，要求时间格式为 ISO 8601、`page`（integer，可选） 当前的页码 等；响应：`id`（integer）、`html_url`（string）、`number`（string）、`state`（string）、`title`（string）、`body`（string）、`assignee`（object）、`avatar_url`（string）、`html_url`（string）、`id`（string）、`login`（string）、`name`（string）、`type`（string）、`repository`（object） 等 | [获取授权用户的所有Issues](https://docs.gitcode.com/docs/apis/get-api-v-5-user-issues) |
| PATCH | `/repos/{owner}/{repo}/issues/comments/{id}` | 更新Issue某条评论 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`id`（string，必填） 评论 ID；查询参数：`access_token`（string，必填） 用户授权码 | [更新Issue某条评论](https://docs.gitcode.com/docs/apis/patch-api-v-5-repos-owner-repo-issues-comments-id) |
| DELETE | `/repos/{owner}/{repo}/issues/comments/{id}` | 删除Issue某条评论 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`id`（string，必填） 评论 ID；查询参数：`access_token`（string，必填） 用户授权码 | [删除Issue某条评论](https://docs.gitcode.com/docs/apis/delete-api-v-5-repos-owner-repo-issues-comments-id) |
| GET | `/repos/{owner}/{repo}/issues/comments/{id}` | 获取仓库Issue某条评论 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`id`（string，必填） 评论 ID；查询参数：`access_token`（string，必填） 用户授权码；响应：`id`（integer）、`body`（string）、`comment_type`（string）、`user`（object）、`id`（string）、`login`（string）、`name`（string）、`type`（string）、`target`（object）、`issue`（object）、`id`（integer）、`title`（string）、`number`（string）、`created_at`（string） 等 | [获取仓库Issue某条评论](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-issues-comments-id) |
| GET | `/orgs/{org}/issues` | 获取当前用户某个组织的Issues | 路径参数：`org`（string，必填） 组织的路径(path/login)；查询参数：`access_token`（string，必填） 用户授权码、`filter`（string，可选） 筛选参数：授权用户负责的(assigned)，授权用户创建的(created)，包含前两者的(all)。默认：assigned、`state`（string，可选） Issue的状态：open（开启的）, closed（关闭的）,默认：open、`labels`（string，可选） 用逗号分开的标签。如：bug,performance、`sort`（string，可选） 排序依据：创建时间(created)，更新时间(updated_at)。默认：created_at、`direction`（string，可选） 排序方式：升序(asc)，降序(desc)。默认：desc、`page`（integer，可选） 当前的页码、`per_page`（integer，可选） 每页的数量，最大为 100，默认 20 等；响应：`id`（integer）、`html_url`（string）、`number`（string）、`state`（string）、`title`（string）、`body`（string）、`user`（object）、`id`（string）、`login`（string）、`name`（string）、`assignee`（object）、`avatar_url`（string）、`html_url`（string）、`id`（string） 等 | [获取当前用户某个组织的Issues](https://docs.gitcode.com/docs/apis/get-api-v-5-orgs-org-issues) |
| GET | `/enterprises/{enterprise}/issues/{number}/comments` | 获取企业某个Issue所有评论 | 路径参数：`enterprise`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`number`（integer，必填） issue 全局唯一 id；查询参数：`access_token`（string，必填） 用户授权码、`page`（integer，可选） 当前的页码、`per_page`（integer，可选） 每页的数量：最大为 100，默认 20；响应：`body`（string）、`created_at`（string）、`id`（integer）、`target`（object）、`issue`（object）、`id`（integer）、`iid`（integer）、`title`（string）、`updated_at`（string）、`user`（object）、`id`（integer）、`login`（string）、`name`（string）、`type`（string） | [获取企业某个Issue所有评论](https://docs.gitcode.com/docs/apis/get-api-v-5-enterprises-enterprise-issues-number-comments) |
| GET | `/enterprises/{enterprise}/issues/{number}` | 获取企业的某个Issue | 路径参数：`enterprise`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`number`（integer，必填） issue 全局唯一 id；查询参数：`access_token`（string，必填） 用户授权码；响应：`id`（integer）、`html_url`（string）、`number`（string）、`state`（string）、`title`（string）、`body`（string）、`user`（object）、`avatar_url`（string）、`html_url`（string）、`id`（string）、`login`（string）、`name`（string）、`repository`（object）、`id`（integer） 等 | [获取企业的某个Issue](https://docs.gitcode.com/docs/apis/get-api-v-5-enterprises-enterprise-issues-number) |
| GET | `/enterprises/{enterprise}/issue/statuses` | 获取企业issue状态 | 路径参数：`enterprise`（string，必填）；查询参数：`access_token`（string，可选） 用户授权码；响应：`access_token`（string） | [获取企业issue状态](https://docs.gitcode.com/docs/apis/get-api-v-5-enterprises-enterprise-issue-statuses) |
| GET | `/repos/{owner}/{repo}/issues/{number}/related_branches` | 获取issue关联的分支列表 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（string，必填） Issue 编号(区分大小写，无需添加 # 号)；查询参数：`access_token`（string，必填） 用户授权码 | [获取issue关联的分支列表](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-issues-number-related-branches) |
| GET | `/repos/{owner}/{repo}/issues/{number}/user_reactions` | 获取issue的表态列表 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（string，必填） Issue 编号(区分大小写，无需添加 # 号)；查询参数：`access_token`（string，必填） 用户授权码、`page`（string，可选） 当前页码、`per_page`（string，可选） 每页数量、`emoji_name`（string，可选） emoji表情，可选：like，dislike，smile，confused，love，rocket，eyes，party；响应：`page`（string）、`per_page`（string）、`emoji_name`（string） | [获取issue的表态列表](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-issues-number-user-reactions) |
| GET | `/repos/{owner}/{repo}/issues/comment/{comment_id}/user_reactions` | 获取issue评论的表态列表 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`comment_id`（string，必填） 评论的id；查询参数：`access_token`（string，必填） 用户授权码、`page`（string，可选） 当前页码、`per_page`（string，可选） 每页数量、`emoji_name`（string，可选） emoji表情，可选：like，dislike，smile，confused，love，rocket，eyes，party；响应：`page`（string）、`per_page`（string）、`emoji_name`（string） | [获取issue评论的表态列表](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-issues-comment-comment-id-user-reactions) |
| GET | `/repos/{owner}/{repo}/issues/{number}/modify_history` | 获取issue的修改历史 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（string，必填） Issue 编号(区分大小写，无需添加 # 号)；查询参数：`access_token`（string，必填） 用户授权码 | [获取issue的修改历史](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-issues-number-modify-history) |
| GET | `/repos/{owner}/{repo}/issues/comment/{comment_id}/modify_history` | 获取issue评论的修改历史 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`comment_id`（string，必填） 评论的id；查询参数：`access_token`（string，必填） 用户授权码 | [获取issue评论的修改历史](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-issues-comment-comment-id-modify-history) |
| PUT | `/repos/{owner}/{repo}/issues/{number}/related_branches` | 设置Issue关联的分支 | 操作结果 | [设置Issue关联的分支](https://docs.gitcode.com/docs/apis/put-api-v-5-repos-owner-repo-issues-number-related-branches) |

---

## Search（搜索）

| Method | Path | 功能说明 | 可获取信息 | 官方文档 |
|--------|------|----------|------------|----------|
| GET | `/search/users` | 搜索用户（q 关键词，sort、order、per_page、page） | 查询参数：`access_token`（string，必填） 用户授权码、`page`（integer，可选） 当前的页码 最大为 100、`per_page`（integer，可选） 每页的数量，最大为 50、`q`（string，必填） 搜索关键字、`sort`（string，可选） 排序字段，joined_at(注册时间)，默认为最佳匹配、`order`（string，可选） 排序顺序 (默认:desc)；响应：`avatar_url`（string）、`created_at`（string）、`html_url`（string）、`id`（string）、`login`（string）、`name`（string） | [搜索用户](https://docs.gitcode.com/docs/apis/get-api-v-5-search-users) |
| GET | `/search/issues` | 搜索 Issues（q、state、repo 等） | 查询参数：`access_token`（string，必填） 用户授权码、`page`（integer，可选） 当前的页码 最大为 100、`per_page`（integer，可选） 每页的数量，最大为 50、`q`（string，必填） 搜索关键字、`sort`（string，可选） 排序字段，created_at(创建时间)、last_push_at(更新时间)，默认为最佳匹配、`order`（string，可选） 排序顺序 (默认:desc)、`repo`（string，可选） 仓库路径、`state`（string，可选） 筛选指定状态的 issues, open(开启)、closed(完成)；响应：`id`（integer）、`html_url`（string）、`number`（string）、`state`（string）、`title`（string）、`body`（string）、`repository`（object）、`id`（integer）、`full_name`（string）、`human_name`（string）、`path`（string）、`name`（string）、`url`（string）、`owner`（object） 等 | [搜索 Issues](https://docs.gitcode.com/docs/apis/get-api-v-5-search-issues) |
| GET | `/search/repositories` | 搜索仓库（q、sort、order、per_page、page） | 查询参数：`access_token`（string，必填） 用户授权码、`page`（integer，可选） 当前的页码 最大为 100、`per_page`（integer，可选） 每页的数量，最大为 20、`q`（string，必填） 搜索关键字、`sort`（string，可选） 排序字段，last_push_at(更新时间)、stars_count(收藏数)、forks_count(Fork 数)，默认为最佳匹配、`order`（string，可选） 排序顺序 (默认:desc)、`owner`（string，可选） 仓库所属空间地址(组织或个人的地址path)、`fork`（string，可选） 是否搜索含 fork 的仓库，如果显示,受白名单限制，默认：否 等；响应：`id`（integer）、`full_name`（string）、`human_name`（string）、`url`（string）、`namespace`（object）、`id`（integer）、`type`（string）、`name`（string）、`path`（string）、`html_url`（string）、`path`（string）、`name`（string）、`description`（string）、`status`（string） 等 | [搜索仓库](https://docs.gitcode.com/docs/apis/get-api-v-5-search-repositories) |
---

## Pull Requests（合并请求）

| Method | Path | 功能说明 | 可获取信息 | 官方文档 |
|--------|------|----------|------------|----------|
| GET | `/repos/{owner}/{repo}/pulls` | 获取项目Pull Request列表 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码、`state`（string，可选） 可选。Pull Request状态: all、open、closed、locked、merged，默认：all、`base`（string，可选） 可选。Pull Request提交目标分支的名称、`since`（string，可选） 可选。起始的更新时间，要求时间格式为 ISO 8601 例如：`2024-11-20T13:00:21+08:00`、`direction`（string，可选） 可选。升序/降序 默认：desc(asc 或者 desc)、`sort`（string，可选） 可选。排序字段: created、updated 默认：created、`milestone_number`（integer，可选） 可选。里程碑序号(id)、`labels`（string，可选） 以逗号分隔的标签名称列表 等；响应：`number`（integer）、`html_url`（string）、`url`（string）、`close_related_issue`（integer）、`prune_branch`（boolean）、`draft`（boolean）、`labels`（object[]）、`id`（integer）、`color`（string）、`name`（string）、`title`（string）、`repository_id`（integer）、`user`（object）、`id`（string） 等 | [获取项目Pull Request列表](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-pulls) |
| POST | `/repos/{owner}/{repo}/pulls` | 创建Pull Request | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码；响应：`id`（integer）、`url`（string）、`html_url`（string）、`diff_url`（string）、`patch_url`（string）、`issue_url`（string）、`commits_url`（string）、`review_comments_url`（string）、`review_comment_url`（string）、`comments_url`（string）、`number`（integer）、`title`（string）、`description`（string）、`state`（string） 等 | [创建Pull Request](https://docs.gitcode.com/docs/apis/post-api-v-5-repos-owner-repo-pulls) |
| PUT | `/repos/{owner}/{repo}/pulls/{number}/merge` | 合并Pull Request | 路径参数：`owner`（string） 仓库所属空间地址(组织或个人的地址path)、`repo`（string） 仓库路径(path)、`number`（integer） 第几个PR，即本仓库PR的序数；查询参数：`access_token`（string） 用户授权码；响应：`sha`（string）、`merged`（integer）、`message`（string） | [合并Pull Request](https://docs.gitcode.com/docs/apis/put-api-v-5-repos-owner-repo-pulls-number-merge) |
| GET | `/repos/{owner}/{repo}/pulls/{number}/merge` | 判断Pull Request是否合并 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（integer，必填） 第几个PR，即本仓库PR的序数；查询参数：`access_token`（string，必填） 用户授权码；响应：`message`（string） | [判断Pull Request是否合并](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-pulls-number-merge) |
| GET | `/repos/{owner}/{repo}/pulls/{number}/issues` | 获取pr关联的issue | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（integer，必填） 第几个PR，即本仓库PR的序数；查询参数：`access_token`（string，必填） 用户授权码、`page`（integer，可选） 当前的页码:默认为 1、`per_page`（integer，可选） 每页的数量，最大为 100，默认 20；响应：`number`（string）、`title`（string）、`state`（string）、`url`（string）、`body`（string）、`user`（object）、`id`（string）、`login`（string）、`name`（string）、`labels`（object[]）、`color`（string）、`name`（string）、`id`（integer）、`title`（string） 等 | [获取pr关联的issue](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-pulls-number-issues) |
| POST | `/repos/{owner}/{repo}/pulls/{number}/comments` | 提交pull request 评论 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（integer，必填） 第几个PR，即本仓库PR的序数；查询参数：`access_token`（string，必填） 用户授权码；响应：`id`（string）、`body`（string） | [提交pull request 评论](https://docs.gitcode.com/docs/apis/post-api-v-5-repos-owner-repo-pulls-number-comments) |
| GET | `/repos/{owner}/{repo}/pulls/{number}/comments` | 获取某个Pull Request的所有评论 | 路径参数：`owner`（string） 仓库所属空间地址(组织或个人的地址path)、`repo`（string） 仓库路径(path)、`number`（integer） 第几个PR，即本仓库PR的序数；查询参数：`access_token`（string） 用户授权码、`page`（integer） 当前的页码:默认为 1、`per_page`（integer） 每页的数量，最大为 100，默认 20、`direction`（integer） 可选。升序/降序(asc/desc)、`comment_type`（string） 可选。筛选评论类型。代码行评论/pr普通评论:diff_comment/pr_comment；响应：`id`（integer）、`discussion_id`（string）、`body`（string）、`created_at`（string）、`updated_at`（string）、`user`（object）、`id`（string）、`login`（string）、`name`（string）、`avatar_url`（string）、`html_url`（string）、`comment_type`（string）、`resolved`（boolean）、`diff_file`（string） 等 | [获取某个Pull Request的所有评论](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-pulls-number-comments) |
| GET | `/repos/{owner}/{repo}/pulls/{number}/files` | Pull Request Commit文件列表 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（integer，必填） 第几个PR，即本仓库PR的序数；查询参数：`access_token`（string，必填） 用户授权码；响应：`sha`（string）、`filename`（string）、`status`（string）、`additions`（string）、`deletions`（string）、`blob_url`（string）、`raw_url`（string）、`patch`（object）、`diff`（string）、`new_path`（string）、`old_path`（string）、`a_mode`（string）、`b_mode`（string）、`new_file`（integer） 等 | [Pull Request Commit文件列表](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-pulls-number-files) |
| PATCH | `/repos/{owner}/{repo}/pulls/{number}` | 更新Pull Request信息 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（integer，必填） 第几个PR，即本仓库PR的序数；查询参数：`access_token`（string，必填） 用户授权码；响应：`title`（string）、`body`（string）、`state`（string）、`created_at`（string）、`updated_at`（string） | [更新Pull Request信息](https://docs.gitcode.com/docs/apis/patch-api-v-5-repos-owner-repo-pulls-number) |
| GET | `/repos/{owner}/{repo}/pulls/{number}` | 获取单个Pull Request | 路径参数：`owner`（string） 仓库所属空间地址(组织或个人的地址path)、`repo`（string） 仓库路径(path)、`number`（integer） 第几个PR，即本仓库PR的序数；查询参数：`access_token`（string） 用户授权码；响应：`id`（integer）、`html_url`（string）、`number`（integer）、`state`（string）、`title`（string）、`url`（string）、`issue_url`（string）、`body`（string）、`assignees_number`（integer）、`assignees`（object[]）、`id`（string）、`login`（string）、`name`（string）、`avatar_url`（string） 等 | [获取单个Pull Request](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-pulls-number) |
| GET | `/repos/{owner}/{repo}/pulls/{number}/commits` | 获取某Pull Request的所有Commit信息 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（integer，必填） 第几个PR，即本仓库PR的序数；查询参数：`access_token`（string，必填） 用户授权码、`page`（string，可选） 当前页码、`per_page`（string，可选） 每页数量；响应：`sha`（string）、`html_url`（string）、`commit`（object）、`author`（object）、`login`（string）、`name`（string）、`email`（string）、`date`（string）、`committer`（object）、`login`（string）、`name`（string）、`email`（string）、`message`（string）、`author`（object） 等 | [获取某Pull Request的所有Commit信息](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-pulls-number-commits) |
| POST | `/repos/{owner}/{repo}/pulls/{number}/labels` | 创建 Pull Request标签 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（integer，必填） 第几个PR，即本仓库PR的序数；查询参数：`access_token`（string，必填） 用户授权码；响应：`color`（string）、`name`（string）、`id`（integer）、`title`（string）、`type`（null）、`textColor`（string） | [创建 Pull Request标签](https://docs.gitcode.com/docs/apis/post-api-v-5-repos-owner-repo-pulls-number-labels) |
| GET | `/repos/{owner}/{repo}/pulls/{number}/labels` | 获取某个 Pull Request的所有标签 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（integer，必填） 第几个PR，即本仓库PR的序数；查询参数：`access_token`（string，必填） 用户授权码；响应：`id`（integer）、`color`（string）、`name`（string）、`repository_id`（integer）、`url`（string）、`created_at`（string）、`updated_at`（string）、`text_color`（string） | [获取某个 Pull Request的所有标签](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-pulls-number-labels) |
| PUT | `/repos/{owner}/{repo}/pulls/{number}/labels` | 替换 Pull Request所有标签 | 操作结果 | [替换 Pull Request所有标签](https://docs.gitcode.com/docs/apis/put-api-v-5-repos-owner-repo-pulls-number-labels) |
| DELETE | `/repos/{owner}/{repo}/pulls/{number}/labels/{name}` | 删除 Pull Request标签 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（integer，必填） 第几个PR，即本仓库PR的序数、`name`（string，必填） 标签名称(批量删除用英文逗号分隔，如: bug,feature)；查询参数：`access_token`（string，必填） 用户授权码 | [删除 Pull Request标签](https://docs.gitcode.com/docs/apis/delete-api-v-5-repos-owner-repo-pulls-number-labels-name) |
| POST | `/repos/{owner}/{repo}/pulls/{number}/test` | 处理 Pull Request测试 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（integer，必填） 第几个PR，即本仓库PR的序数；查询参数：`access_token`（string，必填） 用户授权码；响应：`force`（boolean） | [处理 Pull Request测试](https://docs.gitcode.com/docs/apis/post-api-v-5-repos-owner-repo-pulls-number-test) |
| POST | `/repos/{owner}/{repo}/pulls/{number}/review` | 处理 Pull Request审查 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（integer，必填） 第几个PR，即本仓库PR的序数；查询参数：`access_token`（string，必填） 用户授权码；响应：`force`（boolean） | [处理 Pull Request审查](https://docs.gitcode.com/docs/apis/post-api-v-5-repos-owner-repo-pulls-number-review) |
| GET | `/repos/{owner}/{repo}/pulls/{number}/operate_logs` | 获取某个Pull Request的操作日志 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（string，必填）；查询参数：`access_token`（string，必填） 用户授权码、`sort`（string，可选） 按递减(desc)排序，默认：递减、`page`（integer，可选） 当前的页码:默认为 1、`per_page`（integer，可选） 每页的数量，最大为 100，默认 20；响应：`content`（string）、`id`（integer）、`action`（string）、`merge_request_id`（integer）、`created_at`（string）、`updated_at`（string）、`discussion_id`（string）、`project`（string）、`assignee`（null）、`proposer`（null）、`user`（object）、`id`（string）、`name`（string）、`login`（string） 等 | [获取某个Pull Request的操作日志](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-pulls-number-operate-logs) |
| PATCH | `/repos/{owner}/{repo}/pulls/{number}/testers` | 重置 Pull Request 测试状态（testers：测试人） | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（integer，必填） 第几个PR，即本仓库PR的序数；查询参数：`access_token`（string，必填） 用户授权码；响应：`reset_all`（boolean） | [重置 Pull Request测试 的状态](https://docs.gitcode.com/docs/apis/patch-api-v-5-repos-owner-repo-pulls-number-testers) |
| POST | `/repos/{owner}/{repo}/pulls/{number}/testers` | 指派用户为 PR 测试人（testers） | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（integer，必填） 第几个PR，即本仓库PR的序数；查询参数：`access_token`（string，必填） 用户授权码；响应：`id`（integer）、`login`（string）、`name`（string）、`avatar_url`（string） | [指派用户测试 Pull Request](https://docs.gitcode.com/docs/apis/post-api-v-5-repos-owner-repo-pulls-number-testers) |
| DELETE | `/repos/{owner}/{repo}/pulls/{number}/testers` | 取消用户 PR 测试人 | 路径参数：`owner`（string，必填） 仓库所属空间地址(企业、组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（string，必填） 第几个PR，即本仓库PR的序数。对应iid；查询参数：`access_token`（string，必填） 用户授权码 | [取消用户测试Pull Request](https://docs.gitcode.com/docs/apis/delete-api-v-5-repos-owner-repo-pulls-number-testers) |
| GET | `/repos/{owner}/{repo}/pulls/option_testers` | 获取可作为 PR 测试人（testers）的候选用户列表 | 路径参数：`owner`（string，必填） 仓库所属空间地址(企业、组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码 | [获取可作为Pull Request测试人列表](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-pulls-number-option-approval-testers) |
| PATCH | `/repos/{owner}/{repo}/pulls/{number}/assignees` | 重置 Pull Request 审查状态（assignees：审查指派人） | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（integer，必填） 第几个PR，即本仓库PR的序数；查询参数：`access_token`（string，必填） 用户授权码；响应：`reset_all`（boolean） | [重置 Pull Request审查 的状态](https://docs.gitcode.com/docs/apis/patch-api-v-5-repos-owner-repo-pulls-number-assignees) |
| POST | `/repos/{owner}/{repo}/pulls/{number}/assignees` | 指派用户审查 PR（assignees） | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（integer，必填） 第几个PR，即本仓库PR的序数；查询参数：`access_token`（string，必填） 用户授权码；响应：`assignees_number`（integer） | [指派用户审查 Pull Request](https://docs.gitcode.com/docs/apis/post-api-v-5-repos-owner-repo-pulls-number-assignees) |
| DELETE | `/repos/{owner}/{repo}/pulls/{number}/assignees` | 取消用户 PR 审查指派人 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（integer，必填） 第几个PR，即本仓库PR的序数；查询参数：`access_token`（string，必填） 用户授权码、`assignees`（string，可选） 用户的个人空间地址, 以 , 分隔；响应：`assignees`（string） | [取消用户审查 Pull Request](https://docs.gitcode.com/docs/apis/delete-api-v-5-repos-owner-repo-pulls-number-assignees) |
| GET | `/repos/{owner}/{repo}/pulls/{number}/files.json` | pr提交的文件变更信息 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（integer，必填） 第几个PR，即本仓库PR的序数；查询参数：`access_token`（string，必填） 用户授权码；响应：`code`（integer）、`added_lines`（integer）、`remove_lines`（integer）、`count`（integer）、`diff_refs`（object）、`base_sha`（string）、`start_sha`（string）、`head_sha`（string）、`diffs`（object[]）、`new_blob_id`（string）、`statistic`（object）、`type`（string）、`path`（string）、`old_path`（string） 等 | [pr提交的文件变更信息](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-pulls-number-files-json) |
| GET | `/repos/{owner}/{repo}/raw/{head}/{sha}/{name}` | 获取文件内容 | 路径参数：`owner`（string，必填）、`repo`（string，必填）、`head_sha`（string，必填）、`name`（string，必填） | [获取文件内容](https://docs.gitcode.com/docs/apis/get-owner-repo-raw-head-sha-name) |
| GET | `/enterprises/{enterprise}/pull_requests` | 企业 Pull Request列表 | 路径参数：`enterprise`（string，必填） 企业的路径(path/login)；查询参数：`access_token`（string，必填） 用户授权码、`state`（string，可选） 可选。Pull Request状态，all，所有，open：开启，closed：关闭，merged：合并、`issue_number`（integer，可选） issue全局id、`sort`（string，可选） 可选。排序字段，创建时间：created，更新时间：updated。默认按创建时间、`direction`（string，可选） 可选。升序：asc，降序：desc、`page`（integer，可选） 当前的页码:默认为 1、`per_page`（integer，可选） 每页的数量，最大为 100，默认 20、`base`（string，可选） 目标分支 等；响应：`id`（integer）、`title`（string）、`url`（string）、`html_url`（string）、`number`（integer）、`state`（string）、`assignees_number`（integer）、`testers_number`（integer）、`assignees`（string[]）、`head`（object）、`ref`（string）、`sha`（string）、`repo`（object）、`path`（string） 等 | [企业 Pull Request列表](https://docs.gitcode.com/docs/apis/get-api-v-5-enterprises-enterprise-pull-requests) |
| GET | `/repos/{owner}/{repo}/pulls/comments/{id}` | 获取Pull Request某条评论 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`id`（string，必填） 评论 ID；查询参数：`access_token`（string，必填） 用户授权码；响应：`id`（integer）、`discussion_id`（string）、`body`（string）、`comment_type`（string）、`user`（object）、`id`（string）、`login`（string）、`name`（string）、`type`（string）、`target`（object）、`issue`（object）、`id`（integer）、`title`（string）、`number`（string） 等 | [获取Pull Request某条评论](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-pulls-comments-id) |
| PATCH | `/repos/{owner}/{repo}/pulls/comments/{id}` | 编辑评论 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`id`（integer，必填） 评论的ID；查询参数：`access_token`（string，必填） 用户授权码 | [编辑评论](https://docs.gitcode.com/docs/apis/patch-api-v-5-repos-owner-repo-pulls-comments-id) |
| DELETE | `/repos/{owner}/{repo}/pulls/comments/{id}` | 删除评论 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`id`（integer，必填） 评论的ID；查询参数：`access_token`（string，必填） 用户授权码 | [删除评论](https://docs.gitcode.com/docs/apis/delete-api-v-5-repos-owner-repo-pulls-comments-id) |
| GET | `/org/{org}/pull_requests` | 组织 Pull Request列表 | 路径参数：`org`（string，必填） org(path/login)；查询参数：`access_token`（string，必填） 用户授权码、`state`（string，可选） 可选。Pull Request状态，all，所有，open：开启，closed：关闭，merged：合并、`sort`（string，可选） 可选。排序字段，创建时间：created，更新时间：updated。默认按创建时间、`direction`（string，可选） 可选。升序：asc，降序：desc、`page`（integer，可选） 当前的页码:默认为 1、`per_page`（string，可选） 每页数量:默认20、`base`（string，可选） 目标分支、`author`（string，可选） pull request作者 等；响应：`id`（integer）、`url`（string）、`html_url`（string）、`number`（integer）、`state`（string）、`assignees_number`（integer）、`testers_number`（integer）、`assignees`（object[]）、`testers`（object[]）、`mergeable`（null）、`can_merge_check`（integer）、`head`（object）、`ref`（string）、`sha`（string） 等 | [组织 Pull Request列表](https://docs.gitcode.com/docs/apis/get-api-v-5-org-org-pull-requests) |
| GET | `/enterprises/{enterprise}/issues/{number}/pull_requests` | 获取企业 issue 关联的 Pull Requests | 路径参数：`enterprise`（string，必填） org(path/login)、`number`（integer，必填） issue 全局 id；查询参数：`access_token`（string，必填） 用户授权码；响应：`number`（integer）、`html_url`（string）、`url`（string）、`close_related_issue`（integer）、`prune_branch`（integer）、`draft`（integer）、`labels`（object[]）、`user`（object）、`id`（string）、`login`（string）、`name`（string）、`state`（string）、`email`（string）、`name_cn`（string） 等 | [获取企业 issue 关联的 Pull Requests](https://docs.gitcode.com/docs/apis/get-api-v-5-enterprises-enterprise-issues-number-pull-requests) |
| POST | `/repos/{owner}/{repo}/pulls/{number}/issues` | Pull Request关联issue | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（string，必填） 第几个PR，即本仓库PR的序数；查询参数：`access_token`（string，必填） 用户授权码 | [Pull Request关联issue](https://docs.gitcode.com/docs/apis/post-api-v-5-repos-owner-repo-pulls-number-linked-issues) |
| DELETE | `/repos/{owner}/{repo}/pulls/{number}/issues` | Pull Request删除关联的issue | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（string，必填） 第几个PR，即本仓库PR的序数；查询参数：`access_token`（string，必填） 用户授权码 | [Pull Request删除关联的issue](https://docs.gitcode.com/docs/apis/delete-api-v-5-repos-owner-repo-pulls-number-issues) |
| POST | `/repos/{owner}/{repo}/pulls/{number}/discussions/{discussion_id}/comments` | 回复Pull Request评论 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（integer，必填） 第几个PR，即本仓库PR的序数、`discussion_id`（string，必填） 讨论id；查询参数：`access_token`（string，可选） 用户授权码；响应：`id`（string）、`noteId`（integer）、`body`（string） | [回复Pull Request评论](https://docs.gitcode.com/docs/apis/post-api-v-5-repos-owner-repo-pulls-number-discussions-discussions-id-comments) |
| PUT | `/repos/{owner}/{repo}/pulls/{number}/comments/{discussion_id}` | 修改检视意见解决状态 | 路径参数：`owner`（string） 仓库所属空间地址(企业、组织或个人的地址path)、`repo`（string） 仓库路径(path)、`number`（string） 第几个PR，即本仓库PR的序数。对应iid、`discussion_id`（string） 讨论的ID（字符串类型 id）；查询参数：`access_token`（string） 用户授权码；响应：`access_token`（string） | [修改检视意见解决状态](https://docs.gitcode.com/docs/apis/put-api-v-5-repos-owner-repo-pulls-number-comments-discussions-id) |
| POST | `/repos/{owner}/{repo}/pulls/{number}/reviewers` | 指派用户为 PR 评审人（approval_reviewers，与 testers/assignees 不同） | 路径参数：`owner`（string，必填） 仓库所属空间地址(企业、组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（string，必填） 第几个PR，即本仓库PR的序数。对应iid；查询参数：`access_token`（string，必填） 用户授权码；响应：`add`（boolean） | [指派用户评审Pull Request](https://docs.gitcode.com/docs/apis/post-api-v-5-repos-owner-repo-pulls-number-approval-reviewers) |
| DELETE | `/repos/{owner}/{repo}/pulls/{number}/reviewers` | 取消用户 PR 评审人（approval_reviewers） | 路径参数：`owner`（string，必填） 仓库所属空间地址(企业、组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（string，必填） 第几个PR，即本仓库PR的序数。对应iid；查询参数：`access_token`（string，必填） 用户授权码 | [取消用户评审Pull Request](https://docs.gitcode.com/docs/apis/delete-api-v-5-repos-owner-repo-pulls-number-approval-reviewers) |
| GET | `/repos/{owner}/{repo}/pulls/{number}/option_reviewers` | 获取可作为 PR 评审人（approval_reviewers）的候选用户列表 | 路径参数：`owner`（string） 仓库所属空间地址(企业、组织或个人的地址path)、`repo`（string） 仓库路径(path)、`number`（string） 第几个PR，即本仓库PR的序数。对应iid；查询参数：`access_token`（string） 用户授权码 | [获取可作为Pull Request评审人列表](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-pulls-number-option-approval-reviewers) |
| GET | `/repos/{owner}/{repo}/pulls/{number}/user_reactions` | 获取Pull Request的表态列表 | 路径参数：`owner`（string，必填） 仓库所属空间地址(企业、组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（string，必填） Pull Request 编号(区分大小写，无需添加 # 号)；查询参数：`access_token`（string，必填） 用户授权码、`page`（string，可选） 当前页码、`per_page`（string，可选） 每页数量、`emoji_name`（string，可选） emoji表情，可选：like，dislike，smile，confused，love，rocket，eyes，party；响应：`page`（string）、`per_page`（string）、`emoji_name`（string） | [获取Pull Request的表态列表](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-pulls-number-user-reactions) |
| GET | `/repos/{owner}/{repo}/pulls/comment/{comment_id}/user_reactions` | 获取Pull Request评论的表态列表 | 路径参数：`owner`（string，必填） 仓库所属空间地址(企业、组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`comment_id`（string，必填） 评论的id；查询参数：`access_token`（string，必填） 用户授权码、`page`（string，可选） 当前页码、`per_page`（string，可选） 每页数量、`emoji_name`（string，可选） emoji表情，可选：like，dislike，smile，confused，love，rocket，eyes，party；响应：`page`（string）、`per_page`（string）、`emoji_name`（string） | [获取Pull Request评论的表态列表](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-pulls-comment-comment-id-user-reactions) |
| GET | `/repos/{owner}/{repo}/pulls/{number}/modify_history` | 获取Pull Request的修改历史 | 路径参数：`owner`（string，必填） 仓库所属空间地址(企业、组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`number`（string，必填） Pull Request 编号(区分大小写，无需添加 # 号)；查询参数：`access_token`（string，必填） 用户授权码 | [获取Pull Request的修改历史](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-pulls-number-modify-history) |
| GET | `/repos/{owner}/{repo}/pulls/comment/{comment_id}/modify_history` | 获取Pull Request评论的修改历史 | 路径参数：`owner`（string，必填） 仓库所属空间地址(企业、组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`comment_id`（string，必填） 评论的id；查询参数：`access_token`（string，必填） 用户授权码 | [获取Pull Request评论的修改历史](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-pulls-comment-comment-id-modify-history) |
---

## Commit（提交）

| Method | Path | 功能说明 | 可获取信息 | 官方文档 |
|--------|------|----------|------------|----------|
| GET | `/repos/{owner}/{repo}/commits` | 获取仓库所有提交 | 路径参数：`owner`（string，必填） 仓库所属空间地址（企业、组织或个人的地址path）、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码、`sha`（string，可选） 提交起始的SHA值、`path`（string，可选） 包含该文件的提交、`author`（string，可选） 提交作者的邮箱或个人空间地址(username/login)、`since`（string，可选） 提交的起始时间，时间格式（2024-11-08T16:25:44Z）、`until`（string，可选） 提交的最后时间，时间格式为（2024-11-08T16:25:44Z）、`page`（string，可选） 当前的页码、`per_page`（string，可选） 每页的数量，最大为 100，默认 20；响应：`url`（string）、`sha`（string）、`html_url`（string）、`comments_url`（string）、`commit`（object）、`author`（object）、`date`（string）、`email`（string）、`committer`（object）、`date`（string）、`email`（string）、`tree`（object）、`sha`（string）、`url`（string） 等 | [获取仓库所有提交](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-commits) |
| GET | `/repos/{owner}/{repo}/commits/{sha}` | 仓库的某个提交 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`sha`（string，必填） 提交的SHA值或者分支名；查询参数：`access_token`（string，必填） 用户授权码、`show_diff`（boolean，可选） 默认为 false; 为 true 时，返回files字段, files字段中包含本地提交中的至多100个变更文件名；响应：`url`（string）、`sha`（string）、`html_url`（string）、`comments_url`（string）、`commit`（object）、`author`（object）、`name`（string）、`date`（string）、`email`（string）、`committer`（object）、`name`（string）、`date`（string）、`email`（string）、`message`（string） 等 | [仓库的某个提交](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-commits-sha) |
| GET | `/repos/{owner}/{repo}/compare/{base}...{head}` | Commits对比 | 路径参数：`owner`（string，必填） 仓库所属空间地址（企业、组织或个人的地址path）、`repo`（string，必填） 仓库路径(path)、`base`（string，必填） 对比的起点。Commit SHA、分支名或标签名、`head`（string，必填） 对比的终点。Commit SHA、分支名或标签名；查询参数：`access_token`（string，必填） 用户授权码、`straight`（boolean，可选） 是否直对比。默认 false、`suffix`（string，可选） 按照文件后缀过滤文件，如 `.txt`。只影响 `files`；响应：`base_commit`（object）、`url`（string）、`sha`（string）、`html_url`（string）、`comments_url`（string）、`commit`（object）、`author`（object）、`name`（string）、`date`（string）、`email`（string）、`committer`（object）、`name`（string）、`date`（string）、`email`（string） 等 | [Commits对比](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-compare-base-head) |
| POST | `/repos/{owner}/{repo}/commits/{sha}/comments` | 创建commit评论 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`sha`（string，必填） commit的id；查询参数：`access_token`（string，必填） 用户授权码；响应：`id`（string）、`body`（string）、`created_at`（string）、`updated_at`（string） | [创建commit评论](https://docs.gitcode.com/docs/apis/post-api-v-5-repos-owner-repo-commits-sha-comments) |
| DELETE | `/repos/{owner}/{repo}/comments/{id}` | 删除commit评论 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`id`（string，必填） 评论id；查询参数：`access_token`（string，必填） 用户授权码 | [删除commit评论](https://docs.gitcode.com/docs/apis/delete-api-v-5-repos-owner-repo-comments-id) |
| GET | `/repos/{owner}/{repo}/comments/{id}` | 获取仓库的某条Commit评论 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`id`（string，必填） 评论id；查询参数：`access_token`（string，必填） 用户授权码；响应：`body`（string）、`created_at`（string）、`id`（integer）、`target`（object）、`updated_at`（string）、`user`（object）、`id`（integer）、`login`（string）、`name`（string）、`type`（string） | [获取仓库的某条Commit评论](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-comments-id) |
| PATCH | `/repos/{owner}/{repo}/comments/{id}` | 更新Commit评论 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`id`（string，必填） 评论id；查询参数：`access_token`（string，必填） 用户授权码；响应：`body`（string）、`created_at`（string）、`id`（integer）、`target`（object）、`updated_at`（string）、`user`（object）、`id`（integer）、`login`（string）、`name`（string）、`type`（string） | [更新Commit评论](https://docs.gitcode.com/docs/apis/patch-api-v-5-repos-owner-repo-comments-id) |
| GET | `/repos/{owner}/{repo}/comments` | 获取仓库的Commit评论 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码、`page`（integer，可选） 当前的页码、`per_page`（integer，可选） 每页的数量，最大为 100，默认 20、`order`（string，可选） 排序顺序: asc(default),desc；响应：`body`（string）、`created_at`（string）、`id`（integer）、`target`（object）、`updated_at`（string）、`user`（object）、`id`（integer）、`login`（string）、`name`（string）、`type`（string） | [获取仓库的Commit评论](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-comments) |
| GET | `/{owner}/{repo}/repository/commit_statistics` | 获取代码量贡献 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码、`branch_name`（string，必填） 分支名、`author`（string，可选） 作者用户名、`only_self`（boolean，可选） 查询个人、`since`（string，可选） 仅返回此日期及以后的提交、`until`（string，可选） 仅返回此日期及之前的提交；响应：`commits`（object[]）、`author_name`（string）、`date`（string）、`statistics`（object[]）、`project_id`（integer）、`branch`（string）、`user_name`（string）、`nick_name`（string）、`add_lines`（integer）、`delete_lines`（integer）、`commit_count`（integer）、`total`（integer） | [获取代码量贡献](https://docs.gitcode.com/docs/apis/get-api-v-5-owner-repo-repository-commit-statistics) |
| GET | `/repos/{owner}/{repo}/commits/{ref}/comments` | 获取单个commit评论 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`ref`（string，必填） commit的sha；查询参数：`access_token`（string，必填） 用户授权码、`page`（integer，可选） 当前的页码、`per_page`（integer，可选） 每页的数量，最大为 100，默认 20；响应：`body`（string）、`created_at`（string）、`id`（integer）、`updated_at`（string）、`user`（object）、`id`（integer）、`login`（string）、`name`（string）、`type`（string） | [获取单个commit评论](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-commits-ref-comments) |
| GET | `/repos/{owner}/{repo}/commit/{sha}/diff` | 获取commit的diff | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`sha`（string，必填） commit的sha；查询参数：`access_token`（string，必填） 用户授权码 | [获取commit的diff](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-commits-sha-diff) |
| GET | `/repos/{owner}/{repo}/commit/{sha}/patch` | 获取commit的patch | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`sha`（string，必填） commit的sha；查询参数：`access_token`（string，必填） 用户授权码 | [获取commit的patch](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-commits-sha-patch) |
---

## Tag（标签）

| Method | Path | 功能说明 | 可获取信息 | 官方文档 |
|--------|------|----------|------------|----------|
| DELETE | `/repos/{owner}/{repo}/tags/{tag_name}` | 删除仓库的一个 tag | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`tag_name`（string，必填） tag名称；查询参数：`access_token`（string，必填） 用户授权码 | [删除 tag](https://docs.gitcode.com/docs/apis/delete-api-v-5-repos-owner-repo-tags-tag-name) |
| GET | `/repos/{owner}/{repo}/protected_tags` | 列出项目保护 tags | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码、`page`（integer，可选） 当前的页码:默认为 1:默认为 1、`per_page`（integer，可选） 每页的数量：最大为 100，默认 20；响应：`name`（string）、`create_access_level`（integer）、`create_access_level_desc`（string） | [列出项目保护 tags](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-protected-tags) |
| POST | `/repos/{owner}/{repo}/protected_tags` | 创建项目保护 tag | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码；响应：`name`（string）、`create_access_level`（integer）、`create_access_level_desc`（string） | [创建项目保护 tag](https://docs.gitcode.com/docs/apis/post-api-v-5-repos-owner-repo-protected-tags) |
| PUT | `/repos/{owner}/{repo}/protected_tags` | 修改项目保护 tag | 操作结果 | [修改项目保护 tag](https://docs.gitcode.com/docs/apis/put-api-v-5-repos-owner-repo-protected-tags) |
| DELETE | `/repos/{owner}/{repo}/protected_tags/{tag_name}` | 删除项目保护 tag | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`tag_name`（string，必填） 标签名称；查询参数：`access_token`（string，必填） 用户授权码 | [删除项目保护 tag](https://docs.gitcode.com/docs/apis/delete-api-v-5-repos-owner-repo-protected-tags-tag-name) |
| GET | `/repos/{owner}/{repo}/protected_tags/{tag_name}` | 获取项目保护 tag 详情 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`tag_name`（string，必填） 标签名称；查询参数：`access_token`（string，必填） 用户授权码；响应：`name`（string）、`create_access_level`（integer）、`create_access_level_desc`（string） | [获取项目保护 tag 详情](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-protected-tags-tag-name) |
---

## Labels（标签）

| Method | Path | 功能说明 | 可获取信息 | 官方文档 |
|--------|------|----------|------------|----------|
| PUT | `/repos/{owner}/{repo}/project_labels` | 替换所有仓库标签 | 操作结果 | [替换所有仓库标签](https://docs.gitcode.com/docs/apis/put-api-v-5-repos-owner-repo-project-labels) |
| DELETE | `/repos/{owner}/{repo}/issues/{number}/labels` | 删除 Issue 所有标签 | 操作结果 | [删除 Issue 所有标签](https://docs.gitcode.com/docs/apis/delete-api-v-5-repos-owner-repo-issues-number-labels) |
| PUT | `/repos/{owner}/{repo}/issues/{number}/labels` | 替换 Issue 所有标签 | 操作结果 | [替换 Issue 所有标签](https://docs.gitcode.com/docs/apis/put-api-v-5-repos-owner-repo-issues-number-labels) |
| PATCH | `/repos/{owner}/{repo}/labels/{original_name}` | 更新一个仓库的任务标签 | 路径参数：`owner`（string，必填） 仓库所属空间地址（企业、组织或个人的地址path）、`repo`（string，必填） 仓库路径(path)、`original_name`（string，必填） 标签原有名称；查询参数：`access_token`（string，必填） 用户授权码、`name`（string，可选） 标签新名称、`color`（string，可选） 标签新颜色；响应：`id`（integer）、`name`（string）、`color`（string） | [更新仓库任务标签](https://docs.gitcode.com/docs/apis/patch-api-v-5-repos-owner-repo-labels-original-name) |
| GET | `/repos/{owner}/{repo}/labels` | 获取仓库所有任务标签 | 路径参数：`owner`（string，必填） 仓库所属空间地址（企业、组织或个人的地址path）、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码、`page`（string，可选） 当前的页码、`per_page`（string，可选） 每页的数量，最大为 100，默认 100；响应：`id`（integer）、`name`（string）、`color`（string）、`repository_id`（integer） | [获取仓库所有任务标签](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-labels) |
| POST | `/repos/{owner}/{repo}/labels` | 创建仓库任务标签 | 路径参数：`owner`（string，必填） 仓库所属空间地址（企业、组织或个人的地址path）、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码；响应：`id`（integer）、`name`（string）、`color`（string） | [创建仓库任务标签](https://docs.gitcode.com/docs/apis/post-api-v-5-repos-owner-repo-labels) |
| DELETE | `/repos/{owner}/{repo}/labels/{name}` | 删除一个仓库任务标签 | 路径参数：`owner`（string，必填） 仓库所属空间地址（企业、组织或个人的地址path）、`repo`（string，必填） 仓库路径(path)、`name`（string，必填） 标签名称；查询参数：`access_token`（string，必填） 用户授权码 | [删除仓库任务标签](https://docs.gitcode.com/docs/apis/delete-api-v-5-repos-owner-repo-labels-name) |
| GET | `/enterprises/{enterprise}/labels` | 获取企业所有的标签 | 路径参数：`enterprise`（string） 仓库所属空间地址（企业、组织或个人的地址path）；查询参数：`access_token`（string） 用户授权码、`page`（string） 当前的页码、`per_page`（string） 每页的数量，最大为 100，默认 100；响应：`id`（integer）、`name`（string）、`color`（string）、`created_at`（string）、`updated_at`（string） | [获取企业所有的标签](https://docs.gitcode.com/docs/apis/get-api-v-5-enterprises-enterprise-labels) |
| GET | `/enterprises/{enterprise}/labels` | 获取标签列表（v8） | 路径参数：`enterprise`（string，必填） 仓库所属空间地址（企业、组织或个人的地址path）；查询参数：`access_token`（string，必填） 用户授权码、`search`（string，可选） 关键词查询、`direction`（string，可选） 排序方向 asc/desc、`page`（string，可选） 当前的页码、`per_page`（string，可选） 每页的数量，最大为 100，默认 20；响应：`id`（integer）、`name`（string）、`color`（string） | [获取标签列表 v8](https://docs.gitcode.com/docs/apis/get-api-v-8-enterprises-enterprise-labels) |
---

## Milestone（里程碑）

| Method | Path | 功能说明 | 可获取信息 | 官方文档 |
|--------|------|----------|------------|----------|
| GET | `/repos/{owner}/{repo}/milestones` | 获取仓库所有里程碑 | 里程碑列表 | [获取仓库所有里程碑](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-milestones) |
| POST | `/repos/{owner}/{repo}/milestones` | 创建仓库里程碑 | 路径参数：`owner`（string，必填） 仓库所属空间地址（企业、组织或个人的地址path）、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，可选） 用户授权码；响应：`closed_issues`（integer）、`created_at`（string）、`description`（string）、`due_on`（string）、`number`（integer）、`open_issues`（integer）、`repository_id`（integer）、`state`（string）、`title`（string）、`updated_at`（string）、`url`（string） | [创建仓库里程碑](https://docs.gitcode.com/docs/apis/post-api-v-5-repos-owner-repo-milestones) |
| GET | `/repos/{owner}/{repo}/milestones/{number}` | 获取仓库单个里程碑 | 路径参数：`owner`（string，必填） 仓库所属空间地址（企业、组织或个人的地址path）、`repo`（string，必填） 仓库路径(path)、`number`（integer，必填） 里程碑序列号（number）；查询参数：`access_token`（string，必填） 用户授权码；响应：`closed_issues`（integer）、`created_at`（string）、`description`（string）、`due_on`（string）、`number`（integer）、`open_issues`（integer）、`repository_id`（integer）、`state`（string）、`title`（string）、`updated_at`（string）、`url`（string） | [获取仓库单个里程碑](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-milestones-number) |
| DELETE | `/repos/{owner}/{repo}/milestones/{number}` | 删除仓库单个里程碑 | 路径参数：`owner`（string，必填） 仓库所属空间地址（企业、组织或个人的地址path）、`repo`（string，必填） 仓库路径(path)、`number`（integer，必填） 里程碑序列号（number）；查询参数：`access_token`（string，可选） 用户授权码；响应：`access_token`（string） | [删除仓库单个里程碑](https://docs.gitcode.com/docs/apis/delete-api-v-5-repos-owner-repo-milestones-number) |
| PATCH | `/repos/{owner}/{repo}/milestones/{number}` | 更新仓库里程碑 | 路径参数：`owner`（string，必填） 仓库所属空间地址（企业、组织或个人的地址path）、`repo`（string，必填） 仓库路径(path)、`number`（integer，必填） 里程碑序列号（number）；查询参数：`access_token`（string，可选） 用户授权码；响应：`closed_issues`（integer）、`created_at`（string）、`description`（string）、`due_on`（string）、`number`（integer）、`open_issues`（integer）、`repository_id`（integer）、`state`（string）、`title`（string）、`updated_at`（string）、`url`（string） | [更新仓库里程碑](https://docs.gitcode.com/docs/apis/patch-api-v-5-repos-owner-repo-milestones-number) |
---

## Users（用户）

| Method | Path | 功能说明 | 可获取信息 | 官方文档 |
|--------|------|----------|------------|----------|
| GET | `/users/{username}/starred` | 列出用户 star 了的仓库 | 路径参数：`username`（string，必填）；查询参数：`access_token`（string，可选） 用户授权码、`sort`（string，可选） created/last_push 根据仓库创建时间(created)或最后推送时间(updated)进行排序，默认：创建时间、`direction`（string，可选） asc/desc 排序方向，默认：降序、`page`（integer，可选） 当前的页码、`per_page`（integer，可选） 每页的数量，最大为 100，默认 20；响应：`id`（仓库）、`full_name`（仓库全路径）、`human_name`（仓库全名称）、`url`（仓库详情访问地址）、`namespace`（object）、`id`（integer）、`type`（string）、`name`（string）、`path`（string）、`html_url`（string）、`path`（仓库路径）、`name`（仓库名称）、`parentfull_name`（父仓库名称）、`description`（仓库描述） 等 | [列出用户 star 了的仓库](https://docs.gitcode.com/docs/apis/get-api-v-5-user-username-starred) |
| GET | `/users/{username}/subscriptions` | 列出用户 watch 了的仓库 | 路径参数：`username`（string，必填）；查询参数：`access_token`（string，可选） 用户授权码、`sort`（string，可选） created/last_push 根据仓库创建时间(created)或最后推送时间(updated)进行排序，默认：创建时间、`direction`（string，可选） asc/desc 排序方向，默认：降序、`page`（integer，可选） 当前的页码、`per_page`（integer，可选） 每页的数量，最大为 100，默认 20；响应：`id`（仓库）、`full_name`（仓库全路径）、`human_name`（仓库全名称）、`url`（仓库详情访问地址）、`namespace`（object）、`id`（integer）、`type`（string）、`name`（string）、`path`（string）、`html_url`（string）、`path`（仓库路径）、`name`（仓库名称）、`parentfull_name`（父仓库名称）、`description`（仓库描述） 等 | [列出用户 watch 了的仓库](https://docs.gitcode.com/docs/apis/get-api-v-5-user-username-subscriptions) |
| GET | `/user/subscriptions` | 列出授权用户 watch 了的仓库 | 查询参数：`access_token`（string，必填） 用户授权码、`sort`（string，可选） created/last_push 根据仓库创建时间(created)或最后推送时间(updated)进行排序，默认：创建时间、`direction`（string，可选） asc/desc 排序方向，默认：降序、`page`（integer，可选） 当前的页码、`per_page`（integer，可选） 每页的数量，最大为 100，默认 20；响应：`id`（仓库）、`full_name`（仓库全路径）、`human_name`（仓库全名称）、`url`（仓库详情访问地址）、`namespace`（object）、`id`（integer）、`type`（string）、`name`（string）、`path`（string）、`html_url`（string）、`path`（仓库路径）、`name`（仓库名称）、`parentfull_name`（父仓库名称）、`description`（仓库描述） 等 | [列出授权用户 watch 了的仓库](https://docs.gitcode.com/docs/apis/get-api-v-5-user-subscriptions) |
| GET | `/user/namespaces` | 列出授权用户所有的 Namespace | 查询参数：`access_token`（string，必填） 用户授权码、`mode`（string，可选） 参与方式: project(所有参与仓库的namepsce)、intrant(所加入的namespace)、all(包含前两者)，默认(intrant)、`page`（integer，可选） 当前页码、`perPage`（integer，可选） 每页的项目数；响应：`mode`（string）、`page`（integer）、`perPage`（integer） | [列出授权用户所有的 Namespace](https://docs.gitcode.com/docs/apis/get-api-v-5-user-namespaces) |
| GET | `/repos/{owner}/{repo}/notifications` | 列出一个仓库里的通知 | 路径参数：`owner`（string，必填）、`repo`（string，必填）；查询参数：`access_token`（string，必填） 用户授权码、`unread`（boolean，可选） 是否未读，默认true、`type`（string，可选） 筛选指定类型的通知，all：所有，event：事件通知，referer：@ 通知、`since`（string，可选） 只获取在给定时间前更新后的消息，要求时间格式为 ISO 860、`before`（string，可选） 只获取在给定时间前更新的消息，要求时间格式为 ISO 860、`ids`（string，可选） 指定一组通知 ID，以 , 分隔；响应：`list`（object[]）、`id`（string）、`content`（通知内容）、`type`（通知类型）、`unread`（是否未读）、`update_at`（更新时间）、`html_url`（触发消息的资源访问地址）、`actor`（object）、`id`（integer）、`login`（string）、`name`（string）、`repository`（object）、`id`（integer）、`full_name`（string） 等 | [列出一个仓库里的通知](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-notifications) |
| PUT | `/repos/{owner}/{repo}/notifications` | 标记一个仓库里的通知为已读 | 操作结果 | [标记通知为已读](https://docs.gitcode.com/docs/apis/put-api-v-5-repos-owner-repo-notifications) |
| POST | `/user/repos` | 创建个人项目仓库 | 查询参数：`access_token`（string，必填） 用户授权码；响应：`id`（integer）、`full_name`（string）、`human_name`（string）、`url`（string）、`namespace`（object）、`id`（integer）、`name`（string）、`path`（string）、`develop_mode`（string）、`kind`（string）、`full_path`（string）、`full_name`（string）、`visibility_level`（integer）、`enable_file_control`（integer） 等 | [创建个人项目仓库](https://docs.gitcode.com/docs/apis/post-api-v-5-user-repos) |
| GET | `/user/repos` | 列出授权用户所有仓库 | 查询参数：`access_token`（string，必填） 用户授权码、`visibility`（string，可选） 公开(public)、私有(private)或者所有(all)，默认: 所有(all)、`affiliation`（string，可选） owner(授权用户拥有的仓库)、collaborator(授权用户为仓库成员)、organization_member(授权用户为仓库所在组织并有访问仓库权限)、enterprise_member(授权用户所在企业并有访问仓库权限)、admin(所有有权限的，包括所管理的组织中所有仓库、所管理的企业的所有仓库)。可以用逗号分隔符组合。如: owner, organization_member 或 owner, collaborator, organization_member、`type`（string，可选） 筛选用户仓库: 其创建(owner)、个人(personal)、其为成员(member)、公开(public)、私有(private)，不能与 affiliation 参数一并使用，否则会报 422 错误，与visibility参数一起使用，visibility参数拥有更高的优先级、`sort`（string，可选） 排序方式: 创建时间(created)，更新时间(updated)，最后推送时间(pushed)，仓库所属与名称(full_name)。默认: full_name、`direction`（string，可选） 如果sort参数为full_name，用升序(asc)。否则降序(desc)、`q`（string，可选） 搜索关键字、`page`（integer，可选） 当前的页码 等；响应：`id`（integer）、`full_name`（string）、`human_name`（string）、`url`（string）、`namespace`（object）、`id`（integer）、`type`（string）、`name`（string）、`path`（string）、`html_url`（string）、`path`（string）、`name`（string）、`description`（string）、`status`（string） 等 | [列出授权用户所有仓库](https://docs.gitcode.com/docs/apis/get-api-v-5-user-repos) |
| GET | `/repos/{owner}/{repo}` | 获取用户的某个仓库（即仓库详情） | `stargazers_count`、`forks_count`、`watchers_count`、`full_name`、`description`、`default_branch`、`open_issues_count` 等 | [获取用户的某个仓库](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo) |
| GET | `/users/{username}` | 获取一个用户 | 路径参数：`username`（string，必填） 用户名(username)；查询参数：`access_token`（string，可选） 用户授权码；响应：`avatar_url`（string）、`followers_url`（string）、`html_url`（string）、`id`（string）、`login`（string）、`name`（string）、`type`（string）、`url`（string）、`bio`（string）、`blog`（string）、`company`（string）、`email`（string）、`followers`（integer）、`following`（integer） 等 | [获取一个用户](https://docs.gitcode.com/docs/apis/get-api-v-5-users-username) |
| PATCH | `/user` | 更新授权用户的资料 | 查询参数：`access_token`（string，必填） 用户授权码；响应：`avatar`（string）、`nickname`（string）、`company`（string）、`description`（string）、`email`（string）、`github_account`（string）、`website`（string）、`location`（string）、`id`（string）、`login`（string） | [更新授权用户的资料](https://docs.gitcode.com/docs/apis/patch-api-v-5-user) |
| GET | `/user` | 获取授权用户的资料 | 查询参数：`access_token`（string，必填） 用户授权码；响应：`avatar_url`（string）、`followers_url`（string）、`html_url`（string）、`id`（string）、`login`（string）、`name`（string）、`type`（string）、`url`（string）、`bio`（string）、`blog`（string）、`company`（string）、`email`（string）、`followers`（integer）、`following`（integer） 等 | [获取授权用户的资料](https://docs.gitcode.com/docs/apis/get-api-v-5-user) |
| GET | `/emails` | 获取授权用户的全部邮箱 | 查询参数：`access_token`（string，必填） 用户授权码；响应：`email`（string）、`state`（string） | [获取授权用户的全部邮箱](https://docs.gitcode.com/docs/apis/get-api-v-5-emails) |
| GET | `/users/{username}/events` | 获取用户个人动态 | 路径参数：`username`（string，必填）；查询参数：`access_token`（string，必填） 用户授权码、`year`（string，可选） 开始年（2024）、`next`（string，可选） 结束日期；响应：`events`（object）、`action`（integer）、`action_name`（string）、`author`（object）、`id`（integer）、`iam_id`（string）、`username`（string）、`state`（string）、`avatar_url`（string）、`email`（string）、`name`（string）、`name_cn`（string）、`web_url`（string）、`author_id`（integer） 等 | [获取用户个人动态](https://docs.gitcode.com/docs/apis/get-api-v-5-users-username-events) |
| GET | `/users/{username}/repos` | 获取某个用户的公开仓库 | 路径参数：`username`（string，必填） 用户名(username/login)；查询参数：`access_token`（string，必填） 用户授权码、`type`（string，可选） 用户创建的仓库(owner)，用户个人仓库(personal)，用户为仓库成员(member)，所有(all)。默认: 所有(all)、`sort`（string，可选） 排序方式: 创建时间(created)，更新时间(updated)，最后推送时间(pushed)，仓库所属与名称(full_name)。默认: full_name、`direction`（string，可选） 如果sort参数为full_name，用升序(asc)。否则降序(desc)、`page`（integer，可选） 当前的页码、`per_page`（integer，可选） 每页的数量，最大为 100，默认 20；响应：`id`（integer）、`full_name`（string）、`human_name`（string）、`url`（string）、`namespace`（object）、`id`（integer）、`type`（string）、`name`（string）、`path`（string）、`html_url`（string）、`path`（string）、`name`（string）、`description`（string）、`status`（string） 等 | [获取某个用户的公开仓库](https://docs.gitcode.com/docs/apis/get-api-v-5-users-username-repos) |
| POST | `/user/keys` | 添加一个公钥 | 查询参数：`access_token`（string，必填） 用户授权码；响应：`id`（integer）、`title`（string）、`key`（string）、`created_at`（string）、`url`（string） | [添加一个公钥](https://docs.gitcode.com/docs/apis/post-api-v-5-user-keys) |
| GET | `/user/keys` | 列出授权用户的所有公钥 | 查询参数：`access_token`（string，必填） 用户授权码、`page`（integer，可选） 当前的页码、`per_page`（integer，可选） 每页的数量，最大为 100，默认 20；响应：`id`（integer）、`title`（string）、`key`（string）、`created_at`（string）、`url`（string） | [列出授权用户的所有公钥](https://docs.gitcode.com/docs/apis/get-api-v-5-user-keys) |
| DELETE | `/user/keys/{id}` | 删除一个公钥 | 路径参数：`id`（string，必填） 公钥 ID；查询参数：`access_token`（string，必填） 用户授权码 | [删除一个公钥](https://docs.gitcode.com/docs/apis/delete-api-v-5-user-keys-id) |
| GET | `/user/keys/{id}` | 获取一个公钥 | 路径参数：`id`（string，必填） 公钥 ID；查询参数：`access_token`（string，必填） 用户授权码；响应：`id`（integer）、`title`（string）、`key`（string）、`created_at`（string）、`url`（string） | [获取一个公钥](https://docs.gitcode.com/docs/apis/get-api-v-5-user-keys-id) |
| GET | `/user/namespace` | 获取授权用户的一个 Namespace | 查询参数：`access_token`（string，必填） 用户授权码、`path`（string，必填） Namespace path；响应：`id`（integer）、`path`（string）、`name`（string）、`html_url`（string）、`type`（string） | [获取授权用户的一个 Namespace](https://docs.gitcode.com/docs/apis/get-api-v-5-user-namespace) |
| GET | `/user/starred` | 列出授权用户 star 了的仓库 | 查询参数：`access_token`（string，必填） 用户授权码、`sort`（string，可选） created/last_push 根据仓库创建时间(created)或最后推送时间(updated)进行排序，默认：创建时间、`direction`（string，可选） asc/desc 排序方向，默认：降序、`page`（integer，可选） 当前的页码、`per_page`（integer，可选） 每页的数量，最大为 100，默认 20；响应：`id`（integer）、`full_name`（string）、`human_name`（string）、`url`（string）、`namespace`（object）、`id`（integer）、`type`（string）、`name`（string）、`path`（string）、`html_url`（string）、`path`（string）、`name`（string）、`parentfull_name`（string）、`description`（string） 等 | [列出授权用户 star 了的仓库](https://docs.gitcode.com/docs/apis/get-api-v-5-user-starred) |
| GET | `/user/pulls` | 列出授权用户的 Pull Request 列表 | 查询参数：`access_token`（string，必填） 用户授权码、`state`（string，可选） 返回已打开、已关闭、已锁定、已合并或所有合并请求， open：已打开；closed：已关闭；locked：已锁定；merged：已合并；all：所有。默认返回所有的、`sort`（string，可选） 返回按字段排序的合并请求，创建时间：created；更新时间：updated；合并时间：merged_at。默认按照创建时间排序、`direction`（string，可选） 返回按照排序字段升序或者降序的合并请求，desc：降序；asc：升序、`labels`（string，可选） 逗号分隔的标签名称、`created_after`（string，可选） 返回在指定时间之后创建的合并请求，时间格式为 ISO 8601 例如：2024-11-20T13:00:21+08:00、`created_before`（string，可选） 返回在指定时间之前创建的合并请求，时间格式为 ISO 8601 例如：2024-11-20T13:00:21+08:00、`updated_after`（string，可选） 返回在指定时间之后更新的合并请求，时间格式为 ISO 8601 例如：2024-11-20T13:00:21+08:00 等；响应：`state`（string）、`sort`（string）、`direction`（string）、`labels`（string）、`created_after`（string）、`created_before`（string）、`updated_after`（string）、`updated_before`（string）、`scope`（string）、`source_branch`（string）、`target_branch`（string）、`per_page`（string）、`page`（string）、`visibility_reason`（string） 等 | [列出授权用户 PR 列表](https://docs.gitcode.com/docs/apis/get-api-v-5-users-merge-requests) |
---

## Organizations（组织）

| Method | Path | 功能说明 | 可获取信息 | 官方文档 |
|--------|------|----------|------------|----------|
| POST | `/orgs/{org}/repos` | 创建组织仓库 | 路径参数：`org`（string，必填） 组织的路径(path/login)；查询参数：`access_token`（string，必填） 用户授权码；响应：`id`（integer）、`full_name`（string）、`human_name`（string）、`url`（string）、`path`（string）、`name`（string）、`description`（string）、`private`（integer）、`public`（integer）、`namespace`（object）、`id`（integer）、`name`（string）、`path`（string）、`develop_mode`（string） 等 | [创建组织仓库](https://docs.gitcode.com/docs/apis/post-api-v-5-orgs-org-repos) |
| GET | `/orgs/{org}/repos` | 获取组织项目列表 | 路径参数：`org`（string，必填） 组织的路径(path/login)；查询参数：`access_token`（string，必填） 用户授权码、`type`（string，可选） 筛选公开/私有仓库的类型，可以是 all, public, private。默认: all、`page`（integer，可选） 当前的页码:默认为 1、`per_page`（integer，可选） 每页的数量，最大为 100，默认 20、`repo_type`（string，可选） 筛选仓库类型，可以是 code：代码仓，model：模型仓，dataset：数据集仓，space ：space，all：所有仓库类型。默认: code；响应：`id`（integer）、`full_name`（string）、`namespace`（object）、`id`（integer）、`type`（string）、`name`（string）、`path`（string）、`html_url`（string）、`path`（string）、`name`（string）、`description`（string）、`private`（integer）、`public`（integer）、`internal`（integer） 等 | [获取组织项目列表](https://docs.gitcode.com/docs/apis/get-api-v-5-orgs-org-repos) |
| GET | `/users/{username}/orgs` | 列出用户所属的组织 | 路径参数：`username`（string，必填） 用户名(username/login)；查询参数：`access_token`（string，必填） 用户授权码、`page`（string，可选） 当前的页码:默认为 1、`per_page`（string，可选） 每页的数量，默认为20，最大为100；响应：`id`（integer）、`login`（string）、`name`（string）、`avatar_url`（null）、`repos_url`（null）、`events_url`（null）、`members_url`（null）、`description`（string）、`follow_count`（integer） | [列出用户所属的组织](https://docs.gitcode.com/docs/apis/get-api-v-5-users-username-orgs) |
| GET | `/users/orgs` | 列出授权用户所属的组织 | 查询参数：`access_token`（string，必填） 用户授权码、`page`（string，可选） 当前的页码:默认为 1、`per_page`（string，可选） 每页的数量，默认为20，最大为100、`admin`（boolean，可选） 筛选有管理员权限；响应：`id`（integer）、`login`（string）、`path`（string）、`name`（string）、`avatar_url`（null）、`repos_url`（null）、`events_url`（null）、`members_url`（null）、`description`（string）、`follow_count`（integer） | [列出授权用户所属的组织](https://docs.gitcode.com/docs/apis/get-api-v-5-users-orgs) |
| GET | `/orgs/{org}/members/{username}` | 获取组织成员详情 | 路径参数：`org`（string，必填） 组织的路径(path/login)、`username`（string，必填） 用户名(username/login)；查询参数：`access_token`（string，必填） 用户授权码；响应：`id`（integer）、`path`（string）、`name`（string）、`url`（string）、`avatar_url`（null）、`user`（object）、`id`（string）、`login`（string）、`name`（string）、`avatar_url`（null）、`html_url`（string）、`user_id`（string）、`object_id`（string） | [获取组织成员详情](https://docs.gitcode.com/docs/apis/get-api-v-5-orgs-org-members-username) |
| GET | `/orgs/{org}` | 获取一个组织信息 | 路径参数：`org`（string，必填） 组织的路径(path/login)；查询参数：`access_token`（string，必填） 用户授权码；响应：`id`（integer）、`login`（string）、`name`（string）、`avatar_url`（string）、`repos_url`（string）、`events_url`（string）、`members_url`（string）、`description`（string）、`enterprise`（string）、`follow_count`（integer）、`gitee`（object）、`follows`（integer） | [获取一个组织信息](https://docs.gitcode.com/docs/apis/get-api-v-5-orgs-org) |
| PATCH | `/orgs/{org}` | 更新授权用户所管理的组织资料 | 路径参数：`org`（string，必填） 组织的路径(path/login)；查询参数：`access_token`（string，必填） 用户授权码；响应：`email`（string）、`name`（string）、`description`（string）、`html_url`（string）、`id`（integer）、`path`（string） | [更新组织资料](https://docs.gitcode.com/docs/apis/patch-api-v-5-orgs-org) |
| GET | `/enterprises/{enterprise}/members/{username}` | 获取企业的一个成员 | 路径参数：`enterprise`（string，必填） 企业的路径(path/login)、`username`（string，必填） 用户名(username/login)；查询参数：`access_token`（string，必填） 用户授权码；响应：`user`（object）、`avatar_url`（string）、`html_url`（string）、`id`（string）、`login`（string）、`name`（string）、`user_id`（string）、`object_id`（string）、`url`（string）、`active`（integer）、`role`（string）、`enterprise`（object）、`id`（integer）、`url`（string） | [获取企业的一个成员](https://docs.gitcode.com/docs/apis/get-api-v-5-enterprises-enterprise-members-username) |
| PUT | `/enterprises/{enterprise}/members/{username}` | 修改企业成员权限 | 路径参数：`enterprise`（string，必填） 仓库所属空间地址(企业、组织或个人的地址path)、`username`（string，必填） 用户名(username/login)；查询参数：`access_token`（string，必填） 用户授权码；响应：`active`（integer）、`role`（string）、`url`（string）、`user`（object）、`id`（integer）、`login`（string）、`url`（string）、`html_url`（string） | [修改企业成员权限](https://docs.gitcode.com/docs/apis/put-api-v-5-enterprises-enterprise-members-username) |
| GET | `/user/memberships/orgs/{org}` | 获取授权用户在一个组织的成员资料 | 路径参数：`org`（string，必填） 企业的路径(path/login)；查询参数：`access_token`（string，必填） 用户授权码；响应：`id`（integer）、`path`（string）、`name`（string）、`url`（string）、`avatar_url`（string）、`user`（object）、`id`（string）、`login`（string）、`name`（string）、`avatar_url`（string）、`html_url`（string）、`active`（integer）、`role`（string）、`organization`（object） 等 | [获取授权用户组织成员资料](https://docs.gitcode.com/docs/apis/get-api-v-5-user-memberships-orgs-org) |
| DELETE | `/user/memberships/orgs/{org}` | 退出一个组织 | 路径参数：`org`（string，必填） 组织的路径(path/login)；查询参数：`access_token`（string，必填） 用户授权码 | [退出一个组织](https://docs.gitcode.com/docs/apis/delete-api-v-5-user-memberships-orgs-org) |
| GET | `/orgs/{org}/members` | 列出一个组织的所有成员 | 路径参数：`org`（string，必填） 企业的路径(path/login)；查询参数：`access_token`（string，必填） 用户授权码、`page`（integer，可选） 当前的页码:默认为 1、`per_page`（integer，可选） 每页的数量，最大为 100，默认 20、`role`（string，可选） 根据角色筛选成员(all/admin/member)；响应：`avatar_url`（string）、`followers_url`（string）、`html_url`（string）、`id`（string）、`login`（string）、`member_role`（string）、`name`（string）、`type`（string）、`url`（string）、`user_id`（string）、`object_id`（string） | [列出一个组织的所有成员](https://docs.gitcode.com/docs/apis/get-api-v-5-orgs-org-members) |
| GET | `/enterprises/{enterprise}/members` | 列出企业的所有成员 | 路径参数：`org`（string，必填） 企业的路径(path/login)、`enterprise`（string，必填）；查询参数：`access_token`（string，必填） 用户授权码、`page`（integer，可选） 当前的页码:默认为 1、`per_page`（integer，可选） 每页的数量，最大为 100，默认 20、`role`（string，可选） 根据角色筛选成员(all/admin/member)；响应：`user`（object）、`avatar_url`（string）、`html_url`（string）、`id`（string）、`login`（string）、`name`（string）、`url`（string）、`object_id`（string）、`user_id`（string）、`url`（string）、`active`（boolean）、`role`（string）、`role_name`（string）、`role_id`（string） 等 | [列出企业的所有成员](https://docs.gitcode.com/docs/apis/get-api-v-5-enterprises-enterprise-members) |
| DELETE | `/orgs/{org}/memberships/{username}` | 移除授权用户所管理组织中的成员 | 路径参数：`org`（string，必填） 组织的路径(path/login)、`username`（string，必填） 用户名(username/login)；查询参数：`access_token`（string，必填） 用户授权码 | [移除组织成员](https://docs.gitcode.com/docs/apis/delete-api-v-5-orgs-org-memberships-username) |
| POST | `/orgs/{org}/memberships/{username}` | 邀请组织成员 | 路径参数：`org`（string，必填） 仓库所属空间地址(企业、组织或个人的地址path)、`username`（string，必填） 用户名(username/login)；查询参数：`access_token`（string，必填） 用户授权码；响应：`followers_url`（string）、`html_url`（string）、`id`（string）、`login`（string）、`name`（string）、`type`（string）、`url`（string）、`permissions`（object）、`admin`（integer）、`customized`（integer）、`push`（integer）、`pull`（integer） | [邀请组织成员](https://docs.gitcode.com/docs/apis/post-api-v-5-orgs-org-memberships-username) |
| GET | `/orgs/{owner}/followers` | 列出指定组织的所有关注者 | 路径参数：`owner`（string，必填） 仓库所属空间地址(企业、组织或个人的地址path)；查询参数：`access_token`（string，必填） 用户授权码、`page`（integer，可选） 当前的页码:默认为 1、`per_page`（integer，可选） 每页的数量，最大为 100，默认 20；响应：`id`（integer）、`login`（string）、`name`（string）、`avatar_url`（string）、`watch_at`（string） | [列出指定组织的所有关注者](https://docs.gitcode.com/docs/apis/get-api-v-5-orgs-owner-followers) |
| GET | `/orgs/{org}/issue/extend/settings` | 获取 issue 扩展配置 | 路径参数：`org`（string，必填） 仓库所属空间地址(企业、组织 path)；查询参数：`access_token`（string，必填） 用户授权码；响应：`type_name`（string）、`type_id`（integer）、`type_desc`（string）、`status`（object[]）、`status_name`（string）、`status_id`（integer）、`status_desc`（string）、`gitcode_issue_status`（integer） | [获取 issue 扩展配置](https://docs.gitcode.com/docs/apis/get-api-v-5-orgs-org-issue-extend-settings) |
| GET | `/orgs/{org}/customized_roles` | 获取组织自定义角色 | 路径参数：`org`（string，必填） 组织的路径(path/login)；查询参数：`access_token`（string，必填） 用户授权码 | [获取组织自定义角色](https://docs.gitcode.com/docs/apis/get-api-v-5-org-org-customized-roles) |
---

## Webhooks

| Method | Path | 功能说明 | 可获取信息 | 官方文档 |
|--------|------|----------|------------|----------|
| GET | `/repos/{owner}/{repo}/hooks` | 获取仓库 Webhook 列表 | 路径参数：`owner`（string，必填） 仓库所属空间地址（企业、组织或个人的地址path）、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码、`page`（integer，可选） 当前的页码、`per_page`（integer，可选） 每页的数量，最大为 100，默认 20；响应：`id`（integer）、`url`（string）、`password`（string）、`result`（string）、`project_id`（integer）、`result_code`（integer）、`push_events`（integer）、`tag_push_events`（integer）、`issues_events`（integer）、`note_events`（integer）、`merge_requests_events`（integer）、`created_at`（string） | [列表](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-hooks) |
| POST | `/repos/{owner}/{repo}/hooks` | 创建 Webhook | 路径参数：`owner`（string，必填） 仓库所属空间地址（企业、组织或个人的地址path）、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码；响应：`id`（integer）、`url`（string）、`password`（string）、`result`（null）、`project_id`（integer）、`result_code`（integer）、`push_events`（integer）、`tag_push_events`（integer）、`issues_events`（integer）、`note_events`（integer）、`merge_requests_events`（integer）、`created_at`（string） | [创建](https://docs.gitcode.com/docs/apis/post-api-v-5-repos-owner-repo-hooks) |
| PUT | `/repos/{owner}/{repo}/hooks/{id}` | 更新 Webhook | 更新后的 Webhook 对象 | [更新](https://docs.gitcode.com/docs/apis/)（子页 404，请从总览侧栏查找） |
| DELETE | `/repos/{owner}/{repo}/hooks/{id}` | 删除 Webhook | 路径参数：`owner`（string，必填） 仓库所属空间地址（企业、组织或个人的地址path）、`repo`（string，必填） 仓库路径(path)、`id`（string，必填） Webhook的ID；查询参数：`access_token`（string，必填） 用户授权码 | [删除](https://docs.gitcode.com/docs/apis/delete-api-v-5-repos-owner-repo-hooks-id) |
---

## Member（成员）

| Method | Path | 功能说明 | 可获取信息 | 官方文档 |
|--------|------|----------|------------|----------|
| PUT | `/repos/{owner}/{repo}/collaborators/{username}` | 添加项目成员或更新项目成员权限 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`username`（string，必填） 用户名(username/login)；查询参数：`access_token`（string，必填） 用户授权码；响应：`id`（integer）、`login`（string）、`name`（string）、`avatar_url`（null）、`html_url`（string）、`remark`（string）、`type`（string）、`permissions`（object）、`pull`（integer）、`push`（integer）、`admin`（integer） | [添加项目成员或更新项目成员权限](https://docs.gitcode.com/docs/apis/put-api-v-5-repos-owner-repo-collaborators-username) |
| DELETE | `/repos/{owner}/{repo}/collaborators/{username}` | 移除项目成员 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`username`（string，必填） 用户名(username/login)；查询参数：`access_token`（string，必填） 用户授权码 | [移除项目成员](https://docs.gitcode.com/docs/apis/delete-api-v-5-repos-owner-repo-collaborators-username) |
| GET | `/repos/{owner}/{repo}/collaborators/{username}` | 判断用户是否为仓库成员 | 路径参数：`owner`（string，必填） 仓库所属空间地址（企业、组织或个人的地址path）、`repo`（string，必填） 仓库路径(path)、`username`（string，必填） 用户名(username/login)；查询参数：`access_token`（string，必填） 用户授权码；响应：`message`（string） | [判断用户是否为仓库成员](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-collaborators-username) |
| GET | `/repos/{owner}/{repo}/collaborators` | 获取仓库的所有成员 | 路径参数：`owner`（string，必填） 仓库所属空间地址(组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码、`page`（integer，可选） 当前的页码:默认为 1、`per_page`（integer，可选） 每页的数量，最大为 100，默认 20；响应：`id`（string）、`name`（string）、`username`（string）、`nick_name`（null）、`state`（null）、`avatar`（null）、`avatar_url`（null）、`email`（null）、`name_cn`（null）、`web_url`（string）、`access_level`（null）、`expires_at`（null）、`limited`（null）、`type`（string） 等 | [获取仓库的所有成员](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-collaborators) |
| GET | `/repos/{owner}/{repo}/collaborators/{username}/permission` | 查看仓库成员的权限 | 路径参数：`owner`（string，必填） 仓库所属空间地址（企业、组织或个人的地址path）、`repo`（string，必填） 仓库路径(path)、`username`（string，必填） 用户名(username/login)；查询参数：`access_token`（string，必填） 用户授权码；响应：`id`（string）、`name`（string）、`username`（string）、`nick_name`（string）、`state`（string）、`email`（string）、`web_url`（string）、`access_level`（integer）、`type`（string）、`join_way`（string）、`source_name`（string）、`role_name`（string）、`role_name_cn`（string）、`permissions`（object） 等 | [查看仓库成员的权限](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-collaborators-username-permission) |
| GET | `/repos/{owner}/{repo}/collaborators/self-permission` | 查看当前成员仓库的权限点 | 路径参数：`owner`（string，必填） 仓库所属空间地址(企业、组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，可选） 用户授权码；响应：`role_info`（object）、`role_uuid`（string）、`name`（string）、`cn_name`（string）、`roles_type`（integer）、`access_level`（integer）、`resource_trees`（object[]）、`resource_id`（integer）、`name`（string）、`cn_name`（string）、`scope`（string）、`actions`（object[]）、`permission_id`（integer）、`action`（string） 等 | [查看当前成员仓库的权限点](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-collaborators-self-permission) |
---

## Release（发布）

| Method | Path | 功能说明 | 可获取信息 | 官方文档 |
|--------|------|----------|------------|----------|
| POST | `/repos/{owner}/{repo}/releases` | 创建仓库 Release | 路径参数：`owner`（string，必填） 仓库所属空间地址（企业、组织或个人的地址path）、`repo`（string，必填） 仓库路径；查询参数：`access_token`（string，必填） 用户授权码；响应：`tag_name`（string）、`target_commitish`（string）、`prerelease`（boolean）、`name`（string）、`body`（string）、`author`（object）、`id`（string）、`login`（string）、`name`（string）、`avatar_url`（string）、`html_url`（string）、`type`（string）、`url`（string）、`created_at`（string） 等 | [创建仓库Release](https://docs.gitcode.com/docs/apis/post-api-v-5-repos-owner-repo-releases) |
| PATCH | `/repos/{owner}/{repo}/releases/{tag}` | 更新仓库 Release | 路径参数：`owner`（string，必填） 仓库所属空间地址（企业、组织或个人的地址path）、`repo`（string，必填） 仓库路径(path)、`tag`（string，必填） Tag 名称；查询参数：`access_token`（string，可选） 用户授权码；响应：`access_token`（string） | [更新仓库Release](https://docs.gitcode.com/docs/apis/patch-api-v-5-repos-owner-repo-releases-tag) |
| GET | `/repos/{owner}/{repo}/releases/{tag}/upload_url` | 获取 Release 附件上传地址 | 路径参数：`owner`（string，必填） 仓库所属空间地址（企业、组织或个人的地址path）、`repo`（string，必填） 仓库路径、`tag`（string，必填） tag名称；查询参数：`access_token`（string，必填） 用户授权码、`file_name`（string，必填） 要上传的文件名称；响应：`url`（string）、`headers`（object） | [获取Release附件上传地址](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-releases-tag-upload-url) |
| GET | `/repos/{owner}/{repo}/releases/{tag}` | 获取仓库的单个 Release | 路径参数：`owner`（string，必填） 仓库所属空间地址(企业、组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`tag`（string，必填） Tag 名称；查询参数：`access_token`（string，必填） 用户授权码、`temp_download_url`（string，可选） 是否返回源码包和附件临时下载地址，默认false；响应：`tag_name`（string）、`target_commitish`（string）、`prerelease`（boolean）、`name`（string）、`body`（string）、`author`（object）、`id`（string）、`login`（string）、`name`（string）、`avatar_url`（string）、`html_url`（string）、`type`（string）、`url`（string）、`created_at`（string） 等 | [获取仓库的单个Release](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-releases-tag) |
| GET | `/repos/{owner}/{repo}/releases/latest` | 获取仓库的最后更新的 Release | 路径参数：`owner`（string，必填） 仓库所属空间地址(企业、组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码；响应：`tag_name`（string）、`target_commitish`（string）、`prerelease`（boolean）、`name`（string）、`body`（string）、`author`（object）、`id`（string）、`login`（string）、`name`（string）、`avatar_url`（string）、`html_url`（string）、`type`（string）、`url`（string）、`created_at`（string） 等 | [获取仓库的最后更新的Release](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-releases-latest) |
| GET | `/repos/{owner}/{repo}/releases/tags/{tag}` | 根据 Tag 名称获取仓库的 Release | 路径参数：`owner`（string，必填） 仓库所属空间地址（企业、组织或个人的地址path）、`repo`（string，必填） 仓库路径(path)、`tag`（string，必填） Tag 名称；查询参数：`access_token`（string，必填） 用户授权码；响应：`tag_name`（string）、`target_commitish`（string）、`prerelease`（integer）、`name`（string）、`body`（string）、`author`（object）、`id`（string）、`login`（string）、`name`（string）、`avatar_url`（string）、`html_url`（string）、`type`（string）、`url`（string）、`created_at`（string） 等 | [根据Tag名称获取仓库的Release](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-releases-tags-tag) |
| GET | `/repos/{owner}/{repo}/releases` | 获取仓库的所有 Release | 路径参数：`owner`（string，必填） 仓库所属空间地址（企业、组织或个人的地址path）、`repo`（string，必填） 仓库路径(path)；查询参数：`access_token`（string，必填） 用户授权码、`direction`（string，可选） 可选。升序/降序。不填为升序、`page`（integer，可选） 当前的页码、`per_page`（integer，可选） 每页的数量，最大为100，默认 20；响应：`tag_name`（string）、`target_commitish`（string）、`prerelease`（integer）、`name`（string）、`body`（string）、`author`（object）、`id`（string）、`login`（string）、`name`（string）、`avatar_url`（string）、`html_url`（string）、`type`（string）、`url`（string）、`created_at`（string） 等 | [获取仓库的所有Releases](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-releases) |
| GET | `/repos/{owner}/{repo}/releases/{tag}/attach_files/{file_name}/download` | 下载仓库 release 附件 | 路径参数：`owner`（string，必填） 仓库所属空间地址(企业、组织或个人的地址path)、`repo`（string，必填） 仓库路径(path)、`tag`（string，必填） 标签名称、`file_name`（string，必填） 附件名称；查询参数：`access_token`（string，必填） 用户授权码 | [下载仓库release附件](https://docs.gitcode.com/docs/apis/get-api-v-5-repos-owner-repo-releases-attach-files-file-name-download) |
---

## Enterprise（企业，v8）

以下为 **v8** 接口，Base URL 为 `https://api.gitcode.com/api/v8`。

| Method | Path | 功能说明 | 可获取信息 | 官方文档 |
|--------|------|----------|------------|----------|
| GET | `/enterprises/{enterprise}/members/{username}` | 获取企业的一个成员 | 路径参数：`enterprise`（integer，必填） 企业id、`username`（string，必填） 用户名(username/login)；查询参数：`access_token`（string，必填） 用户授权码；响应：`user`（object）、`avatar_url`（string）、`html_url`（string）、`id`（string）、`object_id`（string）、`login`（string）、`name`（string）、`url`（string）、`user_id`（string）、`active`（boolean）、`role`（string）、`role_name`（string）、`role_id`（string）、`role_name_cn`（string） 等 | [获取企业的一个成员](https://docs.gitcode.com/docs/apis/get-api-v-8-enterprises-enterprise-members-username) |
| GET | `/enterprises/{enterprise}/members` | 列出企业的所有成员 | 路径参数：`enterprise`（integer，必填） 企业id；查询参数：`access_token`（string，必填） 用户授权码、`page`（integer，可选） 当前的页码:默认为 1、`per_page`（integer，可选） 每页的数量，最大为 100，默认 20、`role`（string，可选） 根据角色筛选成员(all/admin/member)；响应：`page`（integer）、`per_page`（integer）、`role`（string）、`enterprise_email`（string） | [列出企业的所有成员](https://docs.gitcode.com/docs/apis/get-api-v-8-enterprises-enterprise-members) |
| POST | `/enterprises/{enterprise}/memberships/{username}` | 邀请企业成员 | 路径参数：`enterprise`（integer，必填） 企业id、`username`（string，必填） 用户名(username/login)；查询参数：`access_token`（string，必填） 用户授权码；响应：`followers_url`（string）、`html_url`（string）、`id`（string）、`login`（string）、`name`（string）、`type`（string）、`url`（string）、`permissions`（object）、`admin`（integer）、`customized`（integer）、`push`（integer）、`pull`（integer） | [邀请企业成员](https://docs.gitcode.com/docs/apis/post-api-v-8-enterprises-enterprise-memberships-username) |
| DELETE | `/enterprises/{enterprise}/members/usernames` | 删除企业成员 | 路径参数：`enterprise`（integer，必填） 企业id、`username`（string，必填）；查询参数：`access_token`（string，必填） 用户授权码 | [删除企业成员](https://docs.gitcode.com/docs/apis/delete-api-v-8-enterprises-enterprise-members-usernames) |
| PUT | `/enterprises/{enterprise}/members/{username}` | 修改企业成员权限 | 路径参数：`enterprise`（integer） 企业id、`username`（string） 用户名(username/login)；查询参数：`access_token`（string） 用户授权码；响应：`active`（integer）、`role`（string）、`url`（string）、`user`（object）、`id`（integer）、`login`（string）、`url`（string）、`html_url`（string）、`name`（string） | [修改企业成员权限](https://docs.gitcode.com/docs/apis/put-api-v-8-enterprises-enterprise-members-username) |
| GET | `/org/{org}/enterprise` | 获取组织关联的企业 | 路径参数：`org`（string，必填） 组织的路径；查询参数：`access_token`（string，可选） 用户授权码；响应：`id`（integer）、`name`（string） | [获取组织关联的企业](https://docs.gitcode.com/docs/apis/get-api-v-8-org-org-enterprise) |
| GET | `/enterprise/{enterprise_id}/customized_roles` | 获取企业自定义角色 | 路径参数：`enterprise_id`（string，必填） 企业id；查询参数：`access_token`（string，可选） 用户授权码；响应：`access_token`（string）、`id`（string）、`name`（string）、`name_cn`（string）、`product_id`（string）、`access_level`（integer）、`created_at`（string）、`role_type`（string）、`updated_at`（string）、`description`（string）、`mgnt_mode`（integer）、`member_count`（integer） | [获取企业自定义角色](https://docs.gitcode.com/docs/apis/get-api-v-8-enterprise-enterprise-id-customized-roles) |
| POST | `/enterprises/{enterprise}/milestones` | 创建企业里程碑 | 路径参数：`enterprise`（string，必填） 企业id；查询参数：`access_token`（string，必填） 用户授权码；响应：`id`（id）、`title`（标题）、`description`（描述）、`state`（状态）、`created_at`（创建时间）、`updated_at`（更新时间）、`due_date`（截止时间）、`start_date`（开始时间）、`projects`（string[]） | [创建企业里程碑](https://docs.gitcode.com/docs/apis/post-api-v-8-enterprise-enterprise-id-milestones) |
| PUT | `/enterprises/{enterprise}/milestones/{milestone_id}` | 修改企业里程碑 | 路径参数：`enterprise`（string） 企业id、`milestone_id`（string） 里程碑id；查询参数：`access_token`（string） 用户授权码；响应：`id`（id）、`title`（标题）、`description`（描述）、`state`（状态）、`created_at`（创建时间）、`updated_at`（更新时间）、`due_date`（截止时间）、`start_date`（开始时间）、`projects`（string[]） | [修改企业里程碑](https://docs.gitcode.com/docs/apis/put-api-v-8-enterprise-enterprise-id-milestones-milestone-id) |
| GET | `/enterprises/{enterprise}/milestones/{milestone_id}` | 获取企业里程碑详情 | 路径参数：`enterprise`（string，必填） 企业id、`milestone_id`（string，必填） 里程碑id；查询参数：`access_token`（string，必填） 用户授权码；响应：`id`（id）、`title`（标题）、`description`（描述）、`state`（状态）、`created_at`（创建时间）、`updated_at`（更新时间）、`due_date`（截止时间）、`start_date`（开始时间）、`projects`（string[]） | [获取企业里程碑详情](https://docs.gitcode.com/docs/apis/get-api-v-8-enterprise-enterprise-id-milestones-milestone-id) |
| DELETE | `/enterprises/{enterprise}/milestones/{milestone_id}` | 删除企业里程碑 | 路径参数：`enterprise`（string，必填） 企业id、`milestone_id`（string，必填） 里程碑id；查询参数：`access_token`（string，必填） 用户授权码 | [删除企业里程碑](https://docs.gitcode.com/docs/apis/delete-api-v-8-enterprise-enterprise-id-milestones-milestone-id) |
| GET | `/enterprises/{enterprise}/milestones` | 获取企业里程碑列表 | 路径参数：`enterprise`（string，必填） 企业id；查询参数：`access_token`（string，必填） 用户授权码、`name`（string，可选） 名称、`state`（string，可选） 状态、`order_by`（string，可选） 排序字段。可选：updated_at、`sort`（string，可选） 排序方式。降序：desc；升序：asc、`page`（string，可选） 当前的页码:默认为 1、`per_page`（string，可选） 每页的数量，最大为 100，默认 20；响应：`name`（string）、`state`（string）、`order_by`（string）、`sort`（string）、`page`（string）、`per_page`（string）、`total_count`（总数量）、`total_page`（总页数） | [获取企业里程碑列表](https://docs.gitcode.com/docs/apis/get-api-v-8-enterprise-enterprise-id-milestones) |
| GET | `/enterprises/{enterprise}/groups/projects` | 获取企业里程碑可以关联的项目列表 | 路径参数：`enterprise`（string，必填） 企业id；查询参数：`access_token`（string，必填） 用户授权码、`group_name`（string，可选） 组织名称；响应：`group_name`（string）、`total_count`（总数量）、`total_page`（总页数） | [获取企业里程碑可以关联的项目列表](https://docs.gitcode.com/docs/apis/get-api-v-8-enterprise-enterprise-id-groups-projects) |
| GET | `/enterprises/{enterprise_id}/issue_extend_field` | 获取企业Issue自定义字段列表 | 响应：`total_count`（总数量）、`total_page`（总页数） | [获取企业Issue自定义字段列表](https://docs.gitcode.com/docs/apis/get-api-v-8-enterprises-enterprises-id-issue-extend-field) |
---

## Dashboard（看板）

| Method | Path | 功能说明 | 可获取信息 | 官方文档 |
|--------|------|----------|------------|----------|
| GET | `/org/{owner}/kanban/list` | 获取组织看板列表 | 路径参数：`owner`（string，必填） 组织的路径；查询参数：`access_token`（string，必填） 用户授权码、`status`（integer，可选） 状态 0: 正常 1:关闭，默认不传为全部、`sort`（string，可选） 最新: newest, 最老: oldest、`visibility`（integer，可选） 可见性 1:公开的 2: 私密的、`search`（string，可选） 按照名称搜索、`page`（string，可选） 当前页码、`per_page`（string，可选） 每页数量；响应：`close_count`（integer）、`open_count`（integer）、`all_count`（integer）、`content`（object[]）、`id`（string）、`iid`（integer）、`name`（string）、`description`（string）、`status`（integer）、`visibility`（integer）、`updated_at`（string） | [获取组织看板列表](https://docs.gitcode.com/docs/apis/get-api-v-5-org-owner-kanban-list) |
| GET | `/org/{owner}/kanban/{kanban_id}/detail` | 获取单个看板详情 | 路径参数：`owner`（string，必填） 组织的路径、`kanban_id`（string，必填） 看板id；查询参数：`access_token`（string，可选） 用户授权码；响应：`id`（string）、`name`（string）、`description`（string）、`status`（integer）、`visibility`（integer） | [获取单个看板详情](https://docs.gitcode.com/docs/apis/get-api-v-5-org-owner-kanban-id-detail) |
| POST | `/org/{owner}/kanban/{kanban_id}/add_item` | 添加Issue或者Pull Request到看板 | 路径参数：`owner`（string，必填） 组织的路径、`kanban_id`（string，必填） 看板id；查询参数：`access_token`（string，可选） 用户授权码；响应：`access_token`（string） | [添加Issue或者Pull Request到看板](https://docs.gitcode.com/docs/apis/post-api-v-5-org-owner-kanban-id-add-item) |
| PUT | `/org/{owner}/kanban/repo/{repo}/{type}/{iid}` | 更新Issue或者Pull Request关联的看板 | 路径参数：`owner`（string，必填） 组织的路径、`repo`（string，必填） 仓库的路径、`type`（string，必填） 类型，issue/merge_request、`iid`（string，必填） issue或者pull request的iid；查询参数：`access_token`（string，可选） 用户授权码；响应：`access_token`（string） | [更新Issue或者Pull Request关联的看板](https://docs.gitcode.com/docs/apis/put-api-v-5-org-owner-kanban-repo-repo-type-iid-new) |
| DELETE | `/org/{owner}/kanban/{kanban_id}/remove_item` | 删除看板关联的Issue或者Pull Request | 路径参数：`owner`（string，必填） 组织的路径、`kanban_id`（string，必填） 看板id；查询参数：`access_token`（string，可选） 用户授权码；响应：`access_token`（string） | [删除看板关联的Issue或者Pull Request](https://docs.gitcode.com/docs/apis/delete-api-v-5-org-owner-kanban-kanban-id-remove-item-new) |
| GET | `/org/{owner}/kanban/{kanban_id}/item_list` | 获取看板内容列表 | 路径参数：`owner`（string，必填） 组织的路径、`kanban_id`（string，必填） 看板id；查询参数：`access_token`（string，可选） 用户授权码、`repo`（string，可选） 仓库路径、`source_type`（string，可选） 来源类型：issue/merge_request、`source_status`（string，可选） 来源状态：opened/closed/merged、`title`（string，可选） 标题、`source_iids`（string，可选） 使用pr或者issue的iid进行查询, 使用该参数必须填写repo参数，否则不生效、`page`（string，可选） 分页参数，第几页、`per_page`（string，可选） 分页参数，每页数量；响应：`access_token`（string）、`repo`（string）、`source_type`（string）、`source_status`（string）、`title`（string）、`source_iids`（string）、`page`（string）、`per_page`（string）、`milestone_resp`（object）、`id`（integer）、`html_url`（string）、`number`（integer）、`state`（string）、`url`（string） 等 | [获取看板内容列表](https://docs.gitcode.com/docs/apis/get-api-v-5-org-owner-kanban-kanban-id-item-list) |
| PUT | `/org/{owner}/kanban/{kanban_id}/state` | 修改看板状态 | 路径参数：`owner`（string，必填） 组织的路径、`kanban_id`（string，必填） 看板id；查询参数：`access_token`（string，可选） 用户授权码；响应：`access_token`（string） | [修改看板状态](https://docs.gitcode.com/docs/apis/put-api-v-5-org-owner-kanban-kanban-id-state) |
---

## OAuth2.0 / AI hub

| 分类 | 功能说明 | 可获取信息 / 说明 | 官方入口 |
|------|----------|-------------------|----------|
| **OAuth2.0** | 获取/刷新授权 Token | access_token、refresh_token、expires_in 等 | [OAuth2.0](https://docs.gitcode.com/docs/apis/oauth) · [获取或刷新 Token](https://docs.gitcode.com/docs/apis/post-oauth-token-grant-type-authorization-code-code-code-client-id-client-id-client-secret-client-secret) |
| **AI hub** | AI 相关能力 | 见官方文档 | [官方侧栏 AI hub](https://docs.gitcode.com/docs/apis/) |

---

## 响应与文档说明

- 各接口的**功能说明**与**可获取信息**已写在对应分类的表格中；对关键参数与易混接口已补充说明，便于 agent 从名称与 path 正确理解功能。更多统计与易混分析见 [API 数量统计与描述分析](#api-数量统计与描述分析)。
- **仓库详情**（GET `/repos/{owner}/{repo}`）：列在 [Repositories（仓库）](#repositories仓库) 表首行「获取仓库详情」及 [Users（用户）](#users用户) 表「获取用户的某个仓库」；一次请求即可获得 `stargazers_count`、`forks_count`、`watchers_count`、`full_name`、`description`、`default_branch`、`open_issues_count` 等；完整字段见 [OpenAPI 仓库模块](https://docs.gitcode.com/v1-docs/docs/openapi/repos/)。
- **创建/更新 Issue**：**POST** `/repos/{owner}/issues`、**PATCH** `/repos/{owner}/issues/{number}` 路径中均无 repo，**repo 通过 body/form 传递**；与「获取仓库 issues」GET `/repos/{owner}/{repo}/issues` 的 path 不同。获取某 issue 操作日志 **GET** `/repos/{owner}/issues/{number}/operate_logs` 同样无 repo。以官方文档为准。
- **下载次数**：需单独请求 GET `/repos/{owner}/{repo}/download_statistics`（路径为下划线 **`download_statistics`**，非 `download-statistics`）；响应含 `download_statistics_detail`（按日明细）、`download_statistics_total`（近 30 天总下载量）、`download_statistics_history_total`（历史总下载量）。

## 文档来源与更新

- 本文档整理自 [GitCode API 文档入口](https://docs.gitcode.com/docs/apis/)，每个接口在官方站有单独页面（请求参数、响应示例、Demo）。
- 更完整参数与示例可参考 [OpenAPI 仓库/议题/PR 等模块](https://docs.gitcode.com/v1-docs/docs/openapi/)。
- 若与官方文档不一致，**以官方文档为准**。
