预览智能体消息
curl --request POST \
--url https://revor.ai/api/v2/agents/preview \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "<string>",
"channel": "<string>",
"locale": "<string>",
"lead": {},
"lead_cursor": "<string>",
"research_enabled": true,
"config": {}
}
'import requests
url = "https://revor.ai/api/v2/agents/preview"
payload = {
"agent_id": "<string>",
"channel": "<string>",
"locale": "<string>",
"lead": {},
"lead_cursor": "<string>",
"research_enabled": True,
"config": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
agent_id: '<string>',
channel: '<string>',
locale: '<string>',
lead: {},
lead_cursor: '<string>',
research_enabled: true,
config: {}
})
};
fetch('https://revor.ai/api/v2/agents/preview', 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://revor.ai/api/v2/agents/preview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agent_id' => '<string>',
'channel' => '<string>',
'locale' => '<string>',
'lead' => [
],
'lead_cursor' => '<string>',
'research_enabled' => true,
'config' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://revor.ai/api/v2/agents/preview"
payload := strings.NewReader("{\n \"agent_id\": \"<string>\",\n \"channel\": \"<string>\",\n \"locale\": \"<string>\",\n \"lead\": {},\n \"lead_cursor\": \"<string>\",\n \"research_enabled\": true,\n \"config\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://revor.ai/api/v2/agents/preview")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"<string>\",\n \"channel\": \"<string>\",\n \"locale\": \"<string>\",\n \"lead\": {},\n \"lead_cursor\": \"<string>\",\n \"research_enabled\": true,\n \"config\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://revor.ai/api/v2/agents/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_id\": \"<string>\",\n \"channel\": \"<string>\",\n \"locale\": \"<string>\",\n \"lead\": {},\n \"lead_cursor\": \"<string>\",\n \"research_enabled\": true,\n \"config\": {}\n}"
response = http.request(request)
puts response.read_body智能体
预览智能体消息
基于智能体配置生成单条预览消息,返回公共任务。
POST
/
api
/
v2
/
agents
/
preview
预览智能体消息
curl --request POST \
--url https://revor.ai/api/v2/agents/preview \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "<string>",
"channel": "<string>",
"locale": "<string>",
"lead": {},
"lead_cursor": "<string>",
"research_enabled": true,
"config": {}
}
'import requests
url = "https://revor.ai/api/v2/agents/preview"
payload = {
"agent_id": "<string>",
"channel": "<string>",
"locale": "<string>",
"lead": {},
"lead_cursor": "<string>",
"research_enabled": True,
"config": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
agent_id: '<string>',
channel: '<string>',
locale: '<string>',
lead: {},
lead_cursor: '<string>',
research_enabled: true,
config: {}
})
};
fetch('https://revor.ai/api/v2/agents/preview', 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://revor.ai/api/v2/agents/preview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agent_id' => '<string>',
'channel' => '<string>',
'locale' => '<string>',
'lead' => [
],
'lead_cursor' => '<string>',
'research_enabled' => true,
'config' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://revor.ai/api/v2/agents/preview"
payload := strings.NewReader("{\n \"agent_id\": \"<string>\",\n \"channel\": \"<string>\",\n \"locale\": \"<string>\",\n \"lead\": {},\n \"lead_cursor\": \"<string>\",\n \"research_enabled\": true,\n \"config\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://revor.ai/api/v2/agents/preview")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"<string>\",\n \"channel\": \"<string>\",\n \"locale\": \"<string>\",\n \"lead\": {},\n \"lead_cursor\": \"<string>\",\n \"research_enabled\": true,\n \"config\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://revor.ai/api/v2/agents/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_id\": \"<string>\",\n \"channel\": \"<string>\",\n \"locale\": \"<string>\",\n \"lead\": {},\n \"lead_cursor\": \"<string>\",\n \"research_enabled\": true,\n \"config\": {}\n}"
response = http.request(request)
puts response.read_body在发送前基于智能体配置预览单条消息。付费生成,返回公共 job,通过
异步归属校验、额度不足和生成失败见任务 error。
GET /api/v2/jobs/{id} 查询结果。
接口概览
| 方法 | POST |
| 路径 | /api/v2/agents/preview |
| 权限 | agents:write |
| 幂等性 | 需要 Idempotency-Key |
| 限流桶 | expensive_create |
| 返回 | 公共 job,通过 GET /api/v2/jobs/{id} 查询 |
cURL
curl -X POST "https://revor.ai/api/v2/agents/preview" \
-H "Authorization: Bearer sk-revor-REPLACE_ME" \
-H "Idempotency-Key: agent-preview-001" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "agent-uuid",
"channel": "email",
"locale": "zh",
"lead": {
"name": "Alice",
"title": "Purchasing Manager",
"company": "Example Manufacturing"
},
"research_enabled": true,
"config": {
"send_language": "en"
}
}'
请求体
{
"agent_id": "智能体 UUID",
"channel": "email",
"locale": "zh",
"lead": {
"name": "Alice",
"title": "Purchasing Manager",
"company": "Example Manufacturing"
},
"research_enabled": true,
"config": {
"send_language": "en"
}
}
请求参数
可选的临时覆盖字段,仅本次请求生效。
显示 所有支持的覆盖字段
显示 所有支持的覆盖字段
active_system_promptactive_goal_promptactive_reference_templatereference_template_strictextra_contextsender_namesender_titlesender_companysender_company_websitesender_company_summarysender_biosend_languagestyle_tagscontent_generation_modecontent_inputgoal_type
响应
202
{
"ok": true,
"request_id": "req_xxx",
"item": {
"id": "job-uuid",
"status": "queued",
"type": "agent_preview"
}
}
返回结果
成功的item.result 包含:
agent_idchannelmessagesresearch_run_idagent_version
item.billing 返回计费结果。邮件消息保留 subject 和 text。
仅首次执行前允许取消,开始后包括等待重试时均不可取消。
行为说明
- 智能体和 cursor 均校验归属。
- 普通生成消费一次普通智能触达额度。
- 调研生成消费一次研究触达额度,已包含调研和写信,不叠扣普通额度。
- Meta WhatsApp 模板使用原模板结果,消费普通额度。
- 明确失败退回预扣额度。
- 账务不确定时保留批次待恢复,不重复生成或盲目退款。
预览不会发布智能体、发送消息,也不会改变生成版本。
错误码
| HTTP | 错误码 | 含义 |
|---|---|---|
400 | external_api_preview_input_invalid | 参数错误 |
403 | permission_denied | 缺少对应权限 |
MCP 工具
revor_preview_agent_message
