Skip to main content

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

ParameterTypeDescription
session_idstringSession ID with the sess_ prefix

Headers

HeaderRequiredDescription
AuthorizationYesBearer $QODER_PAT
Content-TypeYesapplication/json

Request body

FieldTypeRequiredDescription
eventsarrayYesArray of event objects
events[].typestringYesEvent type
events[].contentarrayConditionalArray of content blocks (required when type is user.message)
events[].content[].typestringYesContent block type, e.g. text
events[].content[].textstringYesText content

Supported event types

TypeDescriptionRequired fields
user.messageUser sends a messagecontent
user.interruptUser interrupts agent execution
user.define_outcomeUser defines the expected outcomecontent

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

FieldTypeDescription
idstringEvent unique identifier with the evt_ prefix
typestringEvent type
contentarrayArray of content blocks
session_idstringOwning Session ID
turn_idstringOwning Turn ID with the turn_ prefix, assigned by the server
schema_versionstringSchema version
created_atstringCreation time (ISO 8601)
processed_atstringProcessing 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

HTTPTypeTrigger
400invalid_request_errorMissing content field or malformed payload
401authentication_errorPAT invalid or expired
404not_found_errorSession does not exist
409conflict_errorSession 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.