Create Session
Create a new session directly via the Platform Service.
Request
POST /v1/sessionsHeaders
| Header | Value |
|---|---|
Authorization | Bearer YOUR_API_KEY |
Content-Type | application/json |
Body
| Field | Type | Required | Description |
|---|---|---|---|
metadata | object | No | Arbitrary metadata to attach to the session |
timeout | number | No | Session timeout in seconds |
Response
200 OK
{
"id": "session_xyz789",
"client_token": "ct_...",
"worker_token": "wt_...",
"phase": "created",
"created_at": "2025-01-01T00:00:00Z"
}Notes
- Proxied to the Session Service via service binding
- Session ownership is tracked in D1 for access control
- Use the returned tokens to connect via WebSocket
Last updated on