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.
GET /v1/sessions/{session_id}/events
Session 内のイベント一覧を時系列順(昇順)で取得します。カーソルページネーションをサポートします。
パスパラメータ
| パラメータ | 型 | 説明 |
|---|
session_id | string | Session ID(sess_ プレフィックス) |
ヘッダー
| 名称 | 必須 | 値 |
|---|
| Authorization | はい | Bearer $QODER_PAT |
クエリパラメータ
| パラメータ | 型 | 必須 | 説明 |
|---|
limit | integer | いいえ | 返却件数の上限、デフォルト 20 |
after_id | string | いいえ | カーソルページネーション:このイベント ID 以降のレコードを返す |
before_id | string | いいえ | カーソルページネーション:このイベント ID 以前のレコードを返す |
リクエスト例
curl -X GET "https://openapi.qoder.sh/api/v1/cloud/sessions/sess_019e392c0d1e74e095d21ea4c6b41def/events?limit=5" \
-H "Authorization: Bearer $QODER_PAT"
レスポンス例
HTTP 200 OK
{
"data": [
{
"id": "evt_019e392c0d787cfaa21bda98e06cd913",
"type": "user.message",
"content": "こんにちは、テストメッセージです",
"session_id": "sess_019e392c0d1e74e095d21ea4c6b41def",
"turn_id": "turn_019e392c0d787ceea6bb62943f9ac3ec",
"schema_version": "1.0",
"created_at": "2026-05-18T03:40:48.888851795Z",
"processed_at": "2026-05-18T03:40:48.888851795Z"
},
{
"id": "evt_771c1195bcbd4a07834d4ed4dd6450ca",
"type": "session.status_rescheduled",
"session_id": "sess_019e392c0d1e74e095d21ea4c6b41def",
"turn_id": "turn_019e392c0d787ceea6bb62943f9ac3ec",
"schema_version": "1.0",
"created_at": "2026-05-18T03:40:50.321Z",
"processed_at": "2026-05-18T03:40:50.321Z"
}
],
"first_id": "evt_019e392c0d787cfaa21bda98e06cd913",
"last_id": "evt_771c1195bcbd4a07834d4ed4dd6450ca",
"has_more": true
}
イベントタイプリファレンス
| type | 説明 | 固有フィールド |
|---|
user.message | ユーザーメッセージ | content (string) |
agent.message | Agent の応答 | content (ContentBlock[]) |
agent.thinking | Agent の思考 | - |
session.status_rescheduled | Session が実行スケジュールされた | - |
session.status_idle | Session がアイドルに戻った | usage, status, stop_reason |
session.error | Session 実行エラー | error, details, retry_status |
span.model_request_start | モデルリクエスト開始 | - |
span.model_request_end | モデルリクエスト終了 | - |
terminated | 実行終了 | - |
agent.message の content 形式
{
"content": [
{
"type": "text",
"text": "Agent の応答テキスト内容"
}
]
}
session.status_idle の追加フィールド
{
"type": "session.status_idle",
"status": "idle",
"usage": {
"input_tokens": 150,
"output_tokens": 42,
"cache_read_input_tokens": 0,
"cache_creation_input_tokens": 0
},
"stop_reason": {
"type": "end_turn"
}
}
session.error 形式
{
"type": "session.error",
"error": {
"message": "The operation was aborted due to timeout",
"type": "unknown_error"
},
"details": {
"message": "The operation was aborted due to timeout",
"name": "TimeoutError"
},
"retry_status": {
"type": "exhausted"
}
}
ページネーションフィールド
| フィールド | 型 | 説明 |
|---|
data | array | イベントオブジェクトリスト |
first_id | string | 現在ページ先頭レコードの ID |
last_id | string | 現在ページ末尾レコードの ID |
has_more | boolean | さらにレコードがあるかどうか |
エラーレスポンス
| HTTP | type | 説明 |
|---|
| 401 | authentication_error | PAT が無効または期限切れ |
| 404 | not_found_error | Session が存在しない |