Skip to navigation

Provisioning and onboarding

Examples for creating customer workspaces and filling in what their receptionist knows.

These examples build on the quickstart. They use the same Bright Smile Dental customer, and every workspace call carries its ID in xi-workspace-id.

Provision workspaces

Provision in one request

When you don’t have the business details yet, create the workspace, subscribe it, invite the owner and finish onboarding in one call. The receptionist is built from the business name alone, so fill in the business profile afterwards. Pass an idempotency_key so a retry after a timeout can’t create a second workspace.

from elevenlabs import ElevenLabs, ProvisionResellerWorkspaceSubscription, TeamInviteRequest
elevenlabs = ElevenLabs()
workspace = elevenlabs.reception.workspaces.create(
business_name="Bright Smile Dental",
subscription=ProvisionResellerWorkspaceSubscription(
tier_id="smbtier_4401k8r2c6hxe9tq3vz7m5wd1nb0",
),
members=[
TeamInviteRequest(email="owner@brightsmiledental.com", role="workspace_admin"),
TeamInviteRequest(email="frontdesk@brightsmiledental.com"),
],
complete_onboarding=True,
idempotency_key="provision-crm-10482",
)
for result in workspace.member_results:
if result.outcome == "failed":
print("Invite failed:", result.email, result.error_status)
if workspace.onboarding_completed_at_unix is None:
elevenlabs.reception.workspaces.complete_onboarding(workspace.workspace_id)

Onboarding at creation is best-effort: if it fails, onboarding_completed_at_unix is null and you can retry it with complete_onboarding.

Provision customers from your CRM

Derive each idempotency_key from your own customer ID, so running the import again returns the workspaces it already created instead of creating new ones. The same key with a different body is rejected with idempotency_key_reused.

customers = [
{"crm_id": "10482", "name": "Bright Smile Dental", "owner": "owner@brightsmiledental.com"},
{"crm_id": "10483", "name": "Harbor Physio", "owner": "hello@harborphysio.com"},
]
workspace_ids = {}
for customer in customers:
workspace = elevenlabs.reception.workspaces.create(
business_name=customer["name"],
subscription=ProvisionResellerWorkspaceSubscription(
tier_id="smbtier_4401k8r2c6hxe9tq3vz7m5wd1nb0",
),
members=[TeamInviteRequest(email=customer["owner"], role="workspace_admin")],
idempotency_key=f"provision-crm-{customer['crm_id']}",
)
workspace_ids[customer["crm_id"]] = workspace.workspace_id

Finish onboarding for workspaces still in setup

workspaces.list shows which workspaces haven’t finished onboarding. complete_onboarding is safe to retry, so you can run this on a schedule.

cursor = None
while True:
page = elevenlabs.reception.workspaces.list(cursor=cursor, page_size=100)
for workspace in page.workspaces:
if workspace.onboarding_completed_at_unix is None:
elevenlabs.reception.workspaces.complete_onboarding(workspace.workspace_id)
if not page.has_more:
break
cursor = page.next_cursor

Describe the business

Add the business’s locations, staff, services and closures before you complete onboarding, so the receptionist is built from them. You can add or change them at any time after that too.

Until onboarding is complete, the setup wizard the business owner sees when they sign in can replace or remove this data. Complete onboarding before the owner signs in.

Add a location

Each location has its own hours. Days run from 0 (Monday) to 6 (Sunday), and a day with no entry is closed.

from elevenlabs import TimeRangeModel, WorkingHours
workspace_id = "8f1c2a7e4b9d4e6fa3c5b2d1e0f9a8b7"
weekday = [TimeRangeModel(start_hour=8, start_minute=0, end_hour=17, end_minute=0)]
saturday = [TimeRangeModel(start_hour=9, start_minute=0, end_hour=13, end_minute=0)]
location = elevenlabs.reception.locations.create(
xi_workspace_id=workspace_id,
name="Mission Street",
address="2140 Mission St, San Francisco, CA 94110",
notes="Free parking behind the building.",
operating_hours=WorkingHours(hours={**{str(day): weekday for day in range(5)}, "5": saturday}),
)

Add a staff member

A staff member at a location follows that location’s hours unless you give them their own working_hours. customer_facing_name is what callers hear; name stays the internal label.

hygienist = elevenlabs.reception.staff.create(
xi_workspace_id=workspace_id,
name="Maria Lopez (hygienist)",
customer_facing_name="Maria",
description="Dental hygienist. Speaks English and Spanish.",
email="maria@brightsmiledental.com",
location_id=location.id,
working_hours=WorkingHours(
hours={str(day): [TimeRangeModel(start_hour=9, start_minute=0, end_hour=15, end_minute=0)] for day in range(4)},
),
)

Add services

A service has one or more variants, each with its own length and price; the first is the default. Set any_staff_member to false to limit who can deliver it.

When the price depends on the job, use pricing_mode="quote" and add intake_questions. The receptionist asks them and takes a quote request instead of quoting a price.

from elevenlabs import ReceptionIntakeQuestion, ReceptionServiceVariant
elevenlabs.reception.services.create(
xi_workspace_id=workspace_id,
name="Cleaning",
description="Routine cleaning and polish.",
variants=[
ReceptionServiceVariant(duration_minutes=45, price=120),
ReceptionServiceVariant(duration_minutes=60, price=160),
],
any_staff_member=False,
staff_ids=[hygienist.id],
buffer_minutes=10,
)
elevenlabs.reception.services.create(
xi_workspace_id=workspace_id,
name="Invisalign consultation",
pricing_mode="quote",
variants=[ReceptionServiceVariant(duration_minutes=30)],
intake_questions=[
ReceptionIntakeQuestion(label="Have you worn braces or aligners before?", kind="choice", options=["Yes", "No"]),
ReceptionIntakeQuestion(label="What would you like to fix?", required=True),
],
)

Close for a holiday

A closure covers whole days, from start_date to end_date. Use time_off_type="location" for the business, or "staff" with the staff member’s ID in resource_id for one person’s time off.

from elevenlabs import DateModel
elevenlabs.reception.holidays.create(
xi_workspace_id=workspace_id,
name="Winter break",
start_date=DateModel(year=2026, month=12, day=24),
end_date=DateModel(year=2026, month=12, day=26),
time_off_type="location",
location_id=location.id,
)

Upload a document

Give the receptionist a document to answer from, such as an FAQ or a price list. Use knowledge_sources.add_url for a website, as in the quickstart.

with open("new-patient-faq.pdf", "rb") as file:
elevenlabs.reception.knowledge_sources.upload(xi_workspace_id=workspace_id, file=file)

Set up the receptionist

These calls need the receptionist’s ID: customer_facing_agent_id from complete_onboarding, or agent_id from receptionists.list.

Set the greeting, languages and what to collect

Only the settings you send change.

from elevenlabs import ReceptionCustomerFacingConfigPatch
receptionist_id = elevenlabs.reception.receptionists.list(xi_workspace_id=workspace_id)[0].agent_id
elevenlabs.reception.receptionists.update(
receptionist_id,
xi_workspace_id=workspace_id,
config=ReceptionCustomerFacingConfigPatch(
first_message="Thanks for calling Bright Smile Dental, how can I help?",
additional_languages=["es"],
tone_traits=["warm", "concise"],
details_to_collect=["full name", "date of birth", "insurance provider"],
additional_instructions="Never give medical advice. Offer the next available appointment instead.",
),
)

Transfer calls and add rules

A transfer rule hands the call to a person when its condition is met. Transfers depend on the plan: check is_transfer_allowed on the receptionist first. A rule tells the receptionist how to behave; a strict rule is always followed, a suggestion is a guideline.

elevenlabs.reception.receptionists.transfer_rules.create(
receptionist_id,
xi_workspace_id=workspace_id,
label="Front desk",
phone_number="+14155550142",
condition="The caller has a dental emergency or asks to speak to a person.",
)
elevenlabs.reception.receptionists.rules.create(
receptionist_id,
xi_workspace_id=workspace_id,
title="New patients",
description="Ask new patients to arrive 15 minutes early to fill in forms.",
)

Invite the team

Invite people at any time after the workspace exists. A pending invite takes a seat, so an invite is refused once members and invites reach the plan’s team size.

elevenlabs.reception.team.invites.create(
xi_workspace_id=workspace_id,
email="office.manager@brightsmiledental.com",
role="workspace_admin",
)