SessionEvent

Read and write session event information

SessionEvent object

Attributes

object

Object

id

String

The unique identifier for the session event

type

Enum

The type of session event

session_id

String

The ID of the related session

server_run

Object

server_run_error

Object

log_lines

Array of Objects

Array of log lines associated with the event

created_at

Date

Timestamp when the event was created

{
"object": "session.event",
"id": "example_id",
"type": "server_logs",
"session_id": "example_session_id",
"server_run": {
"object": "server.server_run",
"id": "example_id",
"type": "hosted",
"status": "active",
"server_version_id": "example_server_version_id",
"server": {
"object": "server#preview",
"id": "example_id",
"name": "example_name",
"description": "example_description",
"type": "public",
"created_at": "2025-07-20T12:25:38.980Z",
"updated_at": "2025-07-20T12:25:38.980Z"
},
"server_deployment": {
"object": "server.server_deployment#preview",
"id": "example_id",
"name": "example_name",
"description": "example_description",
"metadata": {},
"created_at": "2025-07-20T12:25:38.980Z",
"updated_at": "2025-07-20T12:25:38.980Z",
"server": {
"object": "server#preview",
"id": "example_id",
"name": "example_name",
"description": "example_description",
"type": "public",
"created_at": "2025-07-20T12:25:38.980Z",
"updated_at": "2025-07-20T12:25:38.980Z"
}
},
"server_session": {
"object": "session.server_session#preview",
"id": "example_id",
"status": "active",
"mcp": {
"object": "mcp",
"version": "example_version",
"connection_type": "sse",
"client": {
"object": "session.server_session.client",
"name": "example_name",
"version": "example_version",
"capabilities": {}
},
"server": {
"object": "session.server_session.server",
"name": "example_name",
"version": "example_version",
"capabilities": {}
}
},
"usage": {
"total_productive_message_count": 0,
"total_productive_client_message_count": 0,
"total_productive_server_message_count": 0
},
"session_id": "example_session_id",
"created_at": "2025-07-20T12:25:38.980Z"
},
"created_at": "2025-07-20T12:25:38.980Z",
"updated_at": "2025-07-20T12:25:38.980Z",
"started_at": "2025-07-20T12:25:38.980Z",
"stopped_at": "2025-07-20T12:25:38.980Z"
},
"server_run_error": {
"object": "server.server_run.error",
"id": "example_id",
"code": "example_code",
"message": "example_message",
"metadata": {},
"server_run": {
"object": "server.server_run",
"id": "example_id",
"type": "hosted",
"status": "active",
"server_version_id": "example_server_version_id",
"server": {
"object": "server#preview",
"id": "example_id",
"name": "example_name",
"description": "example_description",
"type": "public",
"created_at": "2025-07-20T12:25:38.980Z",
"updated_at": "2025-07-20T12:25:38.980Z"
},
"server_deployment": {
"object": "server.server_deployment#preview",
"id": "example_id",
"name": "example_name",
"description": "example_description",
"metadata": {},
"created_at": "2025-07-20T12:25:38.980Z",
"updated_at": "2025-07-20T12:25:38.980Z",
"server": {
"object": "server#preview",
"id": "example_id",
"name": "example_name",
"description": "example_description",
"type": "public",
"created_at": "2025-07-20T12:25:38.980Z",
"updated_at": "2025-07-20T12:25:38.980Z"
}
},
"server_session": {
"object": "session.server_session#preview",
"id": "example_id",
"status": "active",
"mcp": {
"object": "mcp",
"version": "example_version",
"connection_type": "sse",
"client": {
"object": "session.server_session.client",
"name": "example_name",
"version": "example_version",
"capabilities": {}
},
"server": {
"object": "session.server_session.server",
"name": "example_name",
"version": "example_version",
"capabilities": {}
}
},
"usage": {
"total_productive_message_count": 0,
"total_productive_client_message_count": 0,
"total_productive_server_message_count": 0
},
"session_id": "example_session_id",
"created_at": "2025-07-20T12:25:38.980Z"
},
"created_at": "2025-07-20T12:25:38.980Z",
"updated_at": "2025-07-20T12:25:38.980Z",
"started_at": "2025-07-20T12:25:38.980Z",
"stopped_at": "2025-07-20T12:25:38.980Z"
},
"created_at": "2025-07-20T12:25:38.980Z"
},
"log_lines": [
{
"type": "stdout",
"line": "example_line"
},
{
"type": "stdout"
}
],
"created_at": "2025-07-20T12:25:38.980Z"
}

List session events

List all events for a specific session

URL Parameters

sessionId

String

The unique identifier for the session

GEThttp://api.metorial.com/sessions/:sessionId/events
curl -X GET "https://api.metorial.com/sessions/ses_Rm4Mnheq2bfEPhBhP7SY/events" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer metorial_sk_..."

Get session event

Get details of a specific session event

URL Parameters

sessionId

String

The unique identifier for the session

sessionEventId

String

The unique identifier for the sessionEvent

GEThttp://api.metorial.com/sessions/:sessionId/events/:sessionEventId
curl -X GET "https://api.metorial.com/sessions/ses_Rm4Mnheq2bfEPhBhP7SY/events/ses_Rm4Mnheq2bfEPhBhP7SY" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer metorial_sk_..."