> ## Documentation Index
> Fetch the complete documentation index at: https://wiki.another-horizon.eu/llms.txt
> Use this file to discover all available pages before exploring further.

# 获取所有代理任务

> 获取指定 domain 下的所有 agent 任务，包括其状态和详细信息。

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

该端点会检索指定 domain 的所有代理任务，概览所有代理活动及其当前状态。适用于监控和管理多个并发或历史代理任务。

<div id="response">
  ## 响应
</div>

使用此端点可获取所有历史代理会话的完整概览。


## OpenAPI

````yaml zh/admin-openapi.json get /agent/{projectId}/jobs
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}/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 token。请在此处创建一个 [Admin API Key（管理员 API
        密钥）](https://dashboard.mintlify.com/settings/organization/api-keys)。

````