Write user or system input events to a Forward Session.
Request headers
|
Header |
Required |
Description |
|
Authorization |
Yes |
|
|
Content-Type |
Yes |
|
|
Idempotency-Key |
No |
Optional idempotency key for requests with side effects. |
Path parameters
|
Parameter |
Type |
Required |
Description |
|
|
string |
Yes |
Session ID. |
Request body
|
Field |
Type |
Required |
Description |
|
|
array |
Yes |
Array of event objects |
|
|
string |
Yes |
Event type |
|
|
string \ |
array |
Depends on type |
|
|
string |
Yes |
Content block type, e.g. |
|
|
string |
Yes |
Text content |
content supports two formats:
-
Shorthand: plain string
"content": "text content" -
Full: content block array
"content": [{"type": "text", "text": "text content"}]
Use the shorthand format for plain text messages. Use the full format when sending multimedia content such as images.
Supported event types
|
type |
Description |
Required fields |
|
|
User sends a message |
|
|
|
User interrupts Agent execution |
- |
|
|
Authorize a tool call from the Agent |
|
|
|
Return the execution result of a custom tool |
|
|
|
User defines the expected outcome |
|
Example request
curl -s -X POST 'https://api.qoder.com.cn/api/v1/forward/sessions/sess_xxx/events' \
-H "Authorization: Bearer $QODER_PAT" \
-H "Content-Type: application/json" \
-d '{
"events": [
{
"type": "user.message",
"content": [
{
"type": "text",
"text": "Continue the analysis."
}
],
"file_attachments": []
}
]
}'
Example response
HTTP 200 OK
{
"data": [
{
"id": "evt_xxx",
"type": "user.message",
"session_id": "sess_xxx",
"content": [
{
"type": "text",
"text": "Continue the analysis."
}
],
"processed_at": "2026-06-22T11:00:00Z"
}
]
}
Response fields
|
Field |
Type |
Description |
|
|
array |
Array of created Event objects, filtered according to Forward rules. |
Errors
|
HTTP |
Type |
Code |
Condition |
|
400 |
|
|
Event type or fields are invalid. |
|
404 |
|
|
Session does not exist. |
|
409 |
|
|
Session is archived. |
|
409 |
|
|
Current turn state does not allow a new turn. |
|
404 |
|
|
No matching pending action found for the tool confirmation or result. |
|
409 |
|
|
Pending action has already been resolved. |
|
401 |
|
|
PAT is invalid or expired. |
Notes
-
Allowed types include
user.message,user.interrupt,user.tool_confirmation,user.tool_result,user.custom_tool_result,user.define_outcome, andsystem.message. -
system.messageis limited to one per request and must be the last event. -
The response does not return the raw runtime event JSON.