跳转到主要内容
GET
/
agent
/
{projectId}
/
job
/
{id}
Get agent job
curl --request GET \
  --url https://api.mintlify.com/v2/agent/{projectId}/job/{id} \
  --header 'Authorization: Bearer <token>'
{
  "id": "<string>",
  "status": "active",
  "source": {
    "repository": "<string>",
    "ref": "<string>"
  },
  "model": "<string>",
  "prLink": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "archivedAt": "2023-11-07T05:31:56Z"
}
此端点获取特定代理任务的当前状态和详细信息。使用它来轮询完成情况,并在代理创建 PR 后获取链接。

任务状态

状态描述
active任务正在运行
completed任务成功完成
failed任务遇到错误
archived任务已归档

轮询建议

  • 当任务为 active 时,每 5-10 秒轮询一次
  • 当状态变为 completedfailedarchived 后停止轮询
  • 当代理创建 pull request 后,prLink 字段会被填充

授权

Authorization
string
header
必填

The Authorization header expects a Bearer token. Use an admin API key (prefixed with mint_). This is a server-side secret key. Generate one on the API keys page in your dashboard.

路径参数

projectId
string
必填

Your project ID. Can be copied from the API keys page in your dashboard.

id
string
必填

The unique identifier of the agent job to retrieve.

响应

Agent job details retrieved successfully.

id
string

Unique identifier for the agent job.

status
enum<string>

Current status of the agent job.

可用选项:
active,
completed,
archived,
failed
source
object

Information about the source repository.

model
string

The AI model used for this job.

URL of the pull request created by the agent. Null until the PR is created.

createdAt
string<date-time>

Timestamp when the job was created.

archivedAt
string<date-time> | null

Timestamp when the job was archived. Null if still active.