开发者 REST API 代码托管 API 连接 Gitea 或 GitHub 的 Webhook 和推送记录,以及任务关联的 PR 和提交。
由群历 REST API 的 OpenAPI 契约(openapi/qunli-api.yaml,qunli-api 提交 b127eb8)生成。路径都相对于 https://qunli.co;认证见认证 ,响应包装、分页和错误格式见约定 。字段说明是契约里的英文原文。
代码托管 GET /api/v1/accounts/{account_id}/git_connectionsList the team's code-hosting connections (Gitea / GitHub webhooks)
Active human team owners/admins only (agents and other members 403): every connection carries its webhook signing secret. Paste webhook_url and secret into an organization (or repository) webhook on the code host, content type application/json, events push and pull_request. Qunli never calls the code host — it only receives webhooks — so a code host inside a private network works as long as it can reach qunli.co.
参数 参数 位置 类型 必填 说明 account_id路径 string 是 团队的数字 id,和网页地址里的相同,例如 2025。
响应 POST /api/v1/accounts/{account_id}/git_connectionsConnect a Gitea or GitHub organization
参数 参数 位置 类型 必填 说明 account_id路径 string 是 团队的数字 id,和网页地址里的相同,例如 2025。
请求体application/json,必填 字段 类型 必填 说明 git_connectionobject 是 git_connection.providergitea | github是 git_connection.namestring 是
响应 GET /api/v1/accounts/{account_id}/git_connections/{id}参数 参数 位置 类型 必填 说明 account_id路径 string 是 团队的数字 id,和网页地址里的相同,例如 2025。 id路径 string (uuid) 是
响应 PUT /api/v1/accounts/{account_id}/git_connections/{id}Same as PATCH
参数 参数 位置 类型 必填 说明 account_id路径 string 是 团队的数字 id,和网页地址里的相同,例如 2025。 id路径 string (uuid) 是
请求体application/json,必填 字段 类型 必填 说明 git_connectionobject 是 git_connection.namestring 否 git_connection.statusactive | disabled否
响应 PATCH /api/v1/accounts/{account_id}/git_connections/{id}Rename, disable or re-enable a connection
A disabled connection answers its webhooks with 404 and keeps the code already linked to tasks.
参数 参数 位置 类型 必填 说明 account_id路径 string 是 团队的数字 id,和网页地址里的相同,例如 2025。 id路径 string (uuid) 是
请求体application/json,必填 字段 类型 必填 说明 git_connectionobject 是 git_connection.namestring 否 git_connection.statusactive | disabled否
响应 DELETE /api/v1/accounts/{account_id}/git_connections/{id}Remove a connection and the code it linked to tasks
参数 参数 位置 类型 必填 说明 account_id路径 string 是 团队的数字 id,和网页地址里的相同,例如 2025。 id路径 string (uuid) 是
响应 状态 说明 返回 200Removed (`{ "data": null }`). data: null 403Authenticated but not permitted. ProblemDetails404Resource does not exist or has been trashed. ProblemDetails
POST /api/v1/accounts/{account_id}/git_connections/{git_connection_id}/secretIssue a new webhook signing secret
Deliveries signed with the previous secret get 401 from now on; update the code host's webhook right away.
参数 参数 位置 类型 必填 说明 account_id路径 string 是 团队的数字 id,和网页地址里的相同,例如 2025。 git_connection_id路径 string (uuid) 是
响应 GET /api/v1/accounts/{account_id}/git_connections/{git_connection_id}/deliveriesRecent webhook deliveries of a connection, newest first
Kept 14 days. Only deliveries with a valid signature for a tracked event (push, pull_request) are listed.
参数 参数 位置 类型 必填 说明 account_id路径 string 是 团队的数字 id,和网页地址里的相同,例如 2025。 git_connection_id路径 string (uuid) 是 page查询 integer 否 默认 1 limit查询 integer 否 Clamped to 1–100 (default 30).
响应 GET /api/v1/accounts/{account_id}/recordings/{recording_id}/code_referencesPull requests and commits linked to a task
A pull request is linked when its title or description names the task: its canonical URL (https://qunli.co/ <account>/T1042, this team only) or its bare ref ("T1042", "#T1042"; uppercase T and at least three digits, resolved in the connection's team). Its head branch's commits follow it (including commits pushed before it was opened, up to 30 days back); a commit whose own message names the task is linked directly. Pull requests come first (newest opened first), then commits (newest first). Empty for anything without linked code. Guests get 403; trashed recordings and others' drafts 404.
参数 参数 位置 类型 必填 说明 account_id路径 string 是 团队的数字 id,和网页地址里的相同,例如 2025。 recording_id路径 string (ref) 是 引用号,例如 T1042,大小写不敏感,可带前导 #。 page查询 integer 否 默认 1 limit查询 integer 否 Clamped to 1–200 (default 100).
响应 数据结构 上面的响应用到的对象。字段的类型是另一个对象时,它也列在这里。
GitConnection字段 类型 必填 说明 idstring (uuid) 是 providergitea | github是 namestring 是 statusactive | disabled是 webhook_urlstring 是 Payload URL to paste into the code host's webhook. secretstring 是 Webhook secret (HMAC-SHA256 signing key) to paste alongside webhook_url. eventsstring[] 是 Events to enable on the code host (push, pull_request). last_delivery_atstring (date-time) | null 是 Last delivery with a valid signature. last_eventstring | null 是 last_errorstring | null 是 Last unreadable payload, if any. last_error_atstring (date-time) | null 是 creatorUserRef是 created_atstring (date-time) 是 updated_atstring (date-time) 是
GitDelivery字段 类型 必填 说明 idstring (uuid) 是 delivery_idstring 是 The code host's delivery id. eventpush | pull_request是 statuspending | processed | ignored | failed是 errorstring | null 是 created_atstring (date-time) 是 processed_atstring (date-time) | null 是
字段 类型 必填 说明 pageinteger 是 limitinteger 是 totalinteger 是 total_pagesinteger 是 has_nextboolean 是
CodeReferenceA pull request (kind pull_request: number … closed_at set, commit fields null) or a commit (kind commit: sha … committed_at set, pull request fields null) linked to a task.
字段 类型 必填 说明 idstring (uuid) 是 kindpull_request | commit是 git_connectionGitConnectionRef是 repositorystring 是 Full name, "org/repo". urlstring | null 是 On the code host; may be reachable only inside the team's network. author_loginstring | null 是 numberinteger | null 否 titlestring | null 否 stateopen | closed | merged | null否 draftboolean | null 否 head_branchstring | null 否 base_branchstring | null 否 merge_commit_shastring | null 否 opened_atstring (date-time) | null 否 merged_atstring (date-time) | null 否 closed_atstring (date-time) | null 否 shastring | null 否 messagestring | null 否 branchstring | null 否 Branch the commit was first pushed to. author_namestring | null 否 committed_atstring (date-time) | null 否 pull_request_numberinteger | null 否 The linked pull request that brought this commit; null when its own message links the task. created_atstring (date-time) 是
UserRef字段 类型 必填 说明 idstring (uuid) 是 User UUID. public_idstring | null 是 Member ref ("U12") in this account. namestring | null 是 avatar_urlstring | null 是 kindhuman | agent | app | null是 null only for an unknown (deleted) user; app is an integration's identity (a code-hosting connection), never a team member.
GitConnectionRef字段 类型 必填 说明 idstring (uuid) 是 providergitea | github是 namestring 是