> This is a page from the ElevenLabs documentation. For a complete page index, fetch https://elevenlabs.io/docs/llms.txt. For the full documentation in a single file, fetch https://elevenlabs.io/docs/llms-full.txt.

# Cal.com

## 概要

ElevenLabs AIエージェントを[Cal.com](https://cal.com)に接続して、スケジュール管理やカレンダー予約を行います。このインテグレーションにより、エージェントは自然な会話を通じて空き状況の確認、予定の予約、会議のキャンセルや再スケジュール、既存予約の検索を行えます。

## 機能

| 機能           | サポート                  |
| ------------ | --------------------- |
| ゼロ保持モード（ZRM） | 非対応                   |
| ツール内の添付ファイル  | 非対応 — ツールはテキストのみを扱います |

## セットアップ

このインテグレーションでは、認証に**Cal.com APIキー**（OAuthアプリではありません）を使用します。

#### Cal.comでAPIキーを生成する

Cal.comアカウントで**Settings > Developer > API Keys**に移動し、**New**をクリックします。生成されたキーはすぐにコピーしてください。再表示されることはありません。

#### ライブキーを使用する

Cal.comでは、テストキー（`cal_`で始まる）とライブキー（`cal_live_`で始まる）の2種類のキーが生成されます。エージェントが実際のカレンダーデータにアクセスできるよう、**ライブキー**を使用してください。

#### ElevenLabsで接続する

ElevenLabsのインテグレーション設定で、Cal.com APIキーを**API Key**フィールドに貼り付けます。

## デモ

> **Note**
>
> このデモでは従来のWebhookツールを使用しています。ネイティブのCal.comインテグレーションを使用している場合、ツールは
> 自動的に設定されるため、Webhookを手動で設定する必要はありません。

## 仕組み

エージェントはツール呼び出しを使用して、予約プロセスを段階的に進めながら会議をスケジュールします。以下のタブでは、概要と詳細なシステムプロンプトを確認できます。

#### 概要

#### 最初の問い合わせと会議の詳細

エージェントは、スケジュールに必要な情報を収集するため、会議の目的、希望日時、所要時間を尋ねます。

#### カレンダーの空き状況を確認

エージェントは次の方法でカレンダーの空き状況を確認します：

* `get_available_slots`ツールを使用して、空いている時間枠を取得します。
* 希望する時間が空いているかを確認します。
* 希望時間が空いていない場合は、代替案を提案します。
* 選択した時間を発信者に確認します。

#### 連絡先情報の収集

時間が決まったら、エージェントは次を行います：

* 出席者のフルネームを収集して検証します。
* メールアドレスが正確か確認します。
* タイムゾーン情報を確認します。
* Cal.comのイベントタイプに必要な追加フィールドを収集します。

#### 会議の作成

エージェントは次を行います：

* すべての情報を確認した後、`book_meeting`ツールを呼び出します。
* 予約テンプレートの構造に従います。
* 会議が作成されたことを出席者に確認します。
* カレンダー招待が送信されることを伝えます。

#### 詳細なシステムプロンプト

```
You are a helpful receptionist responsible for scheduling meetings using the Cal.com integration. Be friendly, precise, and concise.

Begin by briefly asking for the purpose of the meeting and the caller's preferred date and time.
Then, ask about the desired meeting duration (15, 30, or 60 minutes), and wait for the user's response before proceeding.

Once you have the meeting details, say you will check calendar availability:
- Call get_available_slots with the appropriate date range
- Verify if the requested time slot is available
- If not available, suggest alternative times from the available slots
- Continue until a suitable time is agreed upon

After confirming a time slot, gather the following contact details:
- The attendee's full name
- A valid email address. Note that the email address is transcribed from voice, so ensure it is formatted correctly.
- The attendee's time zone (in 'Continent/City' format like 'America/New_York')
- Read the email back to the caller to confirm accuracy

Once all details are confirmed, explain that you will create the meeting.
Create the meeting by using the book_meeting tool with the following parameters:
- start: The agreed meeting time in ISO 8601 format
- eventTypeId: The appropriate ID based on the meeting duration (15min: 1351800, 30min: 1351801, 60min: 1351802)
- attendee: An object containing the name, email, and timeZone

Thank the attendee and inform them they will receive a calendar invitation shortly.

Clarifications:
- Do not inform the user that you are formatting the email; simply do it.
- If the caller asks you to proceed with booking, do so with the existing information.

Guardrails:
- Do not share any internal IDs or API details with the caller.
- If booking fails, check for formatting issues in the email or time conflicts.
```

## Webhookの手動設定

> **Note**
>
> ネイティブのCal.comインテグレーションを使用する場合、ツールは自動的に設定されます。以下の手順は
> Webhookを手動で設定する場合にのみ適用されます。

#### Cal.comシークレットを保存する

認証が必要なリクエストを行う前に、APIキーを安全に保存してください。まだ作成していない場合は、新しい[Cal.com APIキー](https://cal.com/docs/api-reference/v1/introduction#get-your-api-keys)を生成します。

Cal.com APIでは、次の認証ヘッダーが必要です：

**`Cal request header structure`**

```plaintext Cal request header structure
'Authorization': 'Bearer YOUR_API_KEY'
```

リクエスト時に安全にアクセスできるよう、キーはエージェントのシークレットストレージに保存してください。

> **Warning**
>
> Cal.comで求められる認証構造に合わせるため、シークレットを作成する際はAPIキーの先頭に`Bearer `を付けてください。

![ツールのシークレット](/docs/_fern-img/5ffae070945a86b74975cd9b56679c2bb76f0ce70d05fe7b10e8e5dff6ddd630.webp)

#### エージェントにツールを追加する

カレンダー予約を有効にするには、次の2つのツールを作成します：

1. **`get_available_slots`**：ユーザーが\_「ルイは火曜日の午前10時30分に空いていますか？」\_と尋ねると、エージェントは[Cal.comの「空き時間枠を取得」エンドポイント](https://cal.com/docs/api-reference/v2/slots/find-out-when-is-an-event-type-ready-to-be-booked)を使用して、空いている時間枠を確認します。

2. **`book_meeting`**：適切な時間を特定した後、エージェントは[Cal.comの「予約を作成」エンドポイント](https://cal.com/docs/api-reference/v2/bookings/create-a-booking#create-a-booking)を使用して会議を予約します。

ダッシュボードの**Tools**セクションに移動し、**Add Tool**を選択します。ツールタイプとして**Webhook**を選び、以下のセクションを入力します：

#### ツール1：get_available_slots

#### 設定

ツールをいつ呼び出すべきかをエージェントが判断するために使用するメタデータ：

| フィールド | 値                                                            |
| ----- | ------------------------------------------------------------ |
| 名前    | get_available_slots                                          |
| 説明    | このツールは、特定の時間枠がカレンダーで利用可能かを確認します。                             |
| メソッド  | GET                                                          |
| URL   | [https://api.cal.com/v2/slots](https://api.cal.com/v2/slots) |

#### ヘッダー

[こちら](https://cal.com/docs/api-reference/v2/slots/get-available-slots#get-available-slots)で定義されているリクエストヘッダーに対応します：

| タイプ    | 名前              | 値                 |
| ------ | --------------- | ----------------- |
| Secret | Authorization   | 上で作成したシークレットキーを選択 |
| String | cal-api-version | 2024-09-04        |

#### クエリパラメータ

[こちら](https://cal.com/docs/api-reference/v2/slots/get-available-slots#get-available-slots)で定義されているリクエストクエリパラメータに対応します：

| データ型   | 識別子         | 必須 | 説明                                                    |
| ------ | ----------- | -- | ----------------------------------------------------- |
| string | start       | はい | 時間枠を取得する開始日時（UTC）。例：'2024-08-13T09:00:00Z'。           |
| string | end         | はい | 時間枠を取得する終了日時（UTC）。例：'2024-08-13T17:00:00Z'。           |
| string | eventTypeId | はい | 予約するイベントタイプのID。15分の場合はabc、30分の場合はdef、60分の場合はxyzを返します。 |

#### ツール2：book_meeting

#### 設定

ツールをいつ呼び出すべきかをエージェントが判断するために使用するメタデータ：

| フィールド | 値                                                                  |
| ----- | ------------------------------------------------------------------ |
| 名前    | book_meeting                                                       |
| 説明    | このツールは、時間が決まったらカレンダーに会議を予約します。                                     |
| メソッド  | POST                                                               |
| URL   | [https://api.cal.com/v2/bookings](https://api.cal.com/v2/bookings) |

#### ヘッダー

[こちら](https://cal.com/docs/api-reference/v2/bookings/create-a-booking#create-a-booking)で定義されているリクエストヘッダーに対応します：

| タイプ    | 名前              | 値                 |
| ------ | --------------- | ----------------- |
| Secret | Authorization   | 上で作成したシークレットキーを選択 |
| String | cal-api-version | 2024-08-13        |

#### 本文パラメータ

[こちら](https://cal.com/docs/api-reference/v2/bookings/create-a-booking#create-a-booking)で定義されているリクエスト本文パラメータに対応します：

| 識別子         | データ型   | 必須 | 説明                                                      |
| ----------- | ------ | -- | ------------------------------------------------------- |
| start       | String | はい | UTCタイムゾーンでの、ISO 8601形式の予約開始時刻。例：'2024-08-13T09:00:00Z'。 |
| eventTypeId | Number | はい | 予約するイベントタイプのID。15分の場合はabc、30分の場合はdef、60分の場合はxyzを返します。   |
| attendee    | Object | はい | 出席者の詳細。これらのフィールドはユーザーから収集する必要があります。                     |

> **Note**
>
> `eventTypeId`は、Calで利用可能なイベントタイプに対応している必要があります。アカウントのイベントタイプ一覧を取得するには、
> [この](https://cal.com/docs/api-reference/v1/event-types/find-all-event-types#find-all-event-types)
> エンドポイントを呼び出します（または、これを自動的に行う別のツールを作成します）。

**出席者オブジェクト：**

| 識別子      | データ型   | 必須 | 説明                                                                         |
| -------- | ------ | -- | -------------------------------------------------------------------------- |
| name     | String | はい | 会議を予約する人のフルネーム。                                                            |
| email    | String | はい | 会議を予約する人のメールアドレス。                                                          |
| timeZone | String | はい | 発信者のタイムゾーン。'Europe/London'や'America/New_York'のように'Continent/City'形式で指定します。 |

> **Success**
>
> **Test AI agent**ボタンを押してエージェントをテストします。必要に応じてシステムプロンプトを調整してください。

#### 日付と時刻を認識させる

デフォルトでは、エージェントは現在の日付や時刻を認識しません。次のいずれかの方法を使用してください：

1. **時刻取得ツールを作成する**：現在の日付と時刻を取得するツールを追加します。

2. **オーバーライド**：[オーバーライド](/docs/ja/eleven-agents/customization/personalization/overrides)機能を使用して、各会話の開始時に現在の日付と時刻をシステムプロンプトへ挿入します。

## セキュリティに関する考慮事項

* すべてのWebhook呼び出しにHTTPSエンドポイントを使用します。
* 機密値はElevenLabs Secrets Managerを使用してシークレットとして保存します。
* すべての認証ヘッダーが必要な形式（`Bearer YOUR_API_KEY`）に従っていることを確認します。
* イベントタイプIDやAPIの詳細を発信者に公開しないでください。

## 便利なリンク

* [Cal.com APIドキュメント](https://cal.com/docs/api-reference/v2/introduction)
* [Cal.com APIキーガイド](https://cal.com/blog/where-is-my-api-key-and-what-can-it-do)
* [ElevenLabsツールの概要](/docs/ja/eleven-agents/customization/tools/server-tools)