全部產品
Search
文件中心

Qoder CN 系列:查詢 Event 歷史

更新時間:Jul 02, 2026

分頁查詢 Forward Session 的事件歷史。

要求標頭

Header

是否必填

說明

Authorization

Bearer <PAT>

路徑參數

參數

類型

是否必填

說明

session_id

string

Session ID。

查詢參數

參數

類型

是否必填

預設值

說明

limit

integer

20

分頁大小,最大 100。

after_id

string

-

返回該 Event ID 之後的事件。

before_id

string

-

返回該 Event ID 之前的事件。

order

string

asc

排序方向:ascdesc

type

string

-

按 Event 類型過濾,支援逗號分隔。

types[]

string

-

數組形式的 Event 類型過濾。

include_tool_calls

boolean

true

是否包含工具調用類事件。

include_thinking

boolean

true

是否包含思考過程事件。

樣本請求

curl -s -X GET 'https://api.qoder.com.cn/api/v1/forward/sessions/sess_xxx/events' \
  -H "Authorization: Bearer $QODER_PAT"

樣本響應

HTTP 200 OK

{
  "data": [
    {
      "id": "evt_xxx",
      "type": "agent.message",
      "session_id": "sess_xxx",
      "content": [
        {
          "type": "text",
          "text": "Here is the analysis result."
        }
      ],
      "processed_at": "2026-06-22T11:00:03Z"
    }
  ],
  "first_id": "evt_xxx",
  "last_id": "evt_xxx",
  "has_more": false
}

響應欄位

欄位

類型

說明

data

array

當前頁的 Event 對象。

first_id

string|null

當前頁第一條 Event ID。

last_id

string|null

當前頁最後一條 Event ID。

has_more

boolean

是否還有更多記錄。

Event 對象欄位

欄位

類型

說明

id

string

Event ID。

type

string

Event 類型。

session_id

string

Session ID。

processed_at

string

事件處理時間;部分事件可能沒有該欄位。

content

array

message 類事件會返回。

按類型允許的 payload 欄位

下表欄位不包含通用 envelope 欄位 idtypesession_idprocessed_at

Event 類型

payload 欄位

user.message

contentfile_attachments

user.interrupt

reasonsession_thread_id

user.tool_confirmation

tool_use_idresultdeny_messagesession_thread_id

user.tool_result

tool_use_idcontentis_errorsession_thread_id

user.custom_tool_result

custom_tool_use_idcontentis_errorsession_thread_id

user.define_outcome

descriptionrubricoutcome_idmax_iterations

system.message

content

agent.message

content

agent.thinking

agent.message_start

message_idmessage

agent.content_block_start

message_idindexcontent_block

agent.content_block_delta

message_idindexdelta

agent.content_block_stop

message_idindex

agent.message_delta

message_iddeltausage

agent.message_stop

message_id

agent.tool_use

nameinputevaluated_permissionsession_thread_id

agent.tool_result

tool_use_idcontentis_error

agent.custom_tool_use

nameinputsession_thread_id

agent.mcp_tool_use

mcp_server_namenameinputevaluated_permissionsession_thread_id

agent.mcp_tool_result

mcp_tool_use_idcontentis_error

agent.artifact_delivered

file_idoriginal_filenamesizecontent_type

session.status_running

session.status_idle

stop_reason

session.status_terminated

session.error

error

session.updated

agentmetadatatitle

未知類型

僅返回 envelope,不返回運行時私人原始 payload。

錯誤

HTTP

Type

Code

觸發條件

400

invalid_request_error

invalid_event_cursor

遊標不屬於當前 Session。

400

invalid_request_error

invalid_pagination

分頁參數不合法。

404

not_found_error

session_not_found

Session 不存在。

401

authentication_error

authentication_required

PAT 無效或已到期。

備忘

  • 未知 Event 類型不會導致請求失敗;可用時會以最小 envelope 返回。

  • Forward 預設過濾 agent ID、environment ID、resources、vaults、worker、trace、raw/debug/internal 等運行時私人欄位。

相關