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

# Note イベント

> Note リソースに関する webhook イベント

export const Json = ({data, lang = 'json', spaces = 2}) => <pre>
    <code className={`language-${lang}`}>{JSON.stringify(data, null, spaces)}</code>
  </pre>;

export const EventBaseStructure = {
  id: "evt_01J9ABCDEF",
  type: "note.created",
  createdAt: "2025-09-05T07:12:34Z",
  workspaceGuid: "ws_a1b2c3d4",
  data: {
    resourceType: "Note",
    resourceId: "note-guid-123",
    resource: {
      "title": "Meeting Note"
    }
  }
};

export const NoteBaseJson = {
  guid: 'note-guid-123',
  workspaceGuid: 'ws_a1b2c3d4',
  title: 'Meeting notes',
  createdAt: '2025-07-20T10:00:00Z',
  updatedAt: '2025-07-20T11:10:00Z',
  sourceType: 'live-voice',
  recordingStartAt: '2025-07-20T10:00:10Z',
  recordingEndAt: '2025-07-20T11:00:10Z',
  recordingDurationSeconds: 3600,
  transcribeLocale: 'en_US',
  translateLocale: 'ko_KR',
  webUrl: 'https://tiro.ooo/n/123',
  collaborators: [{
    guid: 'user-guid-123',
    name: 'John Doe',
    email: 'john@example.com',
    role: 'OWNER'
  }, {
    guid: 'user-guid-456',
    name: 'Jane Smith',
    email: 'jane@example.com',
    role: 'EDITOR'
  }, {
    guid: 'user-guid-789',
    name: 'Sam',
    email: 'sam@example.com',
    role: 'VIEWER'
  }],
  participants: [{
    name: 'Alice Kim',
    email: 'alice@example.com'
  }, {
    name: 'Bob Park',
    email: null
  }]
};

## 概要

Note リソースに関する webhook イベントです。すべての note イベントは `resourceType: "Note"` を使用します。

## イベントの詳細

### note.created

* ライブ音声ノートの録音を開始したとき
* 録音ファイルからノートを作成したとき

### note.deleted

* ユーザーがノートを完全に削除したとき

### note.recording.completed（録音の一時停止）

* ライブ録音を一時停止し、その時点までの音声処理、テキスト変換、段落の生成が完了したときに発生します
* 1 回の会議で録音を複数回一時停止できるため、同じノートで複数回発生することがあります
* 互換性のためイベント名に `completed` が残っていますが、ノートの終了を意味しません。最終的な終了は `note.ended` で確認してください

### note.user\_content.updated

* ユーザーがノートの内容を手動で編集したとき

### note.ended

* ノートが完全に終了したとき（すべての処理が完了した後）にトリガーされます
* 複数回発生することがある `note.recording.completed` とは異なり、ノートのライフサイクルごとに 1 回だけ発生します
* これはノートの完了を示す、確定的なイベントです
* ノートが最終状態に達したことを把握する必要がある場合に、このイベントを利用してください

### note.participants.updated

* ノートに会議の参加者が追加または削除されたときにトリガーされます
* 既存の参加者の名前やメールアドレスが更新された場合には発生**しません**
* `resource` フィールドには、更新後の `participants` 配列を含む完全な Note オブジェクトが含まれます

## payload の例

<Json
  data={{
...EventBaseStructure,
type: "note.ended",
data: {
...EventBaseStructure.data,
resource: NoteBaseJson
}
}}
/>

## リソースデータ

Note イベントには、完全な Note リソースデータが含まれます。各フィールドの説明については、[Note API](/api-reference/note/get-note) をご覧ください。

**重要**: Note リソースには metadata のみが含まれます。transcript の内容を取得するには、[List Note Paragraphs](/api-reference/note/list-note-paragraphs) API を使用して、実際のテキストデータを取得してください。

## ガイド

### 録音の一時停止とノートの終了を区別する

* `note.recording.completed` は録音の一時停止を示します。受信するたびに最新のノートデータを取得してください
* `note.ended` はノートが完全に終了した後に 1 回だけ発生します
* 両方のイベントを購読すると、一時停止時点の途中結果と最終結果を分けて処理できます

**シナリオの例:**

1. 会議を開始 → 録音を開始
2. 録音を一時停止 → transcript と要約を処理 → `note.recording.completed` が発生
3. 録音を再開 → 処理を継続
4. 録音を一時停止 → `note.recording.completed` が再度発生
5. 録音を再開して終了 → `note.ended` が発生

**処理の例:**

<CodeGroup>
  ```javascript Node.js theme={"system"}
  async function handleRecordingPaused(event) {
    const noteId = event.data.resourceId;
    const note = event.data.resource;
    const paragraphs = await fetchNoteParagraphs(noteId);

    processPausedNote(note, paragraphs);
  }
  ```

  ```python Python theme={"system"}
  async def handle_recording_paused(event):
      note_id = event['data']['resourceId']
      note = event['data']['resource']
      paragraphs = await fetch_note_paragraphs(note_id)

      process_paused_note(note, paragraphs)
  ```

  ```go Go theme={"system"}
  func handleRecordingPaused(event WebhookEvent) error {
      noteID := event.Data.ResourceID
      note := event.Data.Resource

      paragraphs, err := fetchNoteParagraphs(noteID)
      if err != nil {
          return err
      }

      return processPausedNote(note, paragraphs)
  }
  ```

  ```kotlin Kotlin + Spring theme={"system"}
  suspend fun handleRecordingPaused(event: WebhookEvent) {
      val noteId = event.data.resourceId
      val note = event.data.resource
      val paragraphs = fetchNoteParagraphs(noteId)

      processPausedNote(note, paragraphs)
  }
  ```
</CodeGroup>
