创建导入任务
curl --request POST \
--url https://revor.ai/api/v2/imports \
--header 'Content-Type: application/json' \
--data '
{
"input_mode": "<string>",
"file_name": "<string>",
"content_type": "<string>",
"size_bytes": 123,
"locale": "<string>",
"entity_type": "<string>",
"name": "<string>",
"webset_id": "<string>",
"records": [
{}
]
}
'import requests
url = "https://revor.ai/api/v2/imports"
payload = {
"input_mode": "<string>",
"file_name": "<string>",
"content_type": "<string>",
"size_bytes": 123,
"locale": "<string>",
"entity_type": "<string>",
"name": "<string>",
"webset_id": "<string>",
"records": [{}]
}
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({
input_mode: '<string>',
file_name: '<string>',
content_type: '<string>',
size_bytes: 123,
locale: '<string>',
entity_type: '<string>',
name: '<string>',
webset_id: '<string>',
records: [{}]
})
};
fetch('https://revor.ai/api/v2/imports', 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/imports",
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([
'input_mode' => '<string>',
'file_name' => '<string>',
'content_type' => '<string>',
'size_bytes' => 123,
'locale' => '<string>',
'entity_type' => '<string>',
'name' => '<string>',
'webset_id' => '<string>',
'records' => [
[
]
]
]),
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/imports"
payload := strings.NewReader("{\n \"input_mode\": \"<string>\",\n \"file_name\": \"<string>\",\n \"content_type\": \"<string>\",\n \"size_bytes\": 123,\n \"locale\": \"<string>\",\n \"entity_type\": \"<string>\",\n \"name\": \"<string>\",\n \"webset_id\": \"<string>\",\n \"records\": [\n {}\n ]\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/imports")
.header("Content-Type", "application/json")
.body("{\n \"input_mode\": \"<string>\",\n \"file_name\": \"<string>\",\n \"content_type\": \"<string>\",\n \"size_bytes\": 123,\n \"locale\": \"<string>\",\n \"entity_type\": \"<string>\",\n \"name\": \"<string>\",\n \"webset_id\": \"<string>\",\n \"records\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://revor.ai/api/v2/imports")
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 \"input_mode\": \"<string>\",\n \"file_name\": \"<string>\",\n \"content_type\": \"<string>\",\n \"size_bytes\": 123,\n \"locale\": \"<string>\",\n \"entity_type\": \"<string>\",\n \"name\": \"<string>\",\n \"webset_id\": \"<string>\",\n \"records\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body表格导入
创建导入任务
直接导入结构化数据或申请文件上传,返回导入任务对象与上传地址。
POST
/
api
/
v2
/
imports
创建导入任务
curl --request POST \
--url https://revor.ai/api/v2/imports \
--header 'Content-Type: application/json' \
--data '
{
"input_mode": "<string>",
"file_name": "<string>",
"content_type": "<string>",
"size_bytes": 123,
"locale": "<string>",
"entity_type": "<string>",
"name": "<string>",
"webset_id": "<string>",
"records": [
{}
]
}
'import requests
url = "https://revor.ai/api/v2/imports"
payload = {
"input_mode": "<string>",
"file_name": "<string>",
"content_type": "<string>",
"size_bytes": 123,
"locale": "<string>",
"entity_type": "<string>",
"name": "<string>",
"webset_id": "<string>",
"records": [{}]
}
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({
input_mode: '<string>',
file_name: '<string>',
content_type: '<string>',
size_bytes: 123,
locale: '<string>',
entity_type: '<string>',
name: '<string>',
webset_id: '<string>',
records: [{}]
})
};
fetch('https://revor.ai/api/v2/imports', 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/imports",
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([
'input_mode' => '<string>',
'file_name' => '<string>',
'content_type' => '<string>',
'size_bytes' => 123,
'locale' => '<string>',
'entity_type' => '<string>',
'name' => '<string>',
'webset_id' => '<string>',
'records' => [
[
]
]
]),
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/imports"
payload := strings.NewReader("{\n \"input_mode\": \"<string>\",\n \"file_name\": \"<string>\",\n \"content_type\": \"<string>\",\n \"size_bytes\": 123,\n \"locale\": \"<string>\",\n \"entity_type\": \"<string>\",\n \"name\": \"<string>\",\n \"webset_id\": \"<string>\",\n \"records\": [\n {}\n ]\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/imports")
.header("Content-Type", "application/json")
.body("{\n \"input_mode\": \"<string>\",\n \"file_name\": \"<string>\",\n \"content_type\": \"<string>\",\n \"size_bytes\": 123,\n \"locale\": \"<string>\",\n \"entity_type\": \"<string>\",\n \"name\": \"<string>\",\n \"webset_id\": \"<string>\",\n \"records\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://revor.ai/api/v2/imports")
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 \"input_mode\": \"<string>\",\n \"file_name\": \"<string>\",\n \"content_type\": \"<string>\",\n \"size_bytes\": 123,\n \"locale\": \"<string>\",\n \"entity_type\": \"<string>\",\n \"name\": \"<string>\",\n \"webset_id\": \"<string>\",\n \"records\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body创建导入任务,支持直接传输结构化数据(
校验或写入失败会整批回滚。
响应
records 模式)或申请文件上传(file 模式)。直接传输数据时无需后续上传和 complete 步骤。
接口概览
| 方法 | POST |
| 路径 | /api/v2/imports |
| 权限 | prospects.imports:write |
| 幂等性 | 通过 Idempotency-Key 请求头实现 |
| 返回 | 导入任务对象,含账单与行数统计 |
请求体
文件上传模式
input_mode 为 "file" 时提供以下字段:
返回:
id- 导入任务 IDwebset_id- 目标表格 IDupload_url- 签名上传地址method- 上传 HTTP 方法(通常为PUT)expires_in- 地址过期秒数
直接传输数据模式
input_mode 为 "records" 时提供以下字段:
企业字段
每行企业至少提供名称或官网。namewebsitedescriptionexternal_idemailphonelinkedin_url
人物及联系人字段
每行人物至少提供姓名或一条联系渠道。企业下嵌套联系人使用同一套字段。full_namefirst_namelast_nametitlelocationemailphonewhatsapplinkedin_url
渠道值使用字符串数组,每种渠道最多 10 个;格式无效会拒绝整批。
请求示例
cURL
curl -X POST "https://revor.ai/api/v2/imports" \
-H "Authorization: Bearer sk-revor-REPLACE_ME" \
-H "Idempotency-Key: import-001" \
-H "Content-Type: application/json" \
-d '{
"input_mode": "records",
"entity_type": "company",
"name": "工业供应商",
"locale": "zh",
"records": [
{
"external_id": "supplier-001",
"company": {
"name": "Example",
"website": "https://example.com"
},
"contacts": [
{
"full_name": "Alex",
"title": "Sales",
"email": ["alex@example.com"]
}
]
}
]
}'
限制与行为
- 单批最多 5,000 行
- 单批最多 2 MiB UTF-8 JSON
- 单批最多 10,000 个嵌套联系人
- 每行最多 500 个联系人
- 每个嵌套联系人至少提供一种联系渠道
- 较大数据按批追加到同一个
webset_id - 每批使用独立幂等键
- 同批重试保留原幂等键
计费
每批按实际新增实体数扣积分:ceil(inserted_rows / 100),即每新增 100 条收 1 积分,不足 100 条按 1 积分;零新增不收费。
- 重复行免费
- 合并已有实体免费
- 补充已有实体的联系人免费
- 原幂等键重试不重复收费
billing_run_id 和 charged_credits。余额不足返回 HTTP 402,错误码 prospect_import_insufficient_credits,数据和积分一起回滚;充值后可用原键和原请求重试。REST 与 MCP 计费规则相同。
去重与合并
按以下优先级合并,优先级从高到低:- 显式
item_id external_id- 企业官网域名
- 人物邮箱或 LinkedIn URL
错误码
| 错误码 | 含义 |
|---|---|
prospect_import_identity_conflict | 多个身份指向不同记录 |
prospect_import_target_busy | 目标表格仍在导入中 |
prospect_import_insufficient_credits | 余额不足(HTTP 402) |
响应
200
{
"item": {
"id": "import-uuid",
"webset_id": "webset-uuid",
"source_kind": "records",
"status": "completed",
"received_rows": 1,
"inserted_rows": 1,
"merged_rows": 0,
"added_contacts": 1,
"added_channels": 1,
"items_revision": 1,
"billing_run_id": "billing-uuid",
"charged_credits": 1
}
}
item 包含:
id- 导入任务 IDwebset_id- 目标表格 IDsource_kind-"records"status-"completed"received_rows- 接收行数inserted_rows- 新增行数merged_rows- 合并行数added_contacts- 新增联系人数added_channels- 新增渠道数items_revision
revor_import_prospects,在工具参数中提供 idempotency_key。
超时不代表任务失败。超时后用原幂等键和原始请求重试,不要换键重复建表。

