---
title: "获取代理任务（v1）"
method: GET
path: "/v1/agent/{projectId}/job/{id}"
deprecated: true
language: "zh-Hans"
---

# 获取代理任务（v1）

`GET /v1/agent/{projectId}/job/{id}`

## Request

- Base URL: `https://api.mintlify.com`
- URL: `https://api.mintlify.com/v1/agent/{projectId}/job/{id}`
- Auth: HTTP bearer

> **Deprecated.**

已废弃：请改用 [v2 get agent job](/api/agent/v2/get-agent-job)。按 ID 检索特定代理任务的详细信息和状态。

使用管理员 API 密钥进行身份验证。

## Path parameters

- `projectId` string, required
- `id` string, required

## Response `200`

已成功检索代理任务详细信息

- object
  - `sessionId` string: 此会话所属的子域。
  - `subdomain` string: 此会话所属的子域。
  - `branch` string, nullable: 进行更改的 Git branch 名称。
  - `haulted` boolean: 会话执行是否已中止。
  - `haultReason` 'completed' | 'github_missconfigured' | 'error' | 'processing' | 'interrupted': 会话中止的原因。`processing` 表示任务仍在运行。`interrupted` 表示任务被手动中断。
  - `pullRequestLink` string: 已创建的拉取请求（PR；亦称“合并请求”/Merge Request）链接。
  - `messageToUser` string: 向用户说明会话结果的消息。
  - `todos` object[]: 会话中的待办事项列表。
    - `content` string: 任务的简要说明。
    - `status` 'pending' | 'in_progress' | 'completed' | 'cancelled': 任务的当前状态。
    - `priority` 'high' | 'medium' | 'low': 任务的优先级。
    - `id` string: 待办事项的唯一标识符。
  - `userId` string: 创建此会话的用户 ID（如有）
  - `title` string: 用于概括代理任务的生成标题
  - `createdAt` string, date-time: 会话创建时的时间戳。

## Other responses

- `400`: 此项目中不存在具有该 ID 的代理任务，或项目 ID 格式无效。
- `401`: API 密钥缺失或无效，或者你的套餐不包含 API 访问权限或代理功能。
- `403`: 你的请求来自不在 API 密钥允许列表中的 IP 地址。
- `404`: 项目不存在或不属于你的组织。

## Changes

> 25 revisions in range; 2 not diffed.

- **2026-10-30** `8f632fe27713`: 4 info
  - added the non-success response with the status `400`
  - added the non-success response with the status `401`
  - added the non-success response with the status `403`
  - added the non-success response with the status `404`
- **2026-03-23** `fdf9f166a0f5`: 2 warning
  - added the new `interrupted` enum value to the `haultReason` response property for the response status `200`
  - added the new `processing` enum value to the `haultReason` response property for the response status `200`

[Operation history](https://skmtc.dev/mintlify/apis/mintlify-admin-api/zh/changes/v1/agent/:projectId/job/:id/get.md)

---

[API](https://skmtc.dev/mintlify/apis/mintlify-admin-api/zh.md) - [All operations](https://skmtc.dev/mintlify/apis/mintlify-admin-api/zh/llms.txt) - [OpenAPI document](https://skmtc.dev/mintlify/apis/mintlify-admin-api/zh/revisions/16b7a7e40d59?raw)
