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
Sends an event to a session, typically a user message, triggering the agent to begin processing. This is an asynchronous operation: the message is accepted and the agent generates a reply in the background. Results can be retrieved through the SSE stream or the list events endpoint.
Path parameters
| Parameter | Type | Description |
|---|
session_id | string | Session ID with the sess_ prefix |
| Header | Required | Description |
|---|
Authorization | Yes | Bearer $QODER_PAT |
Content-Type | Yes | application/json |
Request body
| Field | Type | Required | Description |
|---|
events | array | Yes | Array of event objects |
events[].type | string | Yes | Event type |
events[].content | array | Conditional | Array of content blocks (required when type is user.message) |
events[].content[].type | string | Yes | Content block type, e.g. text |
events[].content[].text | string | Yes | Text content |
Supported event types
| Type | Description | Required fields |
|---|
user.message | User sends a message | content |
user.interrupt | User interrupts agent execution | – |
user.define_outcome | User defines the expected outcome | content |
Example request
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": "Help me analyze the performance of this code."}
]
}
]
}'
Example response
HTTP 202 Accepted
Returns the list of created events. HTTP 202 indicates the message has been accepted into the processing queue.
{
"data": [
{
"id": "evt_019e3bb2c153764da54e4d3acbef52b6",
"type": "user.message",
"content": [
{"type": "text", "text": "Help me analyze the performance of this code."}
],
"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"
}
]
}
Response fields
| Field | Type | Description |
|---|
id | string | Event unique identifier with the evt_ prefix |
type | string | Event type |
content | array | Array of content blocks |
session_id | string | Owning Session ID |
turn_id | string | Owning Turn ID with the turn_ prefix, assigned by the server |
schema_version | string | Schema version |
created_at | string | Creation time (ISO 8601) |
processed_at | string | Processing time (ISO 8601) |
After sending a message, the agent processes asynchronously. Subscribe to GET /v1/sessions/{session_id}/events/stream to listen for agent response events in real time.
Errors
| HTTP | Type | Trigger |
|---|
| 400 | invalid_request_error | Missing content field or malformed payload |
| 401 | authentication_error | PAT invalid or expired |
| 404 | not_found_error | Session does not exist |
| 409 | conflict_error | Session is processing and cannot accept new messages |
Error response example
{
"error": {
"message": "Field 'content' is required.",
"type": "invalid_request_error"
},
"type": "error"
}
See Errors for the full error envelope.