跳到导航

Reception API 快速入门

创建客户工作区,为其销售套餐,并将接待员配置到电话号码上。

本指南使用 Reception API 端到端配置一位客户:订阅付费套餐的工作区、供接待员回答问题的企业资料,以及可呼叫接待员的电话号码。

前提条件

  • 经销商管理面板中的 API 密钥,设为 ELEVENLABS_API_KEY。该管理面板仅向 Reception.ai 合作伙伴开放;如需成为合作伙伴,请联系销售团队。
  • 经销商账户中已保存的信用卡。为工作区订阅套餐会产生扣费。
  • Python SDK(pip install elevenlabs)或 TypeScript SDK(npm install @elevenlabs/elevenlabs-js)。

配置客户

1

选择套餐

列出你销售的层级。它们按价格从低到高排列,第一个为试用套餐。

from elevenlabs import ElevenLabs
elevenlabs = ElevenLabs()
tiers = elevenlabs.reception.tiers.list()
for tier in tiers:
print(tier.tier_id, tier.display_name, tier.tier_economics.monthly_price_usd)
2

创建工作区

创建客户工作区,为其订阅付费层级,并邀请企业所有者。邀请为尽力而为:每项邀请的结果都在 member_results 中。

from elevenlabs import ProvisionResellerWorkspaceSubscription, TeamInviteRequest
workspace = elevenlabs.reception.workspaces.create(
business_name="Bright Smile Dental",
subscription=ProvisionResellerWorkspaceSubscription(
tier_id=tiers[1].tier_id,
billing_period="monthly_period",
),
members=[
TeamInviteRequest(email="owner@brightsmiledental.com", role="workspace_admin"),
],
)
workspace_id = workspace.workspace_id

省略 subscription 可创建没有套餐的工作区,并可稍后分配套餐。

3

描述企业

接待员根据企业资料回答问题。从这里开始,每次调用都作用于新工作区,因此需携带 xi-workspace-id 标头。operating_hours 中的日期从 0(周一)到 6(周日),没有条目的日期为停业。

from elevenlabs import TimeRangeModel, WorkingHours
weekday = [TimeRangeModel(start_hour=8, start_minute=0, end_hour=17, end_minute=0)]
elevenlabs.reception.business_profile.update(
xi_workspace_id=workspace_id,
business_country="US",
business_description="Family dental practice offering cleanings, fillings, crowns and teeth whitening.",
timezone="America/Los_Angeles",
operating_hours=WorkingHours(hours={str(day): weekday for day in range(5)}),
)
elevenlabs.reception.knowledge_sources.add_url(
xi_workspace_id=workspace_id,
url="https://brightsmiledental.com",
crawl_entire_site=True,
)

服务、员工、地点和节假日也以相同方式添加,分别使用 services、staff、locations 和 holidays 分组。

4

完成入驻

完成入驻会根据企业资料创建工作区的接待员。此操作可安全重试。创建工作区时也可以传入 complete_onboarding=True,但接待员届时仅根据企业名称创建。

onboarding = elevenlabs.reception.workspaces.complete_onboarding(workspace_id)
receptionist_id = onboarding.customer_facing_agent_id
5

为接待员配置电话号码

在美国和加拿大,系统会从号码池中获取或购买一个带有所请求区号的号码;若不可用,则使用企业所在国家的任意号码。

assignment = elevenlabs.reception.phone_numbers.create(
xi_workspace_id=workspace_id,
customer_facing_agent_id=receptionist_id,
area_codes=["415", "628"],
)
print(assignment.phone_number)

接待员现在会接听拨打至 phone_number 的来电。

后续步骤