Skip to main content
GET
/
v1
/
agent
/
{projectId}
/
jobs
获取所有代理任务(v1)
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>"
        }
      ],
      "userId": "<string>",
      "title": "<string>",
      "createdAt": "2023-11-07T05:31:56Z"
    }
  ]
}
此端点已废弃。请改用 v2 获取代理任务 端点。

用法

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

响应

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

Authorizations

Authorization
string
header
required

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

Path Parameters

projectId
string
required

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

Query Parameters

skip
integer
default:0

用于分页的跳过结果数。

Required range: x >= 0
take
integer
default:12

返回的结果数量。最大 100。

Required range: 1 <= x <= 100

Response

200 - application/json

已成功检索所有代理任务

allSessions
object[]

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