> ## 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.

# Session スレッドの取得

> managed-agent Session 内のスレッドを 1 つ取得します。

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

Session スレッドを 1 つ返します。

## パスパラメータ

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

## ヘッダー

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

## リクエスト例

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

## レスポンス例

```json theme={null}
{
  "id": "sthr_019f00000000000000000000000002bb",
  "type": "session_thread",
  "session_id": "sess_019f00000000000000000000000000aa",
  "parent_thread_id": "sthr_019f00000000000000000000000001aa",
  "agent": {"id": "agent_019f000000000000000000000000002b", "type": "agent", "version": 2},
  "status": "running",
  "stats": null,
  "archived_at": null,
  "created_at": "2026-06-15T08:01:00.000Z",
  "updated_at": "2026-06-15T08:01:00.000Z"
}
```

レスポンスの構造については [Session Thread オブジェクト](/ja/cloud-agents/api/sessions/schemas#session-thread-object) を参照してください。

## エラー

| HTTP | type                   | トリガー条件                |
| ---- | ---------------------- | --------------------- |
| 401  | `authentication_error` | PAT が無効または期限切れ        |
| 404  | `not_found_error`      | Session またはスレッドが存在しない |

**HTTP 404 Not Found**（Session が存在しない）

```json theme={null}
{
  "type": "error",
  "request_id": "cb80235f-76a2-4ff3-9e28-5aa2da12dc14",
  "error": {
    "type": "not_found_error",
    "message": "Session 'sess_doesnotexist_xxxxxxxxxxxxxxxxxxxxxxxx' was not found."
  }
}
```

**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."
  }
}
```

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