mirror of
https://github.com/mintlify/docs.git
synced 2026-09-14 13:35:46 +08:00
19d89bf8eb
Co-authored-by: locadex-agent[bot] <217277504+locadex-agent[bot]@users.noreply.github.com>
356 lines
14 KiB
JSON
356 lines
14 KiB
JSON
{
|
||
"openapi": "3.0.1",
|
||
"info": {
|
||
"title": "Mintlify Admin API",
|
||
"description": "用于管理操作的 API,包括文档更新和代理管理。",
|
||
"version": "1.0.0"
|
||
},
|
||
"servers": [
|
||
{
|
||
"url": "https://api.mintlify.com/v1"
|
||
}
|
||
],
|
||
"security": [
|
||
{
|
||
"bearerAuth": []
|
||
}
|
||
],
|
||
"paths": {
|
||
"/agent/{projectId}/job": {
|
||
"post": {
|
||
"summary": "创建代理作业",
|
||
"description": "创建一个新的 agent 作业,可根据提供的消息和 branch 信息生成并编辑文档。",
|
||
"parameters": [
|
||
{
|
||
"name": "projectId",
|
||
"in": "path",
|
||
"required": true,
|
||
"schema": {
|
||
"type": "string"
|
||
},
|
||
"description": "你的项目 ID。可在控制台的 [API keys](https://dashboard.mintlify.com/settings/organization/api-keys) 页面中复制。"
|
||
}
|
||
],
|
||
"requestBody": {
|
||
"required": true,
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"type": "object",
|
||
"required": [
|
||
"branch",
|
||
"messages"
|
||
],
|
||
"properties": {
|
||
"branch": {
|
||
"type": "string",
|
||
"description": "代理应处理的 Git branch 名称,若该 branch 不存在,将会自动创建"
|
||
},
|
||
"messages": {
|
||
"type": "array",
|
||
"description": "要提供给代理的消息列表。系统会始终在最前面自动添加一个默认的系统提示词,因此通常只需要包含用户消息即可。",
|
||
"items": {
|
||
"type": "object",
|
||
"required": [
|
||
"role",
|
||
"content"
|
||
],
|
||
"properties": {
|
||
"role": {
|
||
"type": "string",
|
||
"enum": [
|
||
"system",
|
||
"user"
|
||
],
|
||
"description": "消息发送方的角色。使用 `user` 表示任务指令。使用 `system` 添加补充指令,这些指令会附加在默认 system prompt 之后(不会替换默认的 system prompt)。"
|
||
},
|
||
"content": {
|
||
"type": "string",
|
||
"description": "消息内容。"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"asDraft": {
|
||
"type": "boolean",
|
||
"default": true,
|
||
"description": "控制是否以草稿模式或非草稿模式创建拉取请求(PR;亦称“合并请求”/Merge Request)。为 true 时,将创建草稿拉取请求;为 false 时,将创建常规(非草稿)拉取请求,供审核使用。"
|
||
},
|
||
"model": {
|
||
"type": "string",
|
||
"enum": [
|
||
"sonnet",
|
||
"opus"
|
||
],
|
||
"default": "sonnet",
|
||
"description": "用于该智能体任务的 AI 模型。使用 `sonnet` 可获得更快捷、成本更低的处理。使用 `opus` 可获得更强大但速度更慢的处理。"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "代理任务已成功创建(流式响应)。X-Session-Id 头会随响应一同返回",
|
||
"headers": {
|
||
"X-Message-Id": {
|
||
"schema": {
|
||
"type": "string"
|
||
},
|
||
"description": "已创建任务的消息标识符"
|
||
}
|
||
},
|
||
"content": {
|
||
"text/plain": {
|
||
"schema": {
|
||
"type": "string",
|
||
"description": "包含代理任务执行详情和结果的流式响应。"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/agent/{projectId}/job/{id}": {
|
||
"get": {
|
||
"summary": "通过 ID 获取代理任务",
|
||
"description": "根据其 ID 获取指定代理任务的详细信息和状态。",
|
||
"parameters": [
|
||
{
|
||
"name": "projectId",
|
||
"in": "path",
|
||
"required": true,
|
||
"schema": {
|
||
"type": "string"
|
||
},
|
||
"description": "项目 ID。可在控制台的 [API keys](https://dashboard.mintlify.com/settings/organization/api-keys) 页面中复制。"
|
||
},
|
||
{
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true,
|
||
"schema": {
|
||
"type": "string"
|
||
},
|
||
"description": "要检索的代理作业的唯一标识符。"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功获取代理任务详情",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"type": "object",
|
||
"properties": {
|
||
"sessionId": {
|
||
"type": "string",
|
||
"description": "本次会话所属的子域。"
|
||
},
|
||
"subdomain": {
|
||
"type": "string",
|
||
"description": "该会话所属的子域。"
|
||
},
|
||
"branch": {
|
||
"type": "string",
|
||
"description": "包含这些更改的 Git branch 名称。",
|
||
"nullable": true
|
||
},
|
||
"haulted": {
|
||
"type": "boolean",
|
||
"description": "会话执行是否已被中止。"
|
||
},
|
||
"haultReason": {
|
||
"type": "string",
|
||
"enum": [
|
||
"completed",
|
||
"github_missconfigured",
|
||
"error"
|
||
],
|
||
"description": "会话终止原因。"
|
||
},
|
||
"pullRequestLink": {
|
||
"type": "string",
|
||
"description": "指向已创建拉取请求(PR,亦称“合并请求”/Merge Request)的链接。"
|
||
},
|
||
"messageToUser": {
|
||
"type": "string",
|
||
"description": "用于告知用户会话结果的消息。"
|
||
},
|
||
"todos": {
|
||
"type": "array",
|
||
"description": "本次会话的待办事项清单。",
|
||
"items": {
|
||
"type": "object",
|
||
"properties": {
|
||
"content": {
|
||
"type": "string",
|
||
"description": "任务的简要说明。"
|
||
},
|
||
"status": {
|
||
"type": "string",
|
||
"enum": [
|
||
"pending",
|
||
"in_progress",
|
||
"completed",
|
||
"cancelled"
|
||
],
|
||
"description": "当前任务状态。"
|
||
},
|
||
"priority": {
|
||
"type": "string",
|
||
"enum": [
|
||
"high",
|
||
"medium",
|
||
"low"
|
||
],
|
||
"description": "任务的优先级。"
|
||
},
|
||
"id": {
|
||
"type": "string",
|
||
"description": "待办事项的唯一标识。"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"createdAt": {
|
||
"type": "string",
|
||
"format": "date-time",
|
||
"description": "会话创建时间的时间戳。"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/agent/{projectId}/jobs": {
|
||
"get": {
|
||
"summary": "获取所有代理任务",
|
||
"description": "获取指定 domain 下的所有 agent 任务,包括其状态和详细信息。",
|
||
"parameters": [
|
||
{
|
||
"name": "projectId",
|
||
"in": "path",
|
||
"required": true,
|
||
"schema": {
|
||
"type": "string"
|
||
},
|
||
"description": "项目 ID。可在控制台的 [API keys](https://dashboard.mintlify.com/settings/organization/api-keys) 页面中复制获取。"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "已成功检索到所有代理作业",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"type": "object",
|
||
"properties": {
|
||
"allSessions": {
|
||
"type": "array",
|
||
"description": "该 domain 的所有代理会话数组。",
|
||
"items": {
|
||
"type": "object",
|
||
"properties": {
|
||
"sessionId": {
|
||
"type": "string",
|
||
"description": "本会话所属的子域。"
|
||
},
|
||
"subdomain": {
|
||
"type": "string",
|
||
"description": "此会话对应的子域。"
|
||
},
|
||
"branch": {
|
||
"type": "string",
|
||
"description": "进行更改所在的 Git branch 名称。",
|
||
"nullable": true
|
||
},
|
||
"haulted": {
|
||
"type": "boolean",
|
||
"description": "会话执行是否被中止。"
|
||
},
|
||
"haultReason": {
|
||
"type": "string",
|
||
"enum": [
|
||
"completed",
|
||
"github_missconfigured",
|
||
"error"
|
||
],
|
||
"description": "会话中止原因"
|
||
},
|
||
"pullRequestLink": {
|
||
"type": "string",
|
||
"description": "指向已创建拉取请求(PR;亦称“合并请求”/Merge Request)的链接。"
|
||
},
|
||
"messageToUser": {
|
||
"type": "string",
|
||
"description": "用于告知用户会话结果的消息。"
|
||
},
|
||
"todos": {
|
||
"type": "array",
|
||
"description": "本次会话的待办事项列表。",
|
||
"items": {
|
||
"type": "object",
|
||
"properties": {
|
||
"content": {
|
||
"type": "string",
|
||
"description": "任务简要说明。"
|
||
},
|
||
"status": {
|
||
"type": "string",
|
||
"enum": [
|
||
"pending",
|
||
"in_progress",
|
||
"completed",
|
||
"cancelled"
|
||
],
|
||
"description": "任务当前状态。"
|
||
},
|
||
"priority": {
|
||
"type": "string",
|
||
"enum": [
|
||
"high",
|
||
"medium",
|
||
"low"
|
||
],
|
||
"description": "任务优先级。"
|
||
},
|
||
"id": {
|
||
"type": "string",
|
||
"description": "待办事项的唯一标识符。"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"createdAt": {
|
||
"type": "string",
|
||
"format": "date-time",
|
||
"description": "会话创建时的时间戳。"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"components": {
|
||
"securitySchemes": {
|
||
"bearerAuth": {
|
||
"type": "http",
|
||
"scheme": "bearer",
|
||
"description": "Authorization 头部需要 Bearer 令牌。请使用以 `mint_` 为前缀的管理员 API 密钥。这是服务端使用的机密凭证。你可以在控制台的 [API keys 页面](https://dashboard.mintlify.com/settings/organization/api-keys) 中生成一个。"
|
||
}
|
||
}
|
||
}
|
||
} |