Skip to main content
GET
/
v1
/
agent
/
{projectId}
/
job
/
{id}
按 ID 获取代理任务(v1)
curl --request GET \
  --url https://api.mintlify.com/v1/agent/{projectId}/job/{id} \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.mintlify.com/v1/agent/{projectId}/job/{id}"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.mintlify.com/v1/agent/{projectId}/job/{id}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.mintlify.com/v1/agent/{projectId}/job/{id}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.mintlify.com/v1/agent/{projectId}/job/{id}"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.mintlify.com/v1/agent/{projectId}/job/{id}")
  .header("Authorization", "Bearer <token>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.mintlify.com/v1/agent/{projectId}/job/{id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "sessionId": "<string>",
  "subdomain": "<string>",
  "branch": "<string>",
  "haulted": true,
  "pullRequestLink": "<string>",
  "messageToUser": "<string>",
  "todos": [
    {
      "content": "<string>",
      "id": "<string>"
    }
  ],
  "userId": "<string>",
  "title": "<string>",
  "createdAt": "2023-11-07T05:31:56Z"
}
此端点已废弃。请改用 v2 获取代理任务 端点。

用法

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

作业详情

响应包含以下信息:
  • 作业执行状态与完成情况
  • branch 信息和拉取请求 (PR;亦称“合并请求”/Merge Request) 详情
  • 会话 metadata 与时间戳

Authorizations

Authorization
string
header
required

Authorization 头部需要 Bearer 令牌。请使用以 mint_ 为前缀的管理员 API 密钥。这是服务端使用的机密凭证。你可以在控制台的 API keys 页面 中生成一个。

Path Parameters

projectId
string
required

你的项目 ID。可从你的控制台中的 API keys 页面复制。

id
string
required

要检索的代理任务的唯一标识符。

Response

200 - application/json

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

sessionId
string

此会话所属的子域。

subdomain
string

此会话所属的子域。

branch
string | null

进行更改的 Git branch 名称。

haulted
boolean

会话执行是否已中止。

haultReason
enum<string>

会话中止的原因。processing 表示任务仍在运行。interrupted 表示任务被手动中断。

Available options:
completed,
github_missconfigured,
error,
processing,
interrupted

已创建的拉取请求(PR;亦称“合并请求”/Merge Request)链接。

messageToUser
string

向用户说明会话结果的消息。

todos
object[]

会话中的待办事项列表。

userId
string

创建此会话的用户 ID(如有)

title
string

用于概括代理任务的生成标题

createdAt
string<date-time>

会话创建时的时间戳。