> ## Documentation Index
> Fetch the complete documentation index at: https://docs.timothe.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# ウェブフック連携

> ウェブフックを使ってセッションイベントを外部サービスに通知する方法

セッションイベントを任意の HTTPS エンドポイントに HTTP POST で送信します。

## 設定

ダッシュボードの **インテグレーション** から新規作成し、タイプ「ウェブフック」を選択します。

| 項目          | 説明                     |
| ----------- | ---------------------- |
| Webhook URL | イベント送信先の URL（HTTPS のみ） |

## イベント種別

以下のイベントが発生時に送信されます。

### `session-started`

セッションが開始されたとき。

```json theme={null}
{
  "type": "session-started",
  "payload": {
    "agent": {
      "id": "...",
      "name": "..."
    },
    "session": {
      "id": "...",
      "context": { ... }
    }
  },
  "metadata": {
    "id": "...",
    "invokedAt": "2026-01-01T00:00:00.000Z",
    "workspaceId": "...",
    "integrationId": "..."
  }
}
```

### `user-message-sent`

ユーザーがメッセージを送信したとき。

```json theme={null}
{
  "type": "user-message-sent",
  "payload": {
    "agent": {
      "id": "...",
      "name": "..."
    },
    "session": { "id": "...", "context": { ... } },
    "message": { ... }
  },
  "metadata": { ... }
}
```

### `action-executed`

ユーザーがアクションを実行したとき。

```json theme={null}
{
  "type": "action-executed",
  "payload": {
    "agent": {
      "id": "...",
      "name": "..."
    },
    "session": { "id": "...", "context": { ... } },
    "action": { ... }
  },
  "metadata": { ... }
}
```

### `session-summarized`

セッションの要約が完了したとき。

```json theme={null}
{
  "type": "session-summarized",
  "payload": {
    "agent": {
      "id": "...",
      "name": "..."
    },
    "session": {
      "id": "...",
      "context": { ... },
      "summary": "セッションの要約テキスト",
      "importance": "low" | "medium" | "high",
      "transcript": "..."
    }
  },
  "metadata": { ... }
}
```

## ペイロード構造

すべてのイベントには以下の共通フィールドがあります。

* **`type`** — イベント種別
* **`payload`** — イベント固有のデータ（エージェントID、セッション情報など）
* **`metadata`** — イベントメタデータ（イベントID、発生日時、ワークスペースID、インテグレーションID）
