你的产品能得到什么
所有渠道的会话、历史、回复和附件,统一成一种数据结构。
所有已连接渠道的对话汇成一个分页列表,可按渠道和账号筛选。
只发一次。房客从哪个渠道来,消息就发回哪个渠道,并记录在会话里。
每条新的房客消息、房东在渠道自家 App 里发出的每条回复,都会触发 webhook,收件箱永远不会对不上。
工作原理
列出会话,读取一个,回复。订阅消息事件,新消息一到就能显示。
房东通过 Repull Connect 连接 Airbnb、Booking.com 或 Vrbo。他们的 PMS 连接保持不变。
GET /v1/conversations 返回所有会话;messages 接口返回会话历史。
POST 一条消息即可回复;处理 reservation.message.received,让收件箱保持实时。
const api = (path: string, init?: RequestInit) =>
fetch(`https://api.repull.dev${path}`, {
...init,
headers: {
Authorization: `Bearer ${process.env.REPULL_API_KEY}`,
'Content-Type': 'application/json',
},
}).then(r => r.json())
// Every thread, from every channel, in one list
const { data: threads } = await api('/v1/conversations?limit=50')
// One thread's history, oldest first
const { data: messages } = await api(`/v1/conversations/${threads[0].id}/messages?order=asc`)
// Reply — it goes out on the channel the guest wrote from
await api(`/v1/conversations/${threads[0].id}/messages`, {
method: 'POST',
body: JSON.stringify({ message: 'Hi Alex, check-in is from 4pm.' }),
})// POST /webhooks/repull — subscribed to reservation.message.received
export async function POST(req: Request) {
const event = await req.json() // verify X-Repull-Signature first
if (event.event === 'reservation.message.received') {
const { threadId, channel, senderName, body } = event.data
await inbox.push({ threadId, channel, from: senderName, body })
}
return new Response(null, { status: 200 })
}渠道覆盖
覆盖范围以线上 API 实际为准。 完整的渠道与 PMS 覆盖范围
与任意 PMS 并行使用
在 Airbnb 和 Vrbo 上,Repull 以消息级权限连接。房东的 PMS 继续管理房源和日历,你的产品永远不会和它抢控制权。
测试版(beta):读取 Booking.com 的订单、消息和评价,房东不用把连接服务商从 PMS 换走。
无论房客在 Airbnb、Booking.com 还是 Vrbo 上预订,接口和 webhook 事件都一样。只需开发一次。
背后的 API
GET /v1/conversations跨渠道的全部会话,游标分页。
GET /v1/conversations/{id}/messages会话历史,可按最新或最早排序。
POST /v1/conversations/{id}/messages在房客所在渠道回复,支持幂等键。
POST /v1/conversations/{id}/pre-approval预先批准咨询:Vrbo,或拥有完全访问权限的 Airbnb。
reservation.message.receivedWebhook:房客发来一条消息。
reservation.message.sentWebhook:房东已回复,包括从渠道自家 App 发出的回复。