列出会话线程
curl --request GET \
--url https://api.aisa.one/apis/v1/agentmail/threads \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aisa.one/apis/v1/agentmail/threads"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.aisa.one/apis/v1/agentmail/threads', 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.aisa.one/apis/v1/agentmail/threads",
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.aisa.one/apis/v1/agentmail/threads"
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.aisa.one/apis/v1/agentmail/threads")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/agentmail/threads")
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{
"count": 123,
"threads": [
{
"inbox_id": "<string>",
"thread_id": "<string>",
"labels": [
"<string>"
],
"timestamp": "2023-11-07T05:31:56Z",
"senders": [
"<string>"
],
"recipients": [
"<string>"
],
"last_message_id": "<string>",
"message_count": 123,
"size": 123,
"updated_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"received_timestamp": "2023-11-07T05:31:56Z",
"sent_timestamp": "2023-11-07T05:31:56Z",
"subject": "<string>",
"preview": "<string>",
"attachments": [
{
"attachment_id": "<string>",
"size": 123,
"filename": "<string>",
"content_type": "<string>",
"content_disposition": "inline",
"content_id": "<string>"
}
]
}
],
"limit": 123,
"next_page_token": "<string>"
}会话线程
列出会话线程
列出账号下每一个收件箱的会话。
GET
https://api.aisa.one
/
apis
/
v1
/
agentmail
/
threads
列出会话线程
curl --request GET \
--url https://api.aisa.one/apis/v1/agentmail/threads \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aisa.one/apis/v1/agentmail/threads"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.aisa.one/apis/v1/agentmail/threads', 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.aisa.one/apis/v1/agentmail/threads",
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.aisa.one/apis/v1/agentmail/threads"
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.aisa.one/apis/v1/agentmail/threads")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/agentmail/threads")
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{
"count": 123,
"threads": [
{
"inbox_id": "<string>",
"thread_id": "<string>",
"labels": [
"<string>"
],
"timestamp": "2023-11-07T05:31:56Z",
"senders": [
"<string>"
],
"recipients": [
"<string>"
],
"last_message_id": "<string>",
"message_count": 123,
"size": 123,
"updated_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"received_timestamp": "2023-11-07T05:31:56Z",
"sent_timestamp": "2023-11-07T05:31:56Z",
"subject": "<string>",
"preview": "<string>",
"attachments": [
{
"attachment_id": "<string>",
"size": 123,
"filename": "<string>",
"content_type": "<string>",
"content_disposition": "inline",
"content_id": "<string>"
}
]
}
],
"limit": 123,
"next_page_token": "<string>"
}列出账号下每一个收件箱的会话。返回
在你的 agent 里把这个端点跑起来 →
count、limit、next_page_token 和 threads,用 next_page_token 翻页。每条含 thread_id、inbox_id、labels、timestamp、senders、recipients、subject、preview、message_count 和 last_message_id。这是账号级视图,跨越账号下的每一个收件箱。所有 AIsa 调用方共用同一个 AgentMail 账号,因此这里会触及其他调用方创建的收件箱;只针对单个收件箱时请用收件箱级的孪生工具 get_agentmail_inbox_threads。
示例
curl -X GET "https://api.aisa.one/apis/v1/agentmail/threads" \
-H "Authorization: Bearer YOUR_API_KEY"
// 把整段复制给 Claude Code、Codex、Cursor 或任意 coding agent。
// 连接、授权、跑通这个例子需要的东西都在里面 ——
// 不用粘贴任何 key,浏览器里点一次 Allow 就好。
{
"operation_id": "get_agentmail_threads",
"arguments": {},
"max_price_usd": 0.05
}
// ── for the agent ─────────────────────────────────────────────────────────
// Register the AIsa MCP server, then call its `use` tool with the JSON above.
// name aisa
// endpoint https://mcp.aisa.one/mcp
// transport streamable-http
// auth OAuth. The server publishes RFC 9728 metadata, so open a
// browser and the user clicks Allow once — nothing to paste.
// If AISA_API_KEY is set, send it as a bearer header instead.
// Use your own MCP mechanism, not a hand-edited config file:
// Codex codex mcp add aisa --url https://mcp.aisa.one/mcp
// Claude Code claude mcp add --transport http -s user aisa https://mcp.aisa.one/mcp
// Cursor / VS Code a "url" entry for https://mcp.aisa.one/mcp in the MCP config
// The server lists five tools over https://mcp.aisa.one/servers worth of APIs:
// search, get_details, use, batch_use, list_categories. search and
// get_details are free; use is billed per call and max_price_usd refuses
// anything above the cap before spending. This operation's full contract —
// every argument, the response shape, the price and the pitfalls — is at
// https://aisa.one/docs/zh/api-reference/agentmail/get_agentmail-threads.md
// Then run the call and show me the result.
第一次用? 把任意 MCP 客户端指向
https://mcp.aisa.one/mcp —— Claude Code、
Codex、Cursor、VS Code 都可以。鉴权走 OAuth:客户端打开浏览器,你点一次
Allow,不需要粘贴任何 key。各客户端的具体命令和每次调用的价格见
aisa.one/zh-cn/mcp。授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
查询参数
用于筛选此时间戳之后数据的时间戳。
按时间升序排序。
用于筛选的截止时间戳。
在结果中包含被屏蔽项。
在结果中包含垃圾邮件。
在结果中包含垃圾内容。
在结果中包含未经身份验证的内容。
用于筛选的标签。
返回项目数量的上限。
用于分页的页面 token。
Filter to threads whose recipients contain this value (substring match). Repeatable; all values must match.
Filter to threads whose senders contain this value (substring match). Repeatable; all values must match.
Filter to threads whose subject contains this value (substring match). Repeatable; all values must match.