> ## Documentation Index
> Fetch the complete documentation index at: https://www.mintlify.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# 获取代理任务（v1）

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

<Warning>此端点已废弃。请改用 [v2 获取代理任务](/zh/api/agent/v2/get-agent-job) 端点。</Warning>

<div id="usage">
  ## 用法
</div>

此端点通过代理任务的唯一标识符获取该任务的详细信息和状态。可用于查看先前创建的代理任务的进度、状态和结果。

<div id="job-details">
  ## 作业详情
</div>

响应包含以下信息：

* 作业执行状态与完成情况
* branch 信息和拉取请求 (PR；亦称“合并请求”/Merge Request) 详情
* 会话 metadata 与时间戳


## OpenAPI

````yaml zh/admin-openapi.json GET /v1/agent/{projectId}/job/{id}
openapi: 3.0.1
info:
  title: Mintlify Admin API
  description: 用于管理操作的 API，包括文档更新和代理管理。
  version: 2.0.0
servers:
  - url: https://api.mintlify.com
security:
  - bearerAuth: []
paths:
  /v1/agent/{projectId}/job/{id}:
    get:
      summary: 按 ID 获取代理任务（v1）
      description: >-
        已废弃：请改用 [v2 get agent job](/api/agent/v2/get-agent-job)。按 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
                      - processing
                      - interrupted
                    description: 会话中止的原因。`processing` 表示任务仍在运行。`interrupted` 表示任务被手动中断。
                  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: 用于概括代理任务的生成标题
                  createdAt:
                    type: string
                    format: date-time
                    description: 会话创建时的时间戳。
      deprecated: true
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Authorization 头部需要 Bearer 令牌。请使用以 `mint_` 为前缀的管理员 API
        密钥。这是服务端使用的机密凭证。你可以在控制台的 [API keys
        页面](https://dashboard.mintlify.com/settings/organization/api-keys)
        中生成一个。

````

## Related topics

- [获取代理任务](/docs/zh/api/agent/v2/get-agent-job.md)
- [简介](/docs/zh/api/introduction.md)
- [发送后续消息](/docs/zh/api/agent/v2/send-message.md)
