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

# スレッドイベントの一覧取得

> 1 つの Session thread に限定したイベントを一覧取得します。

`GET /api/v1/cloud/sessions/{session_id}/threads/{thread_id}/events`

カーソルページネーションで 1 つの thread の公開イベントを取得します。

## パスパラメータ

| パラメータ        | 型      | 説明                            |
| ------------ | ------ | ----------------------------- |
| `session_id` | string | `sess_` プレフィックス付きの Session ID |
| `thread_id`  | string | `sthr_` プレフィックス付きの Thread ID  |

## ヘッダー

| ヘッダー            | 必須 | 説明                  |
| --------------- | -- | ------------------- |
| `Authorization` | はい | `Bearer $QODER_PAT` |

## クエリパラメータ

| パラメータ       | 型       | 必須  | 説明                                                                           |
| ----------- | ------- | --- | ---------------------------------------------------------------------------- |
| `limit`     | integer | いいえ | 返すイベントの最大数。デフォルトは 20、範囲は 1〜100。100 を超える値は `400 invalid_request_error` を返します。 |
| `page`      | string  | いいえ | 前回のレスポンスの `next_page` から得られる不透明なカーソル。`before_id` および `after_id` とは排他的です      |
| `before_id` | string  | いいえ | このイベント ID より前の順序のイベントを返します。`page` および `after_id` とは排他的です                     |
| `after_id`  | string  | いいえ | このイベント ID より後の順序のイベントを返します。`page` および `before_id` とは排他的です                    |

## リクエスト例

```bash theme={null}
curl -X GET "https://api.qoder.com/api/v1/cloud/sessions/sess_019f00000000000000000000000000aa/threads/sthr_019f00000000000000000000000002bb/events?limit=20" \
  -H "Authorization: Bearer $QODER_PAT"
```

## レスポンス例

```json theme={null}
{
  "data": [
    {
      "id": "evt_019f00000000000000000000000003cc",
      "type": "agent.message",
      "content": [{"type": "text", "text": "Thread response"}],
      "processed_at": "2026-06-15T08:02:00.000Z"
    }
  ],
  "first_id": "evt_019f00000000000000000000000003cc",
  "has_more": false,
  "last_id": "evt_019f00000000000000000000000003cc",
  "next_page": null
}
```

## レスポンスフィールド

| フィールド       | 型                                                                      | 説明                   |
| ----------- | ---------------------------------------------------------------------- | -------------------- |
| `data`      | [Event オブジェクト](/ja/cloud-agents/api/sessions/schemas#event-object) の配列 | thread に限定されたイベント    |
| `has_more`  | boolean                                                                | このページの先にさらに結果があるかどうか |
| `first_id`  | string \| null                                                         | 現在のページの最初のイベントの ID   |
| `last_id`   | string \| null                                                         | 現在のページの最後のイベントの ID   |
| `next_page` | string \| null                                                         | 次ページの不透明なカーソル        |

## エラー

| HTTP | タイプ                     | トリガー条件                                                           |
| ---- | ----------------------- | ---------------------------------------------------------------- |
| 400  | `invalid_request_error` | 不正な `limit`（非整数または非正値)、または `page` と `before_id`/`after_id` の同時指定 |
| 401  | `authentication_error`  | PAT が無効または期限切れ                                                   |
| 404  | `not_found_error`       | Session または thread が存在しない                                        |

**HTTP 404 Not Found**

```json theme={null}
{
  "type": "error",
  "request_id": "cb80235f-76a2-4ff3-9e28-5aa2da12dc14",
  "error": {
    "type": "not_found_error",
    "message": "Session thread 'sthr_fakefakefake_xxxxxxxxxxxxxxxx' was not found."
  },
  "request_id": "b5822072-f264-48da-9d61-6d48ffb07551"
}
```

完全なエラーエンベロープについては [エラー](/ja/cloud-agents/api/conventions/errors) を参照してください。

## 関連項目

<CardGroup cols={2}>
  <Card title="Managed Agents" icon="user-gear" href="/ja/cloud-agents/managed-agents">
    マルチ Agent 協調におけるスレッドイベントのセマンティクスを理解します。
  </Card>

  <Card title="Stream Thread Events (SSE)" icon="bolt" href="/ja/cloud-agents/api/sessions/stream-thread-events">
    Server-Sent Events でスレッドイベントをリアルタイムに受信します。
  </Card>

  <Card title="List Session Threads" icon="list" href="/ja/cloud-agents/api/sessions/list-threads">
    Session 内のすべてのスレッドを表示します。
  </Card>
</CardGroup>
