从官网创建智能体
curl --request POST \
--url https://revor.ai/api/v2/agents/from-website \
--header 'Content-Type: application/json' \
--data '
{
"company_website": "<string>",
"mode": "<string>",
"locale": "<string>",
"name": "<string>"
}
'import requests
url = "https://revor.ai/api/v2/agents/from-website"
payload = {
"company_website": "<string>",
"mode": "<string>",
"locale": "<string>",
"name": "<string>"
}
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({
company_website: '<string>',
mode: '<string>',
locale: '<string>',
name: '<string>'
})
};
fetch('https://revor.ai/api/v2/agents/from-website', 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/from-website",
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([
'company_website' => '<string>',
'mode' => '<string>',
'locale' => '<string>',
'name' => '<string>'
]),
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/from-website"
payload := strings.NewReader("{\n \"company_website\": \"<string>\",\n \"mode\": \"<string>\",\n \"locale\": \"<string>\",\n \"name\": \"<string>\"\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/from-website")
.header("Content-Type", "application/json")
.body("{\n \"company_website\": \"<string>\",\n \"mode\": \"<string>\",\n \"locale\": \"<string>\",\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://revor.ai/api/v2/agents/from-website")
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 \"company_website\": \"<string>\",\n \"mode\": \"<string>\",\n \"locale\": \"<string>\",\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body智能体
从官网创建智能体
通过公司网站创建草稿智能体,返回异步公共任务。
POST
/
api
/
v2
/
agents
/
from-website
从官网创建智能体
curl --request POST \
--url https://revor.ai/api/v2/agents/from-website \
--header 'Content-Type: application/json' \
--data '
{
"company_website": "<string>",
"mode": "<string>",
"locale": "<string>",
"name": "<string>"
}
'import requests
url = "https://revor.ai/api/v2/agents/from-website"
payload = {
"company_website": "<string>",
"mode": "<string>",
"locale": "<string>",
"name": "<string>"
}
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({
company_website: '<string>',
mode: '<string>',
locale: '<string>',
name: '<string>'
})
};
fetch('https://revor.ai/api/v2/agents/from-website', 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/from-website",
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([
'company_website' => '<string>',
'mode' => '<string>',
'locale' => '<string>',
'name' => '<string>'
]),
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/from-website"
payload := strings.NewReader("{\n \"company_website\": \"<string>\",\n \"mode\": \"<string>\",\n \"locale\": \"<string>\",\n \"name\": \"<string>\"\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/from-website")
.header("Content-Type", "application/json")
.body("{\n \"company_website\": \"<string>\",\n \"mode\": \"<string>\",\n \"locale\": \"<string>\",\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://revor.ai/api/v2/agents/from-website")
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 \"company_website\": \"<string>\",\n \"mode\": \"<string>\",\n \"locale\": \"<string>\",\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body通过公司网站创建草稿智能体。返回公共 job,通过
GET /api/v2/jobs/{id} 查询结果。
接口概览
| 方法 | POST |
| 路径 | /api/v2/agents/from-website |
| 权限 | agents:write |
| 幂等性 | 需要 Idempotency-Key |
| 返回 | 公共 job |
cURL
curl -X POST "https://revor.ai/api/v2/agents/from-website" \
-H "Authorization: Bearer sk-revor-REPLACE_ME" \
-H "Idempotency-Key: agent-from-website-001" \
-H "Content-Type: application/json" \
-d '{
"company_website": "example.com",
"mode": "icebreaker",
"locale": "zh",
"name": "示例触达智能体"
}'
请求体
{
"company_website": "example.com",
"mode": "icebreaker",
"locale": "zh",
"name": "示例触达智能体"
}
请求参数
响应
202
{
"ok": true,
"request_id": "req_xxx",
"item": {
"id": "job-uuid",
"status": "queued",
"type": "agent_from_website"
}
}
行为说明
- 返回
202和公共 job;用GET /api/v2/jobs/{id}查询,成功结果含item.id。 - 两种模式均创建
draft,不自动绑定账号或发布。 - 触达模式(
icebreaker)使用现有 V2 配置,客服模式(autoreply)沿用 V1。 - 重试同一请求使用原幂等键,改参数使用新键。
错误码
| HTTP | 错误码 | 含义 |
|---|---|---|
400 | agent_input_invalid | 公共参数不符合契约 |
403 | permission_denied | 缺少对应权限 |
409 | idempotency_conflict | 同一个幂等键用于不同请求 |

