> This is a page from the ElevenLabs documentation. For an index of the documentation, fetch https://elevenlabs.io/docs/llms.txt.

# Reception APIクイックスタート

このガイドでは、[Reception API](/docs/ja/reception-ai/reception-api/overview)を使用して、1人の顧客を最初から最後までプロビジョニングします。有料プランのワークスペース、受付担当が回答に使用する事業プロフィール、受付担当につながる電話番号を設定します。

## 前提条件

* リセラー管理パネルで取得し、`ELEVENLABS_API_KEY`として設定したAPIキー。管理パネルはReception.aiパートナーのみ利用できます。パートナーになるには、[営業チームにお問い合わせください](https://www.reception.ai/contact-sales)。
* リセラーアカウントに登録されたカード。ワークスペースをサブスクリプションに加入させると、このカードに請求されます。
* Python SDK（`pip install elevenlabs`）またはTypeScript SDK（`npm install @elevenlabs/elevenlabs-js`）。

## 顧客をプロビジョニングする

### プランを選択する

販売する料金階層を一覧表示します。料金の安い順に表示され、最初の階層がトライアルです。

```python
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)
```

```typescript
import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js";

const elevenlabs = new ElevenLabsClient();

const tiers = await elevenlabs.reception.tiers.list();
for (const tier of tiers) {
  console.log(tier.tierId, tier.displayName, tier.tierEconomics.monthlyPriceUsd);
}
```

```bash
curl "https://api.elevenlabs.io/v1/reception/reseller/tier-ladder" \
  -H "xi-api-key: $ELEVENLABS_API_KEY"
```

### ワークスペースを作成する

顧客のワークスペースを作成して有料の料金階層に加入させ、事業オーナーを招待します。招待はベストエフォートで実行され、各招待の結果は`member_results`に格納されます。

```python
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
```

```typescript
const workspace = await elevenlabs.reception.workspaces.create({
  businessName: "Bright Smile Dental",
  subscription: {
    tierId: tiers[1].tierId,
    billingPeriod: "monthly_period",
  },
  members: [{ email: "owner@brightsmiledental.com", role: "workspace_admin" }],
});

const workspaceId = workspace.workspaceId;
```

```bash
curl -X POST "https://api.elevenlabs.io/v1/reception/reseller/workspaces" \
  -H "xi-api-key: $ELEVENLABS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "business_name": "Bright Smile Dental",
    "subscription": { "tier_id": "smbtier_4401k8r2c6hxe9tq3vz7m5wd1nb0", "billing_period": "monthly_period" },
    "members": [{ "email": "owner@brightsmiledental.com", "role": "workspace_admin" }]
  }'
```

プランなしでワークスペースを作成し、[後から割り当てる](/docs/ja/reception-ai/reception-api/subscriptions-and-billing#assign-a-plan)には、`subscription`を省略します。

### 事業情報を設定する

受付担当は事業プロフィールを基に回答します。ここから先は、すべての呼び出しが新しいワークスペースを対象とするため、`xi-workspace-id`ヘッダーを含めます。`operating_hours`の曜日は`0`（月曜日）から`6`（日曜日）で表し、エントリがない曜日は休業日となります。

```python
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,
)
```

```typescript
const weekday = [{ startHour: 8, startMinute: 0, endHour: 17, endMinute: 0 }];

await elevenlabs.reception.businessProfile.update({
  xiWorkspaceId: workspaceId,
  businessCountry: "US",
  businessDescription:
    "Family dental practice offering cleanings, fillings, crowns and teeth whitening.",
  timezone: "America/Los_Angeles",
  operatingHours: {
    hours: { "0": weekday, "1": weekday, "2": weekday, "3": weekday, "4": weekday },
  },
});

await elevenlabs.reception.knowledgeSources.addUrl({
  xiWorkspaceId: workspaceId,
  url: "https://brightsmiledental.com",
  crawlEntireSite: true,
});
```

```bash
curl -X PUT "https://api.elevenlabs.io/v1/reception/agent-info" \
  -H "xi-api-key: $ELEVENLABS_API_KEY" \
  -H "xi-workspace-id: 8f1c2a7e4b9d4e6fa3c5b2d1e0f9a8b7" \
  -H "Content-Type: application/json" \
  -d '{
    "business_country": "US",
    "business_description": "Family dental practice offering cleanings, fillings, crowns and teeth whitening.",
    "timezone": "America/Los_Angeles",
    "operating_hours": {
      "hours": {
        "0": [{ "start_hour": 8, "start_minute": 0, "end_hour": 17, "end_minute": 0 }],
        "1": [{ "start_hour": 8, "start_minute": 0, "end_hour": 17, "end_minute": 0 }],
        "2": [{ "start_hour": 8, "start_minute": 0, "end_hour": 17, "end_minute": 0 }],
        "3": [{ "start_hour": 8, "start_minute": 0, "end_hour": 17, "end_minute": 0 }],
        "4": [{ "start_hour": 8, "start_minute": 0, "end_hour": 17, "end_minute": 0 }]
      }
    }
  }'

curl -X POST "https://api.elevenlabs.io/v1/reception/knowledge-sources/urls" \
  -H "xi-api-key: $ELEVENLABS_API_KEY" \
  -H "xi-workspace-id: 8f1c2a7e4b9d4e6fa3c5b2d1e0f9a8b7" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://brightsmiledental.com", "crawl_entire_site": true }'
```

サービス、スタッフ、拠点、休業日も同様に、`services`、`staff`、`locations`、`holidays`グループを使用して追加します。

### オンボーディングを完了する

オンボーディングを完了すると、事業プロフィールを基にワークスペースの受付担当が作成されます。安全に再試行できます。ワークスペースの作成時に`complete_onboarding=True`を渡すこともできますが、その場合、受付担当は事業名だけを基に作成されます。

```python
onboarding = elevenlabs.reception.workspaces.complete_onboarding(workspace_id)

receptionist_id = onboarding.customer_facing_agent_id
```

```typescript
const onboarding = await elevenlabs.reception.workspaces.completeOnboarding(workspaceId);

const receptionistId = onboarding.customerFacingAgentId;
```

```bash
curl -X POST "https://api.elevenlabs.io/v1/reception/reseller/workspaces/8f1c2a7e4b9d4e6fa3c5b2d1e0f9a8b7/complete-onboarding" \
  -H "xi-api-key: $ELEVENLABS_API_KEY"
```

### 受付担当に電話番号を割り当てる

米国とカナダでは、指定した市外局番のいずれかに該当する番号をプールから取得するか購入します。該当する番号がない場合は、その事業の国にある任意の番号を使用します。

```python
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)
```

```typescript
const assignment = await elevenlabs.reception.phoneNumbers.create({
  xiWorkspaceId: workspaceId,
  customerFacingAgentId: receptionistId,
  areaCodes: ["415", "628"],
});

console.log(assignment.phoneNumber);
```

```bash
curl -X POST "https://api.elevenlabs.io/v1/reception/phone-numbers/assignments" \
  -H "xi-api-key: $ELEVENLABS_API_KEY" \
  -H "xi-workspace-id: 8f1c2a7e4b9d4e6fa3c5b2d1e0f9a8b7" \
  -H "Content-Type: application/json" \
  -d '{ "customer_facing_agent_id": "agent_7101k5zvyjhmfg983brhmhkd98n6", "area_codes": ["415", "628"] }'
```

これで、受付担当が`phone_number`への着信に応答します。

## 次のステップ

* [プロビジョニングとオンボーディング](/docs/ja/reception-ai/reception-api/provisioning-and-onboarding)：ワークスペースの作成と事業情報の設定について、さらに多くの例を紹介します。
* [サブスクリプションと請求](/docs/ja/reception-ai/reception-api/subscriptions-and-billing)：顧客のプランを変更し、カードへの請求内容を確認します。