Skip to main content
POST
Create a WebSocket trigger

Authorizations

hookie_session
string
cookie
required

The console's sealed session cookie, set by WorkOS AuthKit. Mutating requests also require the X-Requested-With CSRF header.

Path Parameters

project_id
string
required

Body

application/json
name
string
required
Required string length: 1 - 80
url
string
required

Must start with ws:// or wss://. Encrypted at rest with the rest of the connection config.

headers
object

Connection headers. Encrypted; never returned.

subprotocols
string[]
connect_message
string | null

Sent once on connect (e.g. a subscribe frame).

conditions
object[]

Frame filter. An empty array matches every frame. Not validated at write time.

mappings
object[] | null

Optional [{path,key}] field mappings. Stored as null when not an array.

dataset
string | null

Response

Created, enabled, and the WsListener Durable Object is armed immediately. NOTE: this handler returns 200, not 201.

id
string
required