Skip to main content

개요

에이전트 단위 웹훅은 에이전트별 통화 이벤트를 수신합니다. 적용 우선순위는 웹훅 개요를 참고하세요.

지원되는 이벤트

이벤트설명
call_started통화 시작 시 트리거
call_ended통화 종료 시 트리거
mid_call통화 중 특정 이벤트 발생 시 트리거
이벤트 타입 및 페이로드는 제품 업데이트에 따라 확장될 수 있습니다.

활용 사례

시스템 통합

  • 통화 완료 시 CRM 레코드 업데이트
  • 통화 분석 결과 기반 워크플로우 자동화 실행
  • 데이터베이스에 통화 기록 저장

통화 모니터링

  • 통화 시간과 완료 상태 추적
  • 상담원 실시간 성과 모니터링
  • 실시간 플로우 전환 추적 및 분석

실시간 이벤트 처리

  • 플로우 에이전트 노드 전환 시 실시간 알림

설정

1

웹훅 엔드포인트 구현

웹훅 요청을 수신할 HTTP/HTTPS 엔드포인트를 준비하세요.
from fastapi import FastAPI, Request
from fastapi.responses import JSONResponse

app = FastAPI()

@app.post("/webhook")
async def handle_webhook(request: Request):
    try:
        data = await request.json()
        event = data.get("event")

        if event == "call_ended":
            print("통화 종료 이벤트:", data.get("call"))
        else:
            print("이벤트:", event)

        return JSONResponse(status_code=200, content={"received": True})
    except Exception:
        return JSONResponse(status_code=500)
2

에이전트별 웹훅 등록

대시보드 에이전트 설정 > 웹훅 탭에서 통화 데이터 웹훅 URL을 입력하세요.

웹훅 페이로드 예시

{
  "event": "call_started",
  "call": {
    "agent_id": "7ea3516d-08f6-4129-ab40-a731e379b320",
    "call_id": "3079f46c-d141-4cd9-805f-69f212136b66",
    "call_type": "web",
    "call_from": null,
    "call_to": null,
    "dynamic_variables": {
      "last_call_at": "2024-12-18T15:45:12Z"
    },
    "metadata": {
      "db_user_uid": "1a7d624b-76fe-4326-90dc-487935e55212"
    },
    "start_timestamp": 1741842354957,
    "opt_out_sensitive_data_storage": false
  }
}
민감 데이터 저장 금지를 활성화하면 주요 통화 정보가 저장되지 않습니다. 데이터를 지속적으로 활용하려면 웹훅으로 수집하여 별도 저장하세요.

관련 문서


에이전트 웹훅, agent webhook, call_started, call_ended, mid_call, 페이로드, 통화 이벤트