跳转到主要内容
GET
/
agent
/
{projectId}
/
jobs
获取所有代理任务
curl --request GET \
  --url https://api.mintlify.com/v1/agent/{projectId}/jobs \
  --header 'Authorization: Bearer <token>'
import requests

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

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}/jobs', 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}/jobs",
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}/jobs"

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}/jobs")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

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

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
{
  "allSessions": [
    {
      "sessionId": "<string>",
      "subdomain": "<string>",
      "branch": "<string>",
      "haulted": true,
      "pullRequestLink": "<string>",
      "messageToUser": "<string>",
      "todos": [
        {
          "content": "<string>",
          "id": "<string>"
        }
      ],
      "createdAt": "2023-11-07T05:31:56Z"
    }
  ]
}

用法

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

响应

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

授权

Authorization
string
header
必填

Authorization 请求头需要使用 Bearer token。请在此处创建一个 Admin API Key(管理员 API 密钥)

路径参数

projectId
string
必填

项目 ID。可在控制台的 API keys 页面中复制获取。

响应

200 - application/json

已成功检索到所有代理作业

allSessions
object[]

该 domain 的所有代理会话数组。