Files
mintlify__docs/zh/admin-openapi.json
locadex-agent[bot] 48fd66b575 docs(locadex): add translations (#4166)
Co-authored-by: locadex-agent[bot] <217277504+locadex-agent[bot]@users.noreply.github.com>
2026-03-09 10:38:14 -07:00

372 lines
14 KiB
JSON
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"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": [
"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",
"assistant"
],
"description": "消息发送者的角色。任务说明请使用 `user`。如需添加补充说明,请使用 `system`;这些说明会附加在默认系统提示之后(不会替换默认系统提示)。如需为少样本提示提供 `assistant` 响应示例,请使用 `assistant`。"
},
"content": {
"type": "string",
"description": "消息内容。"
}
}
}
},
"asDraft": {
"type": "boolean",
"default": false,
"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": "待办事项的唯一标识。"
}
}
}
},
"userId": {
"type": "string",
"description": "创建此会话的用户 ID(如果可用)。"
},
"title": {
"type": "string",
"description": "自动生成的 title,用于概括代理任务。"
},
"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": "待办事项的唯一标识符。"
}
}
}
},
"userId": {
"type": "string",
"description": "创建此会话的用户 ID(如果可用)。"
},
"title": {
"type": "string",
"description": "自动生成的 title,用于概括代理任务。"
},
"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) 中生成一个。"
}
}
}
}