본문으로 건너뛰기

개발자용

Telofia를 이미 쓰고 있는 시스템과 연결하세요

REST API로 통화, 녹취록, 예약, 연락처를 조회하고, 이벤트가 발생하는 즉시 서명된 웹훅을 받아 보세요. 통화 중에 어시스턴트가 시스템의 실시간 데이터를 확인하게 할 수 있고, 코드 한 줄로 웹사이트에 음성 어시스턴트를 추가할 수 있습니다.

REST API와 웹훅은 Line부터 모든 요금제에 포함되며, 상위 요금제일수록 한도가 높아집니다. 무료 체험 기간에는 테스트용으로 API 키 1개, 분당 20회 요청까지 사용할 수 있습니다.

API 기본 URL
https://telofia.com/api/v1
curl · 키 테스트
curl https://telofia.com/api/v1/me \
  -H "Authorization: Bearer tf_live_…"
200 OK
{
  "object": "account",
  "id": "1f2e3d4c-5b6a-4789-8a7b-6c5d4e3f2a1b",
  "name": "Smile Dental",
  "timezone": "Europe/Warsaw",
  "locale": "en",
  "country": "PL",
  "currency": "PLN",
  "status": "active",
  "plan": {
    "id": "team",
    "billing_cycle": "month",
    "trial_ends_at": null,
    "period_start": "2026-10-01T00:00:00Z",
    "period_end": "2026-11-01T00:00:00Z",
    "recording_history_days": 365
  },
  "minutes": {
    "included": 3000,
    "extra": 100,
    "total": 3100,
    "used": 412.5,
    "remaining": 2687.5
  },
  "api_key_id": "2a3b4c5d-6e7f-4a8b-9c0d-1e2f3a4b5c6d",
  "scopes": [
    "read:calls",
    "read:appointments",
    "read:contacts",
    "read:tasks"
  ],
  "limits": {
    "plan": "team",
    "requests_per_minute": 180,
    "requests_per_day": 50000,
    "max_api_keys": 10,
    "max_webhook_endpoints": 10
  }
}

연결할 수 있는 항목

Telofia를 비즈니스에 연결하는 7가지 방법

노코드 자동화, 간단한 코드 몇 줄, 완전한 양방향 연동 중 상황에 맞는 방법을 선택하세요.

빠른 시작

2분이면 첫 요청을 보낼 수 있습니다

  1. 1

    API 키 만들기

    대시보드에서 개발자 → API 키로 이동해 키 이름을 정하고 권한 범위를 선택하세요. 키(tf_live_…)는 한 번만 표시되므로 시크릿 관리자에 바로 저장해 두세요.

  2. 2

    연결 테스트

    GET /me를 호출하세요. 유효한 키라면 모두 사용할 수 있으며, 계정 정보, 키의 권한 범위, 요금제 한도를 반환합니다.

  3. 3

    데이터 조회 또는 이벤트 구독

    통화, 예약, 연락처 목록을 조회하거나, 개발자 → 웹훅에서 웹훅 엔드포인트를 추가해 이벤트를 실시간으로 받아 보세요.

curl · 키 테스트
curl https://telofia.com/api/v1/me \
  -H "Authorization: Bearer tf_live_…"
JavaScript: 예약이 완료된 모든 통화를 페이지별로 조회
const API = "https://telofia.com/api/v1";
const headers = { Authorization: `Bearer ${process.env.TELOFIA_API_KEY}` };

// All calls booked since 1 October, page by page
let cursor = null;
while (true) {
  const url = new URL(`${API}/calls`);
  url.searchParams.set("outcome", "booked");
  url.searchParams.set("since", "2026-10-01T00:00:00Z");
  url.searchParams.set("limit", "100");
  if (cursor) url.searchParams.set("cursor", cursor);

  const res = await fetch(url, { headers });
  if (res.status === 429) {
    // rate limited: wait for the number of seconds in Retry-After, then retry the same page
    await new Promise((r) => setTimeout(r, Number(res.headers.get("Retry-After") ?? 1) * 1000));
    continue;
  }
  if (!res.ok) throw new Error((await res.json()).error.message);

  const page = await res.json();
  for (const call of page.data) console.log(call.started_at, call.from, call.summary);
  if (!page.has_more) break;
  cursor = page.next_cursor;
}

REST API v1

HTTPS로 통화, 예약, 연락처 이용

요청과 응답 모두 JSON입니다. 모든 요청은 API 키로 인증되며 요금제에 따라 한도가 적용됩니다. 요청 내역은 대시보드에 기록됩니다(메서드, 경로, 상태, 시간만 기록하며 요청·응답 본문은 저장하지 않습니다).

인증

API 키 메뉴에서 키를 만들고 Bearer 토큰으로 전송하세요. 키는 tf_live_로 시작하며 하나의 계정에 속합니다.

Authorization: Bearer tf_live_…

페이지 이동

목록 엔드포인트는 일정한 순서로 최대 limit개(1–100, 기본값 25)의 항목을 반환합니다. has_more가 true이면 next_cursor를 변경하지 말고 cursor로 전달하세요(필터는 동일하게 유지). 올바르지 않은 커서는 400 invalid_request를 반환합니다.

오류

오류는 표준 HTTP 상태 코드와 함께 오류 유형 및 읽기 쉬운 메시지가 담긴 JSON 본문으로 반환됩니다.

{ "error": { "type": "…", "message": "…" } }

엔드포인트

  • GET/me권한 범위: 모든 키

    현재 계정 조회

    API 키가 속한 계정을 반환합니다. “연결 테스트” 호출로 사용하기 좋습니다.

  • GET/assistants권한 범위: 모든 키

    어시스턴트 목록

    언어, 상태, 할당된 전화번호가 포함된 어시스턴트 목록입니다. 통화를 필터링할 때 ID를 assistant_id로 사용하세요.

  • GET/assistants/{id}권한 범위: 모든 키

    어시스턴트 조회

    언어, 상태, 전화번호가 포함된 어시스턴트 한 개입니다. read:assistants(또는 write:assistants) 권한 범위가 있으면 프롬프트(instructions, greeting, company_profile, updated_at)도 반환합니다.

  • PATCH/assistants/{id}권한 범위: write:assistants

    어시스턴트 프롬프트 수정

    지침, 인사말 또는 회사 프로필을 변경합니다. 생략한 필드는 그대로 유지됩니다. 한도는 대시보드와 동일합니다. 지침은 최대 40,000자, 회사 프로필은 최대 10,000자, 인사말은 5–600자이며 발신자가 AI와 통화 중임을 알려야 합니다(그렇지 않으면 코드 ai_disclosure와 함께 400 반환). 모든 변경은 어시스턴트의 버전 기록(출처 API)에 저장되며 다음 통화부터 적용됩니다. 플랫폼의 투명성 규칙(AI 고지, 녹음 안내)은 지침과 관계없이 항상 적용됩니다.

  • GET/phone-numbers권한 범위: 모든 키

    전화번호 목록

    계정의 전화번호와 국가, 유형, 상태, 해당 번호를 받는 어시스턴트를 반환합니다.

  • GET/calls권한 범위: read:calls

    통화 목록

    최신 통화부터 녹취록 없이 반환합니다. 데모 통화는 포함되지 않습니다.

  • GET/calls/{id}권한 범위: read:calls

    통화 조회

    통화 한 건과 전체 녹취록, 통화 중 등록된 예약을 반환합니다.

  • GET/calls/{id}/recording권한 범위: read:calls

    통화 녹음 조회

    통화 MP3 녹음을 재생하고 다운로드할 수 있는 서명된 링크입니다(1시간 유효, 스테레오: 왼쪽은 발신자, 오른쪽은 어시스턴트). 요금제의 녹음 보관 기간보다 오래된 녹음은 recording_history_days와 함께 403 plan_required를 반환하며, 녹음이 없는 통화는 404를 반환합니다.

  • GET/appointments권한 범위: read:appointments

    예약 목록

    시작 시간 순으로 예정된 예약을 반환합니다(기본값은 현재 시점부터).

  • GET/appointments/{id}권한 범위: read:appointments

    예약 조회

    계정의 예약 한 건입니다.

  • POST/appointments/{id}/cancel권한 범위: write:appointments

    예약 취소

    예정된 예약을 취소하고 연결된 Google 캘린더에서 삭제한 후 appointment.canceled 웹훅을 전송합니다. calendar_sync는 캘린더가 업데이트되었는지 알려 줍니다.

  • POST/appointments/{id}/reschedule권한 범위: write:appointments

    예약 변경

    예정된 예약을 새로운 시간으로 옮깁니다. 해당 시간이 다른 예약이나 연결된 캘린더의 일정과 겹치면 409로 실패합니다. ends_at을 생략하면 기존 길이가 유지됩니다. appointment.rescheduled 웹훅을 전송합니다.

  • GET/contacts권한 범위: read:contacts

    연락처 목록

    전화를 건 사람들을 최신순으로 보여 줍니다. 어시스턴트는 통화가 바뀌어도 이들을 기억합니다.

  • GET/contacts/{id}권한 범위: read:contacts

    연락처 조회

    이름, 이메일, 태그, 메모와 이름 및 이메일의 출처(call, system 또는 manual)가 포함된 연락처 한 건입니다.

  • POST/contacts권한 범위: write:contacts

    연락처 생성

    CRM 등에서 연락처를 추가하여 어시스턴트가 발신자의 이름을 알 수 있게 합니다. API로 저장한 이름과 이메일은 manual로 표시되며 어시스턴트가 덮어쓰지 않습니다. 전화번호가 이미 있으면 contact_id와 함께 409를 반환합니다. contact.created 웹훅을 전송합니다.

  • PATCH/contacts/{id}권한 범위: write:contacts

    연락처 수정

    이름, 이메일, 메모 또는 차단 여부를 변경합니다. 생략한 필드는 그대로 유지되며 null은 해당 필드를 비웁니다. 변경된 이름이나 이메일은 manual로 표시되어 어시스턴트가 덮어쓰지 않습니다. 전화번호는 변경할 수 없습니다.

  • GET/tasks권한 범위: read:tasks

    작업 목록

    통화에서 생성된 콜백 요청, 메시지 및 기타 작업을 최신순으로 보여 줍니다.

  • GET/tasks/{id}권한 범위: read:tasks

    작업 조회

    계정의 작업 한 건입니다.

  • PATCH/tasks/{id}권한 범위: write:tasks

    작업 수정

    팀에서 고객에게 다시 전화한 후 등, 작업 상태를 open, done 또는 dismissed로 설정합니다.

  • POST/conversions권한 범위: write:calls

    구매 보고

    쇼핑몰, CRM 또는 자동화(예: n8n을 통한 WooCommerce 주문 웹훅)가 고객의 구매를 보고합니다. 귀속 기준은 call_id 또는 phone(최근 14일 이내 해당 번호와의 가장 최근 대화)입니다. 매칭된 구매는 “구매”로 매출에 반영되고, 해당 통화의 결과는 purchase(“판매”)가 됩니다. 같은 order_id는 한 번만 기록됩니다.

  • POST/calls/outbound권한 범위: write:calls

    발신 통화 생성

    어시스턴트가 지정한 목표에 따라 비즈니스 번호로 한 사람에게 전화를 겁니다. 온보딩 시퀀스의 한 단계처럼 사용할 수 있습니다. 통화는 즉시 또는 call_at에 발신되며 항상 통화 가능 시간(월–토, 계정 시간대 기준 9:00–20:00) 내에 이루어집니다. 이 시간 밖이면 다음 가능한 시간으로 이동하며 call_at에 그 시간이 표시됩니다. 받지 않으면 2시간 간격으로 최대 3번 시도합니다. scheduled 상태의 통화와 함께 202를 반환합니다. 오류: 400 consent_missing, invalid_phone, number_not_callable, international 또는 invalid_call_at; 409 opted_out(수신자가 전화를 원하지 않음), already_scheduled(existing_id 포함), assistant_not_live, over_quota 또는 no_outbound_number; 429 daily_outbound_limit(limit 포함, 기본값은 24시간당 200건). 결과는 external_id와 함께 call.completed 및 outbound_call.finished 웹훅으로 전달됩니다.

  • GET/calls/outbound/{id}권한 범위: write:calls

    발신 통화 조회

    예약된 발신 통화의 상태입니다. scheduled, dialing, done(대화의 call_id 포함), failed(last_error 포함, 예: 모든 시도 후 no_answer) 또는 canceled입니다. 온보딩 및 콜백 통화의 경우 웹훅의 callback_id로도 조회할 수 있습니다.

  • DELETE/calls/outbound/{id}권한 범위: write:calls

    발신 통화 취소

    API로 생성했으며 아직 예약 상태인 발신 통화를 취소합니다. 반복해서 호출해도 안전합니다(이미 취소된 경우 200 반환). 통화가 발신 중이거나 종료되었거나 온보딩 통화인 경우 409 not_cancelable을 반환합니다(온보딩 통화는 POST /api/outreach/unenroll로 대상자를 제외하세요).

  • GET/messages권한 범위: read:messages

    SMS 목록

    계정에서 보낸 SMS와 고객의 답장을 최신순으로 보여 줍니다. phone은 고객의 번호입니다(수신자 또는 답장 발신자). generated_by: template, ai 또는 manual; charged_from: plan 또는 credits.

  • POST/messages권한 범위: write:messages

    SMS 보내기

    연락처 또는 발신자에게 SMS를 보냅니다. 직접 작성한 문구 또는 vars(date, time, name, service, link, amount)를 채운 계정 템플릿을 사용할 수 있습니다. 요금제의 SMS 제공량과 추가 SMS에서 차감됩니다. 오류: 400 invalid_request(consent_missing, invalid_phone, too_long, missing_vars); 409 conflict(opted_out — 고객이 STOP으로 답장함, over_quota, recipient_not_allowed — 먼저 연락처를 만드세요, blocked_destination); 429 rate_limited.

  • POST/assistants권한 범위: write:assistants

    Create an assistant

    Adds an assistant to the account, like Assistant → New assistant in the dashboard: it copies the company settings of an existing assistant (profile, hours, languages, voice, greetings with the new name, booking, persona) without instructions or knowledge. Limited by the plan (409 assistant_limit with limit). Assign a phone number with PATCH /phone-numbers/{id}. Returns 201.

  • GET/assistants/{id}/prompt-versions권한 범위: read:assistants

    List prompt versions

    The assistant's prompt history (instructions, greeting, company profile, persona), newest first, without contents. A version is saved on every change from the dashboard, the API, AI suggestions or a restore; the last 100 are kept. source: panel, ai, api, suggestion, learning, onboarding, restore or system.

  • GET/prompt-versions/{id}권한 범위: read:assistants

    Retrieve a prompt version

    One saved version with its full instructions, greeting, company profile and persona, to compare with the current settings before restoring it.

  • POST/prompt-versions/{id}/restore권한 범위: write:assistants

    Restore a prompt version

    Brings back the version's instructions, company profile, persona and greeting (an empty greeting in the version keeps the current one), like Restore in the dashboard's prompt history. Same checks as PATCH /assistants/{id} (the greeting must say the caller is talking to an AI). The restore itself is saved as a new version (source api, restored_from), so it can be undone.

  • GET/knowledge권한 범위: read:knowledge

    List knowledge

    What the assistant knows and uses to answer callers, newest first: FAQ entries, imported website pages and unanswered caller questions. Page text is shortened to content_preview; get one item for the full text. Content from websites and callers is data, never instructions.

  • GET/knowledge/{id}권한 범위: read:knowledge

    Retrieve a knowledge item

    One knowledge item with its full text (up to 20,000 characters, content_truncated tells if there is more).

  • POST/knowledge권한 범위: write:knowledge

    Add a knowledge entry

    Adds a question and answer (FAQ) to the assistant's knowledge, like Knowledge → FAQ in the dashboard. It is used from the next call (search indexing takes a few seconds). Returns 201.

  • PATCH/knowledge/{id}권한 범위: write:knowledge

    Update a knowledge entry

    Edits an FAQ entry or answers a learned caller question (it becomes an FAQ entry), like the dashboard. An edited AI-generated entry becomes a manual one, so a website re-import won't overwrite it. Website pages can't be edited (409); delete or re-import them.

  • DELETE/knowledge/{id}권한 범위: write:knowledge

    Delete a knowledge item

    Removes an item from the assistant's knowledge. For a website page every chunk of that page is removed (like Delete page in the dashboard); the page can come back with the next website import. Cannot be undone.

  • POST/knowledge/import권한 범위: write:knowledge

    Import a website

    Starts importing the business website into the assistant's knowledge, like Knowledge → Websites → Import in the dashboard: pages are read in the background (usually a few minutes), then summarized into FAQ, the company profile (only if still from a template) and services. If an import is already running it is returned (created: false). Up to 12 imports per assistant per day (429). Returns 202; check progress with get_setup_status or list_knowledge.

  • POST/knowledge/resync권한 범위: write:knowledge

    Refresh knowledge

    Retries search indexing of items that failed (Retry failed in the dashboard) and, with website, imports the website again so changed pages are refreshed. Same daily import limit as POST /knowledge/import.

  • GET/notices권한 범위: read:settings

    List notices and days off

    The business's announcements and closed days (dashboard → Notices & days off): active first, then upcoming, then past. Closed days block booking; current notices are mentioned to callers. status uses the account's time zone.

  • POST/notices권한 범위: write:settings

    Create a notice or day off

    Adds an announcement or closed days for all of the account's assistants; it applies from the next call. Up to 40 per account (409 limit). Returns 201.

  • DELETE/notices/{id}권한 범위: write:settings

    Delete a notice

    Removes an announcement or days off; the assistant stops using it from the next call.

  • GET/voices권한 범위: 모든 키

    List voices

    The voice catalog the assistant can use, like the voice picker in the dashboard: name, gender, character, languages and a preview recording. Use id as voice_id in PATCH /assistants/{id}.

  • GET/setup-status권한 범위: read:settings

    Get setup status

    A launch checklist built from the account's real settings: plan, the assistant's readiness to go live (company, name, voice, language, AI greeting, instructions or profile), live status, phone number, whether real inbound calls arrive (forwarding works), calendar for booking, knowledge, website import, transfer rules and the last Launch Check. Each item has status ok, missing, warning or info, whether it is required to answer calls, and how to fix it.

  • GET/website-agent권한 범위: read:settings

    Get the website agent

    The AI agent on the business's website, like dashboard → Widget: the chat/voice widget (enabled, allowed domains, greeting, look, public key and the install snippet to paste before </body>) and page actions (the assistant reads the page, navigates, points at and clicks elements, fills forms and adds to the cart; allowed says whether the plan includes them), with links to the dashboard, the live demo and the paid setup service. The widget settings are created with defaults on first use.

  • PATCH/website-agent권한 범위: write:settings

    Update the website agent

    Changes the website agent like saving dashboard → Widget: send only what changes. Domains are normalized (a full URL becomes its domain); enabling the widget without a domain returns 400 domains_required; enabling page actions outside the plan returns 403 plan_required (page_actions_unavailable). The public key and the look stay in the dashboard. Changes apply to new widget conversations. Returns the updated settings.

  • PATCH/phone-numbers/{id}권한 범위: write:settings

    Route a phone number to an assistant

    Chooses which of the account's assistants answers calls to one of its numbers and/or sets the number's name (label, e.g. the clinic or location it belongs to); send at least one of the two. It applies from the next call: when one assistant answers several numbers or the number has a name, the assistant is told which number the caller dialled (e.g. to book at that location). Changing the assistant works only on numbers already assigned to the account (status assigned); getting or porting numbers is done in the dashboard.

권한

모든 키는 생성 시 선택한 권한 범위를 가집니다. 권한 범위는 나중에 변경할 수 없으므로 더 필요하면 새 키를 만드세요. 키에 필요한 권한 범위가 없으면 엔드포인트는 403 insufficient_scope로 응답합니다. GET /me, /assistants, /phone-numbers는 유효한 키라면 모두 사용할 수 있습니다.

  • read:calls통화, 요약, 대화 기록 읽기
  • read:appointments예약 읽기
  • write:appointments예약 취소 및 일정 변경
  • read:contacts연락처 읽기
  • write:contacts연락처 생성 및 수정
  • read:tasks작업 및 콜백 요청 읽기
  • write:tasks작업 상태 변경
  • write:calls발신 통화 시작, 확인 및 취소
  • read:messagesSMS 메시지와 고객 답장 읽기
  • write:messages연락처로 SMS 보내기
  • read:assistants어시스턴트의 전체 설정, 프롬프트 기록, 음성 읽기
  • write:assistants어시스턴트 설정 변경, 어시스턴트 생성, 프롬프트 버전 복원
  • read:knowledge어시스턴트의 지식(FAQ, 웹사이트 페이지) 읽기
  • write:knowledge지식 추가, 수정, 삭제 및 웹사이트 가져오기
  • read:settings공지, 휴무일, 설정 체크리스트, 웹사이트 에이전트 설정 읽기
  • write:settings공지 및 휴무일 관리, 전화번호를 어시스턴트에 연결, 웹사이트 에이전트 설정

오류

  • 400invalid_request — 매개변수가 없거나 올바르지 않습니다
  • 401unauthorized — API 키가 없거나, 올바르지 않거나, 폐기되었습니다
  • 403insufficient_scope — 키에 해당 엔드포인트의 권한 범위가 없습니다. plan_required — 계정에 활성 요금제가 없거나, 녹음이 요금제의 녹음 보관 기간보다 오래되었습니다
  • 404not_found — 계정에 해당 객체가 없습니다
  • 409conflict — 해당 시간이 이미 사용 중이거나, 예약을 변경할 수 없거나, 이 전화번호의 연락처가 이미 있거나, 발신 통화를 걸 수 없습니다(code: opted_out, already_scheduled, assistant_not_live, over_quota, no_outbound_number, not_cancelable)
  • 429rate_limited — 요청이 너무 많습니다. Retry-After 헤더에 표시된 시간 이후에 다시 시도하세요
  • 500server_error — 당사 측에서 문제가 발생했습니다
  • 503service_unavailable — 일시적인 문제입니다. Retry-After 헤더에 표시된 시간 이후에 다시 시도하세요

매개변수와 응답 예시가 포함된 전체 API 레퍼런스는 대시보드의 개발자 → API 레퍼런스에서 확인할 수 있습니다.

웹훅

서버로 실시간 전송되는 이벤트

대시보드에서 https 엔드포인트를 추가하고 이벤트를 선택하면, 이벤트가 발생하는 즉시 서명된 JSON 봉투를 POST로 보내 드립니다. “테스트 전송”은 첫 번째 이벤트의 샘플을 보내 주므로 Zapier나 Make에서 필드를 매핑할 때 편리합니다.

이벤트

  • call.completed통화 완료

    요약, 결과, 감정, 통화 녹취록, 연락처, 예약 정보가 포함됩니다. 발신 통화는 시퀀스 또는 API 요청(callback_id, external_id, outreach)도 포함됩니다.

  • call.started통화 시작

    통화가 연결되었습니다(수신, 발신 또는 웹).

  • appointment.booked예약 완료

    어시스턴트가 예약을 등록했습니다.

  • appointment.canceled예약 취소됨

    전화 또는 API를 통해 예약이 취소되었습니다.

  • appointment.rescheduled예약 변경됨

    예약이 새로운 시간으로 변경되었습니다(이전 시간 포함).

  • task.created콜백/작업 생성됨

    발신자가 콜백을 요청했거나 작업을 남겼습니다.

  • contact.created새 연락처

    처음 전화한 발신자가 연락처로 저장되었습니다.

  • outbound_call.finished발신 통화 종료

    예약된 발신 통화(API, 온보딩 시퀀스 또는 콜백)가 완료되었거나 실패했습니다. 모든 시도 후에도 받지 않은 경우도 포함됩니다.

모든 전송에 포함되는 헤더

  • Telofia-Signature서명: t=<unix 시간>,v1=<HMAC-SHA256 hex>
  • Telofia-Event이벤트 유형 (예: appointment.booked)
  • Telofia-Delivery고유 전송 ID
  • User-AgentTelofia-Webhooks/1.0 · 웹훅 발신자 식별

전송 및 재시도

  • 10초 이내에 임의의 2xx 상태 코드로 응답하세요. 리디렉션은 따르지 않습니다.
  • 전송에 실패하면 1분, 5분, 30분, 2시간, 6시간, 12시간 후에 재시도합니다(총 7회 시도, 약 21시간).
  • 같은 이벤트가 두 번 이상 도착할 수 있습니다. 이벤트 id로 중복을 걸러 내세요.
  • 공개 https 주소만 사용할 수 있습니다. 연속 50회 실패하면 엔드포인트가 일시 중지되고, 대시보드에 그 이유가 표시됩니다.
  • 대시보드에서 상태 코드와 응답이 담긴 전송 로그를 확인하고, 전송을 수동으로 다시 시도할 수 있습니다.
전송 예시: call.completed
{
  "id": "evt_3f9a1c7e5b2d4f6a8c0e1b3d5f7a9c1e",
  "type": "call.completed",
  "created_at": "2026-10-01T09:17:45Z",
  "account_id": "1f2e3d4c-5b6a-4789-8a7b-6c5d4e3f2a1b",
  "data": {
    "id": "5b1f0c6e-2a8d-4f3e-9d51-7c0a4e2b9f10",
    "object": "call",
    "assistant_id": "0e6f4c8a-3b2d-4a1e-8f7c-5d9b2a1c3e4f",
    "phone_number_id": "4d3c2b1a-0f9e-4d8c-b7a6-958473625140",
    "contact_id": "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
    "direction": "inbound",
    "status": "completed",
    "from": "+48601234567",
    "to": "+48221234567",
    "started_at": "2026-10-01T09:14:03Z",
    "ended_at": "2026-10-01T09:17:41Z",
    "duration_sec": 218,
    "summary": "Anna Kowalska booked a first consultation for Friday 10:00.",
    "outcome": "booked",
    "sentiment": "positive",
    "tags": [
      "new-customer"
    ],
    "has_recording": true,
    "end_reason": "caller_hangup",
    "page_url": null,
    "page_title": null,
    "continued_from": null,
    "intake": [
      {
        "key": "address",
        "label": "Adres",
        "value": "ul. Lipowa 5, Katowice"
      }
    ],
    "callback_id": null,
    "external_id": null,
    "outreach": null,
    "callback_return": false,
    "caller_spoke": true,
    "caller_words": 6,
    "transcript": [
      {
        "role": "caller",
        "text": "I'd like to book a consultation this week.",
        "at": 4.1
      }
    ],
    "contact": {
      "id": "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
      "object": "contact",
      "phone": "+48601234567",
      "name": "Anna Kowalska",
      "name_source": "call",
      "email": "anna.kowalska@example.com",
      "email_source": "call",
      "notes": null,
      "tags": [
        "customer"
      ],
      "blocked": false,
      "calls_count": 3,
      "last_call_at": "2026-10-01T09:14:03Z",
      "created_at": "2026-08-12T15:02:11Z"
    },
    "appointments": [
      {
        "id": "c3d2e1f0-a9b8-4c7d-8e6f-5a4b3c2d1e0f",
        "object": "appointment",
        "call_id": "5b1f0c6e-2a8d-4f3e-9d51-7c0a4e2b9f10",
        "contact_id": "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
        "customer_name": "Anna Kowalska",
        "customer_phone": "+48601234567",
        "customer_email": "anna.kowalska@example.com",
        "service": "First consultation",
        "starts_at": "2026-10-03T08:00:00Z",
        "ends_at": "2026-10-03T08:30:00Z",
        "status": "booked",
        "external_id": "google:7h3k9s2l1m0n",
        "notes": "Allergic to nuts",
        "arrival_window_start": null,
        "arrival_window_end": null,
        "arrival_window_label": null,
        "created_at": "2026-10-01T09:16:20Z"
      }
    ]
  }
}

서명 검증. 모든 전송에는 t=timestamp,v1=signature 형식의 Telofia-Signature 헤더가 포함됩니다. 서명 시크릿으로 “timestamp.raw_body”의 HMAC-SHA256을 계산하여 v1과 비교하세요. 5분보다 오래된 타임스탬프는 거부하세요.

Node.js · 서명 검증
import crypto from "node:crypto";

// Express: app.post("/webhook", express.raw({ type: "application/json" }), handler)
export function verify(rawBody, signatureHeader, secret) {
  // Telofia-Signature: t=1727774265,v1=5f2c…
  const parts = Object.fromEntries(signatureHeader.split(",").map((p) => p.split("=")));
  const expected = crypto.createHmac("sha256", secret).update(`${parts.t}.${rawBody}`).digest("hex");
  const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) < 300;
  const given = Buffer.from(parts.v1 ?? "");
  // timingSafeEqual needs buffers of the same length
  return fresh && given.length === expected.length && crypto.timingSafeEqual(Buffer.from(expected), given);
}
Python · 서명 검증
import hmac, hashlib, time

def verify(raw_body: bytes, signature_header: str, secret: str) -> bool:
    parts = dict(p.split("=", 1) for p in signature_header.split(","))
    expected = hmac.new(secret.encode(), f"{parts['t']}.".encode() + raw_body, hashlib.sha256).hexdigest()
    fresh = abs(time.time() - int(parts["t"])) < 300
    return fresh and hmac.compare_digest(expected, parts.get("v1", ""))
수신기 예시 (Express)
import express from "express";
import { verify } from "./verify.js";

const app = express();
const seen = new Set(); // use your database in production

app.post("/telofia/webhook", express.raw({ type: "application/json" }), (req, res) => {
  const raw = req.body.toString("utf8");
  if (!verify(raw, req.get("Telofia-Signature") ?? "", process.env.TELOFIA_WEBHOOK_SECRET)) return res.sendStatus(401);

  const event = JSON.parse(raw);
  if (seen.has(event.id)) return res.sendStatus(200); // retried delivery, already handled
  seen.add(event.id);

  if (event.type === "appointment.booked") {
    const a = event.data;
    console.log("New booking:", a.customer_name, a.service, a.starts_at);
  }
  res.sendStatus(200); // answer with 2xx within 10 seconds
});

app.listen(3000);

고정 값

통화(API 및 call.* 웹훅)와 발신 통화(outbound_call.finished, /calls/outbound)의 이 값들은 변경되지 않는 규약입니다. 새 값은 추가될 수 있지만 기존 값은 변경하거나 삭제하지 않습니다. 받지 않았거나, 통화 중이거나, 거절된 발신 시도는 통화로 생성되지 않으므로 call.completed가 발생하지 않습니다. 마지막 시도 후 last_error가 no_answer인 outbound_call.finished를 받게 됩니다. 음성 사서함이 받은 통화는 응답된 것으로 간주됩니다(보통 결과가 other인 짧은 통화).

통화 상태

in_progress
통화가 진행 중입니다.
completed
상대방이 어시스턴트와 대화했습니다.
missed
아무도 말하지 않았거나 어시스턴트가 통화를 받을 수 없었습니다(end_reason 참조).
failed
오류로 인해 통화를 처리하지 못했습니다.

통화 결과

booked
예약이 등록되었습니다.
transferred
통화가 상담원에게 연결되었습니다.
message
메시지, 콜백 요청, 주문 또는 후속 조치가 접수되었습니다.
info
상대방이 정보를 받았으며 추가 조치는 필요하지 않았습니다.
spam
스팸, 텔레마케팅 또는 차단된 번호입니다.
other
그 외의 경우입니다(예: 매우 짧은 통화 또는 음성 사서함).
order
대화에서 주문이 기록되었습니다(예: 쇼핑몰 장바구니). 구매는 아직 확정되지 않았습니다. “order” 작업을 기준으로 데이터베이스에서 설정됩니다.
purchase
확정된 판매입니다. 고객이 대화 후 구매했거나(쇼핑몰 웹사이트 구매, POST /v1/conversions) 통화에서 안내된 결제를 완료했습니다. 통화 후 며칠이 지나 구매가 이루어져도 다른 결과보다 우선합니다.

통화 종료 사유(end_reason)

caller_hangup
상대방이 전화를 끊었습니다.
caller_hangup_greeting
발신 통화: 상대방이 한마디도 하지 않고 인사말 도중 또는 직후에 전화를 끊었습니다(45초 이하의 통화). 이 경우 caller_spoke는 false입니다.
agent_hangup
어시스턴트가 작별 인사 후 통화를 종료했습니다.
transferred
통화가 상담원에게 연결되었습니다.
silence
긴 침묵 후 종료되었습니다.
max_duration
최대 통화 시간에 도달했습니다.
spam
스팸으로 종료되었습니다.
blocked
연락처에서 차단된 번호입니다.
busy
계정의 모든 회선이 통화 중이었습니다.
over_quota
남은 통화 시간이 없습니다.
trial_expired
무료 체험이 종료되었습니다.
inactive
활성 요금제가 없습니다.
assistant_not_live
어시스턴트가 일시 중지되었습니다.
no_assistant
이 번호를 받는 어시스턴트가 없습니다.
ai_budget
일시적인 한도로 인해 AI 없이 처리되었으며, 팀에 콜백 요청이 전달되었습니다.
error
기술적 오류로 통화가 종료되었습니다.

발신 통화 상태

scheduled
예정된 시간(또는 다음 시도)을 기다리고 있습니다.
dialing
지금 전화를 거는 중입니다.
done
응답됨, call_id는 해당 대화를 가리킵니다.
failed
모든 시도 후에도 받지 않았거나 통화를 걸 수 없었습니다(last_error 참조).
canceled
취소됨(API, 시퀀스에서 대상자 제외 또는 시퀀스 해제).

발신 통화 last_error

no_answer
아무도 받지 않았습니다(통화 중이거나 거절된 경우 포함).
failed
통화 시점에 어시스턴트를 사용할 수 없었습니다(요금제, 통화 시간 또는 일시 중지).
no_result
15분 이내에 통화 결과가 없습니다.
expired
통화가 2시간 이상 지연되어 걸지 않았습니다.
outside_window
다음 통화 가능 시간으로 이동되었습니다(상태는 scheduled로 유지).
dial_error
통신망이 통화를 거부했습니다(dial_<reason> 형식으로 전송).
over_quota
남은 통화 시간이 없습니다.
inactive
활성 요금제가 없습니다.
assistant_not_live
어시스턴트가 일시 중지되었습니다.
no_outbound_number
발신에 사용할 비즈니스 번호가 없습니다.
canceled_by_api
DELETE /calls/outbound/{id}로 취소되었습니다.
unenrolled
시퀀스에서 대상자가 제외되었습니다(POST /api/outreach/unenroll).
opt_out
수신자가 전화를 원하지 않는다고 요청했습니다.
replaced
같은 번호로 더 최근의 콜백이 생성되어 대체되었습니다.
voicemail
통화가 음성 사서함으로 연결되었으며, 이 단계는 최소 3일 후에 재시도됩니다.
greeting_hangup
상대방이 아무 말 없이 인사말 도중 전화를 끊었으며, 이 단계는 재시도됩니다.

MCP를 통한 실시간 데이터

통화 중 어시스턴트가 시스템의 정보를 직접 조회합니다

쇼핑몰 카탈로그, 재고, 예약 또는 주문 시스템 같은 원격 MCP 서버(Model Context Protocol)를 연결하세요. 어시스턴트가 사용할 수 있는 읽기 전용 도구와 리소스는 직접 정할 수 있습니다.

미리 학습

가격표, 상품 설명, 정책처럼 자주 바뀌지 않는 콘텐츠에 적합합니다. 선택한 리소스와 읽기 전용 도구가 1~168시간마다 또는 원할 때 어시스턴트의 지식으로 가져와집니다. 통화 중 지연이 없습니다.

통화 중 실시간 확인

재고, 예약 가능 여부, 주문 상태처럼 수시로 바뀌는 정보에 적합합니다. 어시스턴트가 “잠시만요, 확인해 볼게요”라고 안내한 뒤 통화 중에 도구를 호출합니다. 서버가 약 2.5초 안에 응답하지 않으면 지금은 확인할 수 없다고 안내하고 담당 팀의 후속 연락을 제안합니다.

필요한 것

  • https로 접근 가능한 MCP 서버(Streamable HTTP, 예: https://mcp.example.com/mcp). 이전 방식의 HTTP+SSE 서버는 자동으로 감지됩니다.
  • 인증: 없음, Bearer 토큰 또는 X-API-Key 같은 사용자 지정 헤더. 시크릿은 암호화(AES-256-GCM)되며 브라우저로 전송되지 않습니다.
  • 읽기 전용 도구. 파괴적 도구로 표시된 도구는 차단되며, 읽기 전용으로 표시되지 않은 도구는 데이터를 읽기만 한다는 점을 직접 확인해 주셔야 합니다.
  • 어시스턴트당 최대 소스 5개와 실시간 도구 50개까지 연결할 수 있습니다. 실시간 조회는 약 2초 이내에 응답해야 합니다.
  • 웹사이트 위젯용 선택 사항: “통화 시작 시” 도구에서 로그인한 방문자의 신원 토큰을 받을 인수를 선택하세요(웹사이트 음성 위젯 참조).

도구 인수는 도구의 스키마에 따라 검증되고, 결과는 줄여서 데이터로만 처리되며(지시로는 절대 처리되지 않음), 모든 조회는 발신자 정보 없이 기록됩니다. 사설 및 내부 주소는 거부됩니다.

AI 에이전트용 MCP 서버

AI 에이전트가 Telofia에 접근하도록 설정하세요

Telofia는 원격 MCP 서버(Model Context Protocol)를 제공합니다. Claude, ChatGPT, Cursor 또는 자체 에이전트를 연결하면 통화, 녹취록, 예약, 연락처, 작업을 조회할 수 있고, 허용하신 경우 연락처 추가, 아웃바운드 통화 시작, SMS 발송도 할 수 있습니다.

  • 엔드포인트: https://telofia.com/api/mcp (Streamable HTTP, JSON-RPC 2.0, 무상태).
  • 인증: REST API와 동일한 API 키(Authorization: Bearer tf_live_…) 또는 client credentials 방식으로 발급한 유효 시간 1시간의 OAuth 액세스 토큰. 인증이 없으면 서버가 OAuth 메타데이터 안내와 함께 401을 반환합니다.
  • 에이전트에는 키의 권한 범위에서 허용된 도구만 표시되며, 모든 호출에는 REST API와 동일한 검사, 속도 제한, 요청 로그가 적용됩니다.
  • 아웃바운드 통화와 SMS는 API와 마찬가지로 consent: true가 필요합니다. 도구 결과는 발신자가 보낸 데이터일 뿐, 지시로 처리되지 않습니다.

에이전트용 OAuth

https://telofia.com/api/oauth/token에서 API 키를 단기 액세스 토큰으로 교환하세요. client_id는 키 id(GET /me의 api_key_id) 또는 그 접두사이고, client_secret은 키 자체입니다. 부여되는 권한 범위는 요청한 범위 중 키에 있는 범위입니다. 대시보드에서 키를 폐기하면 해당 키로 발급된 모든 토큰이 종료됩니다.

에이전트가 직접 접근을 요청할 수도 있습니다. POST https://telofia.com/api/agent-auth/register가 코드를 반환하면 계정 소유자가 대시보드에서 승인(AI 에이전트 승인)하고, 에이전트는 자신의 API 키를 한 번 받습니다. 승인 전에는 어떤 권한도 부여되지 않습니다. 자세한 내용은 auth.md를 참조하세요.

도구

  • get_account모든 키
  • list_assistants모든 키
  • list_phone_numbers모든 키
  • list_callsread:calls
  • get_callread:calls
  • list_contactsread:contacts
  • get_contactread:contacts
  • create_contactwrite:contacts
  • list_appointmentsread:appointments
  • get_appointmentread:appointments
  • list_tasksread:tasks
  • list_messagesread:messages
  • start_outbound_callwrite:calls
  • get_outbound_callwrite:calls
  • send_messagewrite:messages
  • get_setup_statusread:settings
  • get_assistantread:assistants or write:assistants
  • list_voicesread:assistants or write:assistants
  • update_assistantwrite:assistants
  • create_assistantwrite:assistants
  • list_prompt_versionsread:assistants
  • get_prompt_versionread:assistants
  • restore_prompt_versionwrite:assistants
  • list_knowledgeread:knowledge
  • get_knowledge_itemread:knowledge
  • add_knowledge_textwrite:knowledge
  • update_knowledge_itemwrite:knowledge
  • add_knowledge_urlwrite:knowledge
  • delete_knowledge_itemwrite:knowledge
  • resync_knowledgewrite:knowledge
  • list_noticesread:settings
  • create_noticewrite:settings
  • delete_noticewrite:settings
  • get_website_agentread:settings
  • update_website_agentwrite:settings
  • assign_phone_numberwrite:settings

디스커버리 문서

curl · 연결: initialize
curl https://telofia.com/api/mcp \
  -H "Authorization: Bearer tf_live_…" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"my-agent","version":"1.0"}}}'
curl · 액세스 토큰: client credentials
curl https://telofia.com/api/oauth/token \
  -u "<api_key_id>:tf_live_…" \
  -d grant_type=client_credentials \
  -d scope="read:calls read:contacts"

웹사이트 음성 위젯

코드 한 줄로 웹사이트에 어시스턴트를 추가하세요

방문자가 버튼을 클릭하면 전화를 받는 어시스턴트와 같은 어시스턴트와 브라우저에서 바로 대화할 수 있습니다. 웹 통화는 요금제 포함 시간을 사용하며 통신 비용이 들지 않습니다.

Office부터

  • 약 21KB, 의존성 없음, Shadow DOM으로 격리되어 사이트 스타일의 영향을 받지 않습니다.
  • 페이지의 언어(<html lang>) 또는 data-lang="de"로 지정한 언어로 말합니다.
  • 실시간 자막을 제공하며, 마이크가 차단된 경우 방문자가 입력하면 어시스턴트가 음성으로 답합니다.
  • 위젯을 소유한 도메인으로 제한하면 해당 사이트에서만 실행됩니다.
삽입 코드 (키는 대시보드에서 확인)
<script src="https://telofia.com/widget.js" data-key="tfw_…" async></script>
JavaScript API
// optional: open the widget from your own button
document.querySelector("#talk-to-us").addEventListener("click", () => window.TelofiaWidget?.open());
// open and start right away: { mode: "voice" } or { mode: "chat" } (text only, no microphone)
window.TelofiaWidget?.open({ mode: "chat" });

window.TelofiaWidget?.close();   // close the panel
window.TelofiaWidget?.destroy(); // remove the widget from the page

엄격한 Content Security Policy를 사용 중인가요? script-src https://telofia.com https://cdn.jsdelivr.net, connect-src https://telofia.com wss://*.livekit.cloud https://*.livekit.cloud, media-src blob:를 허용하세요.

로그인한 사용자 (신원 토큰)

방문자가 사이트에 로그인한 상태라면 어시스턴트가 이메일을 묻지 않고도 누구와 대화 중인지 알 수 있습니다.

  • 서버에서 로그인한 사용자에게 유효 시간이 짧은 서명 토큰을 발급하세요(예: HMAC, 15분 유효). 이메일 주소나 사용자 ID를 브라우저에 그대로 넣지 마세요. 누구나 콘솔에서 다른 사람의 값을 입력할 수 있습니다.
  • TelofiaWidget.identify({ token })을 언제든 호출할 수 있으며, 이후 호출은 토큰을 교체하고 identify(null)은 토큰을 지웁니다. widget.js가 로드되기 전에는 window.TelofiaIdentity = { token, expires_at }를 설정하세요. 대화가 시작될 때 읽히며, 만료된 토큰은 건너뜁니다.
  • 대시보드에서 조회형, 실행형, “통화 시작 시” 도구 등 실시간 MCP 도구의 신원 토큰 인수를 선택하세요. Telofia는 토큰을 그 인수에만 그대로 전달하며, 저장하거나 표시하지 않고 녹취록, 요약, 웹훅, 로그에도 남기지 않습니다. 어시스턴트도 토큰을 볼 수 없습니다.
  • 8~400자: 영문자, 숫자, . _ ~ + / = - 사용 가능(예: base64url). 만료 전에 갱신하세요(예: 10분마다). 토큰은 MCP 서버에서 검증하며, 잘못되었거나 만료된 토큰은 토큰이 없을 때와 같은 결과를 반환해야 합니다. 전화 통화와 토큰이 없는 대화는 기존과 동일하게 동작합니다.
신원 토큰
// signed-in user: a short-lived, signed token issued by YOUR server (never an e-mail or user ID)
const { token, expires_at } = await fetch("/api/telofia-identity").then((r) => r.json());

window.TelofiaIdentity = { token, expires_at };       // read when the conversation starts, also before widget.js loads
window.TelofiaWidget?.identify({ token, expires_at }); // replaces the token at any time

// refresh before it expires (e.g. every 10 minutes); on sign-out:
window.TelofiaIdentity = null;
window.TelofiaWidget?.identify(null);

채팅 모드와 사용자 지정 버튼

버튼, 메뉴, 3D 장면 속 안내 데스크 등 원하는 인터페이스에서 음성 또는 텍스트 채팅으로 어시스턴트를 열 수 있습니다.

  • data-launcher="none"은 플로팅 버튼을 숨깁니다. 이 경우 패널은 코드에서 TelofiaWidget.open()으로만 열리고 close()로 닫힙니다. 포커스는 원래 위치(예: 게임 캔버스)로 돌아갑니다. close()는 패널만 숨기고 대화는 계속되며, TelofiaWidget.endCall() 또는 close({ end: true })로 대화를 종료합니다(위젯은 유지됩니다).
  • open({ mode: "voice" }) 또는 open({ mode: "chat" })은 패널을 열고 바로 대화를 시작합니다. data-mode="chat"은 시작 버튼의 기본 모드를 채팅으로 설정합니다.
  • 채팅 모드에서는 마이크 권한을 요청하지 않습니다. 방문자가 입력하면 어시스턴트가 텍스트로 답합니다. 같은 지식과 도구를 가진 동일한 어시스턴트입니다.
  • 위젯이 로드되기 전에도 모든 메서드를 호출할 수 있습니다. 호출은 대기열에 쌓였다가 준비되면 실행됩니다. widget.js가 로드되기 전에도 window.TelofiaWidget = { q: [["open", { mode: "chat" }]] }에 호출을 추가해 둘 수 있습니다.
사용자 지정 버튼과 채팅 모드
<!-- no floating button: the panel opens only from your code -->
<script src="https://telofia.com/widget.js" data-key="tfw_…" data-launcher="none" data-mode="chat" async></script>

<script>
  // calls made before widget.js has loaded are queued and run when it starts
  window.TelofiaWidget = window.TelofiaWidget || { q: [] };
  const telofia = (method, ...args) =>
    window.TelofiaWidget.q ? window.TelofiaWidget.q.push([method, ...args]) : window.TelofiaWidget[method](...args);

  // e.g. the reception desk in your 3D gallery
  document.querySelector("#talk").addEventListener("click", () => telofia("open", { mode: "voice" })); // asks for the microphone
  document.querySelector("#chat").addEventListener("click", () => telofia("open", { mode: "chat" }));  // text only, no microphone

  // later:
  // TelofiaWidget.close();   hide the panel (the conversation continues)
  // TelofiaWidget.isOpen();  true | false
  // TelofiaWidget.state();   { ready, open, mode, call: "idle" | "connecting" | "active", agent_state }
  // TelofiaWidget.init({ launcher: false, mode: "chat", lang: "de" }); // the same options in code
</script>

이벤트

어시스턴트가 말할 때 아바타를 움직이거나, 직접 만든 채팅 말풍선을 표시하거나, 통화를 기록하는 등 페이지에서 대화에 반응하도록 만들 수 있습니다.

  • 각 이벤트는 telofia:<name> 이름의 window CustomEvent이며, TelofiaWidget.on(name, fn) / off(name, fn)으로도 수신할 수 있습니다.
  • ready { key, assistant, available } · open · close · call_started { mode, roomName } · call_ended { reason } · agent_state { state: listening | thinking | speaking } · error { code }
  • speaking { speaking, level }: 어시스턴트 음성의 크기(0~1)로, 말하는 동안 초당 최대 20회, speaking이 바뀔 때마다 전달됩니다. 방문자가 동작 줄이기를 선호하는 경우에도 전달됩니다.
  • message { role: agent | user, text, final, id }: 도착하는 대로의 텍스트(final: false)와 완성된 텍스트(final: true)로, 직접 만든 채팅 UI에 사용합니다. tool: 아래 페이지 측 도구를 참조하세요. 한 발화 = 하나의 id: 같은 id로 여러 이벤트가 도착하며 최종 텍스트에는 final: true가 붙습니다. id를 기준으로 병합하세요.
telofia:speaking으로 아바타 애니메이션 만들기
const avatar = document.querySelector("#receptionist");

// { speaking: boolean, level: 0..1 } — up to 20 times per second while the assistant speaks
window.addEventListener("telofia:speaking", (e) => {
  avatar.classList.toggle("talking", e.detail.speaking);
  avatar.style.setProperty("--mouth", e.detail.level); // e.g. scale the mouth or a glow
  // Unity WebGL: unityInstance.SendMessage("Receptionist", "SetVoiceLevel", e.detail.level);
});

// the same events through the widget API (name with or without the "telofia:" prefix)
TelofiaWidget.on("call_started", ({ mode, roomName }) => console.log("started", mode, roomName));
TelofiaWidget.on("call_ended", ({ reason }) => console.log("ended", reason)); // user | disconnected | …
TelofiaWidget.on("agent_state", ({ state }) => console.log(state));           // listening | thinking | speaking
TelofiaWidget.on("message", ({ role, text, final }) => final && console.log(role, text)); // your own chat UI
TelofiaWidget.on("error", ({ code }) => console.warn("Telofia:", code));      // rate_limited, assistant_offline, …

페이지 컨텍스트

방문자가 어느 갤러리, 매장, 상품을 보고 있는지 어시스턴트에 알려 주면 되묻지 않고 바로 답할 수 있습니다.

  • TelofiaWidget.setContext({ … }) 또는 script 태그의 data-context='{"gallery":"POL"}'를 사용하세요. setContext(null)은 컨텍스트를 지웁니다. 대화 중에는 새 컨텍스트가 현재 페이지 주소 및 제목과 함께 즉시 어시스턴트에 전달되며(페이지 새로고침 없는 이동 후에도 동일), 대화 중이 아니라면 다음 대화부터 적용됩니다.
  • 키는 최대 20개(영문 소문자, 숫자, _ 사용, 영문자로 시작), 값은 최대 200자의 텍스트, 숫자 또는 true/false이며 전체 2000바이트를 넘을 수 없습니다. 잘못된 컨텍스트는 콘솔 경고와 함께 무시되고 이전 컨텍스트가 유지됩니다.
  • 어시스턴트의 지침에서 {{context.gallery}}, {{context.store}} 등을 사용할 수 있으며, 어시스턴트는 컨텍스트를 페이지에 대한 정보로도 인식합니다.
  • MCP 서버는 Telofia-Call-Id와 함께 Telofia-Context 헤더로 컨텍스트를 받습니다(간결한 JSON, ASCII가 아닌 문자는 \uXXXX, 최대 1000바이트이며 초과 시 들어가는 키만 남고 secret_ 키가 우선). 방문자의 브라우저가 설정하는 값이므로 신뢰할 수 없는 입력으로 취급하세요. secret_으로 시작하는 키(예: secret_session)는 MCP 서버로만 전달됩니다. 어시스턴트는 이를 볼 수 없고, 저장·기록·표시되지 않으며, 서버가 이 값을 그대로 반복하면 [secret]으로 대체됩니다.
페이지 컨텍스트
// what the visitor is looking at; used by the next conversation
TelofiaWidget.setContext({ gallery: "POL", store: "Lumi Shoes", floor: 2, logged_in: true });
TelofiaWidget.setContext(null); // clear

// or on the script tag: data-context='{"gallery":"POL"}'

// assistant instructions:
//   The visitor is in gallery {{context.gallery}}, at the store {{context.store}}.

// every live lookup on your MCP server during that conversation carries:
//   Telofia-Call-Id: 5b1f0c6e-…
//   Telofia-Context: {"gallery":"POL","store":"Lumi Shoes","floor":2,"logged_in":true}
// (non-ASCII as \uXXXX — JSON.parse restores it; set by the visitor's browser, so treat it as untrusted)

페이지 측 도구

어시스턴트가 방문자의 브라우저에서 직접 매장을 보여 주고, 상품을 열고, 장바구니를 확인하게 할 수 있습니다. 페이지에 등록한 함수로 동작합니다.

  • TelofiaWidget.registerTools([...]): 최대 10개의 도구를 등록할 수 있습니다. name(영문 소문자, 숫자, _), description(기능과 사용 시점, 최대 500자), parameters(object 유형의 JSON Schema, 최대 4000바이트)로 구성합니다. 목록은 다음 대화부터 적용됩니다.
  • 어시스턴트가 도구를 호출하면 handler(args, { waitForUser })가 실행되고(값 또는 Promise를 반환할 수 있습니다), name, args, respond(result), reject(error), waitForUser()가 포함된 telofia:tool 이벤트가 발생합니다. 가장 먼저 도착한 응답이 적용됩니다.
  • 9초 이내에 응답해 주세요. 응답이 없으면 어시스턴트는 도구가 응답하지 않았다고 인식합니다. 결제 확인처럼 방문자의 조작이 필요한 작업이라면 먼저 waitForUser()를 호출하세요. 어시스턴트가 방문자를 기다리고 있다고 안내하며, 최대 29초까지 기다릴 수 있습니다. 결과는 JSON 기준 최대 15,000바이트이며, 등록되지 않은 도구는 거부됩니다.
  • 인자는 AI 모델에서 전달됩니다. 일반 사용자 입력과 똑같이 검증하고, 방문자의 확인이 필요한 작업은 반드시 확인을 받은 뒤에 진행하세요.
페이지 측 도구
TelofiaWidget.registerTools([
  {
    name: "show_store",
    description: "Moves the visitor's view to a store in the gallery. Use it when they ask where a store is.",
    parameters: { type: "object", properties: { store_id: { type: "string" } }, required: ["store_id"] },
    // runs in the visitor's browser; the returned value (or Promise) goes back to the assistant
    handler: async ({ store_id }) => {
      await gallery.flyTo(String(store_id)); // your code — validate arguments like any user input
      return { shown: true };
    },
  },
  { name: "cart_count", description: "Number of items in the visitor's cart.", parameters: { type: "object", properties: {} } },
]);

// or answer from an event listener — the first answer wins; no answer within 9 s = "timeout"
window.addEventListener("telofia:tool", (e) => {
  const { name, args, respond, reject } = e.detail;
  if (name === "cart_count") respond({ items: cart.length });
});

한 페이지에서 여러 어시스턴트 사용

어시스턴트마다 고유한 위젯 키가 있습니다. 페이지를 새로고침하지 않고도 어시스턴트를 전환할 수 있습니다. 예를 들어 대표 안내 데스크와 매장별 어시스턴트 사이를 오갈 수 있습니다.

  • TelofiaWidget.switchTo({ key })는 현재 대화를 종료하고 위젯을 제거한 뒤, 다른 키로 위젯을 다시 시작합니다. 바로 뒤에 호출한 open()은 새 어시스턴트가 준비될 때까지 기다립니다. 컨텍스트(setContext), 도구(registerTools), 리스너(on)는 그대로 유지되므로 다시 등록할 필요가 없습니다. 다른 어시스턴트에 다른 컨텍스트(예: place)가 필요할 때만 컨텍스트를 변경하세요.
  • 이벤트 리스너, 페이지 컨텍스트, 도구는 그대로 유지되며, 키마다 대화 재개 상태가 따로 보관됩니다. 모든 키의 허용 도메인에 사용 중인 도메인을 추가하세요.
  • TelofiaWidget.destroy()는 인터페이스, 리스너, 대화, 저장된 재개 상태까지 위젯을 완전히 제거합니다.
어시스턴트 전환
const RECEPTION = "tfw_…"; // widget key of the gallery reception
const STORE = "tfw_…";     // widget key of a store's own assistant

document.querySelector("#store-desk").addEventListener("click", () => {
  TelofiaWidget.switchTo({ key: STORE }); // ends the conversation, reloads the widget with the other assistant
  TelofiaWidget.open({ mode: "voice" });  // queued until the new assistant is ready
});

TelofiaWidget.on("ready", ({ key, assistant }) => console.log("now:", assistant, key === RECEPTION ? "reception" : "store"));

TelofiaWidget.destroy(); // remove the widget completely (interface, listeners, conversation, resume state)

전화 온보딩

신규 고객에게 환영 전화를 자동으로 걸어 드려요

누군가 시스템에 가입하면 통화 시퀀스로 보내세요. 어시스턴트가 비즈니스 번호로 전화해 시작을 도와드리고, 며칠 뒤 다시 한번 안부를 확인합니다. 통화는 시퀀스의 통화 시간 안에서 발신됩니다. 기본값은 사용자의 시간대 기준 월~토 9:00~20:00이며, 원하는 요일과 시간으로 변경할 수 있습니다.

POST/api/outreach/enroll

대시보드의 시퀀스 키(tlo_…)로 인증합니다. Bearer 토큰 또는 X-Telofia-Key 헤더를 사용하세요. 시퀀스마다 고유한 키가 있습니다.

요청 본문

  • phonestring필수
    전화번호이며, E.164 형식을 권장합니다. 국내 번호는 계정에 설정된 국가 코드를 기준으로 인식합니다.
  • consenttrue필수
    반드시 true여야 합니다. 가입 양식 등을 통해 전화 연락에 동의한 경우입니다.
  • namestring선택 사항
    이름, 최대 120자.
  • emailstring선택 사항
    이메일 주소.
  • contextstring선택 사항
    이 사람에 대해 어시스턴트가 알아야 할 내용, 최대 1,000자 (예: 선택한 요금제).
  • external_idstring | number선택 사항
    사용 중인 시스템의 고객 ID (문자열 또는 숫자). 같은 ID는 한 번만 등록됩니다.
curl
curl -X POST "https://telofia.com/api/outreach/enroll" \
  -H "Authorization: Bearer tlo_…" \
  -H "Content-Type: application/json" \
  -d '{"phone":"+48601234567","name":"Anna Kowalska","email":"anna@example.com","context":"Signed up today, Start plan","external_id":"user_123","consent":true}'
201 Created
{
  "ok": true,
  "enrollment_id": "8f7e6d5c-4b3a-4c2d-9e1f-0a9b8c7d6e5f",
  "external_id": "user_123",
  "status": "active",
  "next_call_at": "2026-10-09T10:20:00Z",
  "limits": {
    "per_day": 500,
    "remaining_today": 499
  }
}

응답

  • 201: 등록되었습니다. enrollment_id, external_id, status, next_call_at(첫 통화 시각), intro_sms_at(첫 통화 전 SMS 발송 시각, 없으면 null), limits { per_day, remaining_today }
  • 200: 이미 등록되어 있습니다(동일한 external_id이거나, 해당 번호가 시퀀스에서 진행 중). duplicate: true가 함께 반환됩니다.
  • 400: invalid_request, invalid_phone 또는 consent_required
  • 401: invalid_key
  • 409: sequence_disabled, consent_missing 또는 opted_out (전화를 원하지 않는 사용자)
  • 429: limit — 시퀀스의 일일 등록 한도에 도달했습니다(24시간당 신규 500명, 본문에 limit 포함). rate_limited — 이 키로 분당 120건을 초과해 요청했습니다(Retry-After 헤더 포함).

통화 시간: 대시보드에서 시퀀스별로 요일과 7:00~21:00 사이의 시간대를 설정합니다. 아무도 받지 않으면 어시스턴트가 해당 시간 안에서 2시간 간격으로 최대 3회 다시 시도합니다.

통화 전 SMS: 대시보드에서 시퀀스에 이 기능을 켜면, 어시스턴트가 발신할 번호로 짧은 문자 메시지를 보냅니다. 기본값은 첫 통화 20분 전(5~120분)입니다. 첫 통화가 그보다 일찍 시작될 경우 SMS가 항상 먼저 발송되도록 통화 시각을 통화 시간 안에서 뒤로 조정합니다. SMS 발송이 실패해도(수신자가 STOP으로 답장했거나 SMS 제공량을 모두 사용한 경우) 통화는 중단되지 않습니다. 모든 SMS는 SMS 제공량에서 차감되며 대시보드의 SMS 메뉴에서 확인할 수 있습니다.

인사말: 대시보드에서 단계별로(또는 시퀀스 전체의 기본값으로) 통화의 첫 문장을 설정할 수 있습니다. {first_name}, {first_name_vocative}(폴란드어 호격, 예: Krystianie), {assistant_name}, {brand}(어시스턴트 설정의 통화용 회사명), {name} 변수를 사용하는 고정 문구이며, 이름이 없는 가입자를 위한 별도 문구도 지정할 수 있습니다. 또는 어시스턴트가 이름, 컨텍스트, 단계의 목표, “통화 시작 시” 도구의 결과를 바탕으로 첫 문장을 직접 구성하는 모드도 있습니다. AI 어시스턴트가 전화하고 있다는 사실과 통화가 녹음된다는 사실은 문구에 포함되어 있지 않으면 첫 문장에 항상 추가됩니다.

시퀀스에서 사용자 제외

POST/api/outreach/unenroll

더 이상 전화가 필요 없는 경우(예: 첫 구매 후 또는 해지 시), 같은 키로 해당 사용자의 시퀀스를 중지하세요. 예약된 통화는 즉시 취소됩니다. 이미 진행 중인 통화는 끊기지 않지만, 그 이후에는 추가 통화가 없습니다.

  • external_id | enrollment_id | phone필수
    다음 중 정확히 하나를 지정하세요: external_id(등록 시 보낸 값), enrollment_id(등록 응답에 포함된 값) 또는 phone.
  • reason선택 사항
    선택 사항인 사유로, 최대 200자이며 계정의 감사 로그에 기록됩니다.
  • 200: 중지되었습니다(changed: true). 또는 이미 종료된 상태입니다: status가 stopped, completed 또는 failed(changed: false). 안전하게 반복 호출할 수 있습니다.
  • 400: invalid_request(식별자가 없거나 둘 이상) 또는 invalid_phone
  • 401: invalid_key
  • 404: not_found — 이 시퀀스에 해당 등록 정보가 없습니다
  • 429: rate_limited
curl
curl -X POST "https://telofia.com/api/outreach/unenroll" \
  -H "Authorization: Bearer tlo_…" \
  -H "Content-Type: application/json" \
  -d '{"external_id":"user_123","reason":"first_sale"}'
200 OK
{
  "ok": true,
  "enrollment_id": "8f7e6d5c-4b3a-4c2d-9e1f-0a9b8c7d6e5f",
  "external_id": "user_123",
  "status": "stopped",
  "changed": true
}

웹훅으로 받는 통화 결과

시퀀스 통화의 call.started와 call.completed에는 callback_id, external_id, outreach { sequence_id, enrollment_id, external_id, step }가 포함됩니다(수신 통화에서는 모두 null). 받지 않은 시도는 통화로 기록되지 않으므로 call.completed가 없습니다. 마지막 시도 후에는 status가 failed이고 last_error가 no_answer인 outbound_call.finished를 받게 됩니다. 한 단계의 재시도는 하나의 결과로 집계됩니다. call.completed에는 caller_spoke와 caller_words(상대방이 말한 단어 수)도 포함됩니다. 상대방이 전화를 받고 인사말 도중 또는 직후에 아무 말 없이 끊으면 end_reason은 caller_hangup_greeting입니다. 발신 시도 후 3일 이내에 상대방이 비즈니스 번호로 다시 전화하면, 수신 통화에 callback_return: true가 표시되며 회신 대상 통화와 동일한 callback_id, external_id, outreach가 포함됩니다. 웹사이트 위젯 통화는 direction이 widget이고 page_url, page_title(통화가 이루어진 페이지), continued_from(페이지 새로고침 후 이전 부분)이 포함됩니다. 대시보드에서 진행하는 브라우저 테스트는 direction이 web입니다. 통화 중 MCP 서버로 보내는 모든 요청에는 Telofia-Call-Id 헤더(통화 ID와 동일)가 포함되며, 전화 통화에는 Telofia-Caller, 시퀀스 또는 API 통화에는 Telofia-Outreach-External-Id가 추가됩니다.

시퀀스 통화의 call.completed
{
  "id": "5b1f0c6e-2a8d-4f3e-9d51-7c0a4e2b9f10",
  "object": "call",
  "assistant_id": "0e6f4c8a-3b2d-4a1e-8f7c-5d9b2a1c3e4f",
  "phone_number_id": "4d3c2b1a-0f9e-4d8c-b7a6-958473625140",
  "contact_id": "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
  "direction": "outbound",
  "status": "completed",
  "from": "+48732127980",
  "to": "+48601234567",
  "started_at": "2026-10-01T09:14:03Z",
  "ended_at": "2026-10-01T09:17:41Z",
  "duration_sec": 218,
  "summary": "Jan added the company name and tax ID; asked for a call tomorrow at 10:00 about payments.",
  "outcome": "message",
  "sentiment": "positive",
  "tags": [],
  "has_recording": true,
  "end_reason": "agent_hangup",
  "page_url": null,
  "page_title": null,
  "continued_from": null,
  "intake": [
    {
      "key": "address",
      "label": "Adres",
      "value": "ul. Lipowa 5, Katowice"
    }
  ],
  "callback_id": "0f1e2d3c-4b5a-4968-8776-655443322110",
  "external_id": "crm-evt-1842",
  "outreach": {
    "sequence_id": "11111111-1111-4111-8111-111111111111",
    "enrollment_id": "8f7e6d5c-4b3a-4c2d-9e1f-0a9b8c7d6e5f",
    "external_id": "crm-evt-1842",
    "step": 1
  },
  "callback_return": false,
  "caller_spoke": true,
  "caller_words": 112
}

캘린더, CRM, 자동화

코드 없이 쓰는 연동

  • Google Calendar

    어시스턴트가 실제 예약 가능 시간을 확인하고, 캘린더에서 예약을 잡고 변경하고 취소합니다. 일정이 있는 시간대만 확인하며, 일정 제목은 읽지 않습니다.

  • Zapier, Make, n8n

    대시보드에서 단계별 안내를 확인할 수 있습니다. 모든 요금제에 포함된 웹훅과 API를 기반으로 동작합니다.

요금제 및 한도

필요한 요금제 확인

계정별 한도: 분당 요청 수(키별로도 적용, 슬라이딩 윈도우)와 일일 요청 수(UTC 기준). 한도를 초과하면 Retry-After 헤더와 함께 429 rate_limited가 반환됩니다.

요금제요청 수/분요청 수/일API 키웹훅
무료 체험 (테스트 이용)201,00011
Line302,00022
Desk6010,00055
Office18050,0001010
Network600200,0002520

웹사이트 음성 위젯: Office 요금제부터 제공됩니다.

더 높은 한도가 필요하신가요? 문의해 주시면 계정에 맞게 상향해 드립니다.

얼리 액세스: AI가 전화를 받는 첫 번째 비즈니스가 되어 보세요.

연동을 시작할까요?

무료 체험을 시작하고, 테스트 API 키를 만들어 몇 분 만에 첫 요청을 보내 보세요. API는 Line부터 모든 요금제에 포함되어 있습니다.