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.
POST /v1/sessions/{session_id}/events
Session にイベント(通常はユーザーメッセージ)を送信し、Agent の処理をトリガーします。これは非同期操作です。メッセージが受け付けられた後、Agent はバックグラウンドで応答を生成し、SSE ストリームまたはイベント一覧 API で結果を取得できます。
パスパラメータ
| パラメータ | 型 | 説明 |
|---|
session_id | string | Session ID(sess_ プレフィックス) |
ヘッダー
| 名称 | 必須 | 値 |
|---|
| Authorization | はい | Bearer $QODER_PAT |
| Content-Type | はい | application/json |
リクエストボディ
| フィールド | 型 | 必須 | 説明 |
|---|
events | array | はい | イベントオブジェクトの配列 |
events[].type | string | はい | イベントタイプ |
events[].content | array | 条件付き | コンテンツブロックの配列(user.message タイプ時は必須) |
events[].content[].type | string | はい | コンテンツブロックタイプ(例: text) |
events[].content[].text | string | はい | テキスト内容 |
サポートされるイベントタイプ
| type | 説明 | 必須フィールド |
|---|
user.message | ユーザーがメッセージを送信 | content |
user.interrupt | ユーザーが Agent の実行を中断 | - |
user.define_outcome | ユーザーが期待結果を定義 | content |
リクエスト例
curl -X POST https://openapi.qoder.sh/api/v1/cloud/sessions/sess_019e392c0d1e74e095d21ea4c6b41def/events \
-H "Authorization: Bearer $QODER_PAT" \
-H "Content-Type: application/json" \
-d '{
"events": [
{
"type": "user.message",
"content": [
{"type": "text", "text": "このコードのパフォーマンス問題を分析してください"}
]
}
]
}'
レスポンス例
HTTP 202 Accepted
作成されたイベント一覧を返します。HTTP 202 はメッセージが受け付けられ、処理キューに入ったことを示します。
{
"data": [
{
"id": "evt_019e3bb2c153764da54e4d3acbef52b6",
"type": "user.message",
"content": [
{"type": "text", "text": "このコードのパフォーマンス問題を分析してください"}
],
"session_id": "sess_019e392c0d1e74e095d21ea4c6b41def",
"turn_id": "turn_019e3bb2c15376429b88e1f7976c1907",
"schema_version": "1.0",
"created_at": "2026-05-18T15:27:11.187413896Z",
"processed_at": "2026-05-18T15:27:11.187413896Z"
}
]
}
イベントレスポンスフィールド
| フィールド | 型 | 説明 |
|---|
id | string | イベントの一意識別子(evt_ プレフィックス) |
type | string | イベントタイプ |
content | array | コンテンツブロックの配列 |
session_id | string | 所属する Session ID |
turn_id | string | 所属する Turn ID(turn_ プレフィックス)、サーバー側で自動割当 |
schema_version | string | Schema バージョン |
created_at | string | 作成時刻(ISO 8601) |
processed_at | string | 処理時刻(ISO 8601) |
メモ: メッセージ送信後、Agent は非同期で処理を開始します。GET /v1/sessions/{id}/events/stream で Agent の応答イベントをリアルタイムに監視できます。
エラーレスポンス
| HTTP | type | 説明 |
|---|
| 400 | invalid_request_error | content フィールドの欠落または形式エラー |
| 401 | authentication_error | PAT が無効または期限切れ |
| 404 | not_found_error | Session が存在しない |
| 409 | conflict_error | Session が処理中で新しいメッセージを受け付けられない |
エラー例
{
"error": {
"message": "Field 'content' is required.",
"type": "invalid_request_error"
},
"type": "error"
}