웹훅은 새 리드와 리드의 변경 사항을 일이 일어나는 즉시 내가 정한 주소로 보냅니다. Zapier, Make 또는 내 코드로 리드를 CRM, 스프레드시트, 이메일 목록에 넣을 때 쓰세요. 웹훅은 Team 요금제에 포함됩니다.
관리자는 설정 → 웹훅에서 추가합니다.
이벤트#
lead.created: 방문자가 처음으로 정보를 남깁니다.lead.updated: 리드가 바뀝니다. 방문자가 정보를 다시 남기거나, 팀원이 수정하거나, 상태가 바뀌는 경우입니다(신규 또는 후속 조치 완료).
각 이벤트는 다음과 같은 JSON 본문을 가진 POST입니다(대화 내용은 절대 전송되지 않습니다).
{
"id": "evt_1f0c…",
"type": "lead.created",
"created": "2026-10-26T16:56:02+00:00",
"test": false,
"data": {
"lead": {
"id": 42,
"email": "riley@example.com",
"name": "Riley Chen",
"phone": "+1 555 0142",
"custom": {"planned_trip": "A week"},
"custom_labels": {"planned_trip": "Planned trip"},
"consent": {"asked": true, "given": true, "text": "Send me news and offers by email.", "answered_at": "2026-10-26T16:56:00+00:00"},
"status": "new",
"status_changed_at": null,
"page_url": "https://example.com/pricing",
"attribution": {"utm_source": "google", "utm_medium": "cpc", "utm_campaign": "fall-sale", "ref": "www.google.com"},
"created_at": "2026-10-26T16:56:00+00:00",
"updated_at": "2026-10-26T16:56:00+00:00"
},
"bot": {"id": 7, "name": "Help"},
"conversation_url": "https://tufu.ai/a/your-team/inbox/c/…/",
"team": {"slug": "your-team", "name": "Your team"}
}
}
Zapier에서 쓰기#
- Zapier에서 트리거가 Webhooks by Zapier → Catch Hook인 Zap을 만들고, 그 주소를 복사하세요.
- tufu에서 설정 → 웹훅 → 웹훅 추가를 누르고 주소를 붙여 넣은 다음 방문자가 정보를 남김은 그대로 두세요.
- 테스트 보내기를 누르세요. Zapier가 샘플 리드를 받으므로, 다음 단계에서 필드(
lead.email,lead.name등)를 연결할 수 있습니다. HubSpot, Mailchimp, Google Sheets 등 Zapier가 연결하는 어떤 서비스로도 보낼 수 있습니다.
Make에서 쓰기#
- Make에서 Webhooks → Custom webhook으로 시나리오를 시작하고, 그 주소를 복사하세요.
- tufu에 같은 방식으로 추가한 뒤 테스트 보내기를 누르세요. Make가 샘플에서 필드를 학습합니다.
- 그다음 처리를 맡을 모듈을 추가하세요.
tufu에서 온 요청인지 확인하기#
각 웹훅의 서명 시크릿은 추가할 때(또는 새 시크릿을 눌렀을 때) 한 번만 표시됩니다. 모든 요청에는 Tufu-Signature 헤더가 있습니다: t=<unix time>,v1=<signature>. 서명은 <unix time>.<the
raw body>의 HMAC-SHA256이며, 시크릿을 키로 씁니다. 본문을 파싱하기 전에 원본 본문으로 확인하고, 시계와 5분 넘게 차이 나는 시간은 거부하세요.
import hashlib, hmac, time
def from_tufu(secret: str, header: str, body: bytes) -> bool:
parts = dict(item.split("=", 1) for item in header.split(","))
timestamp = int(parts["t"])
if abs(time.time() - timestamp) > 300:
return False
expected = hmac.new(secret.encode(), f"{timestamp}.".encode() + body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, parts["v1"])
const crypto = require("crypto");
function fromTufu(secret, header, rawBody) {
const parts = Object.fromEntries(header.split(",").map((item) => item.split("=")));
const timestamp = Number(parts.t);
if (Math.abs(Date.now() / 1000 - timestamp) > 300) return false;
const expected = crypto.createHmac("sha256", secret).update(`${timestamp}.${rawBody}`).digest("hex");
return crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1 || ""));
}
id는 한 이벤트를 재시도할 때마다 같으므로, 이미 처리한 이벤트는 건너뛸 수 있습니다.
주소가 응답하지 않을 때#
tufu는 10초 안에 2xx 응답을 기대합니다. 그렇지 않으면 다시 시도합니다. 약 2시간 30분에 걸쳐 모두 5번 시도합니다. 각 시도는 웹훅 카드에 응답이나 오류와 함께 표시됩니다. 15번 연속으로 실패하면 tufu가 웹훅을 일시 중지하고 팀 관리자에게 이메일을 보냅니다. 주소가 다시 작동하면 재개를 누르세요. 공개 인터넷의 https 주소만 허용됩니다.