Skip to content

Websockets API Documentation

Overview

The Websockets API provides real-time event streaming capabilities for task and application events.

Endpoint

wss://ws.journeyid.com

Establishes a WebSocket connection for receiving real-time events.

Connection Protocol

After connection, client must send a CONNECT message with a valid WebSocket token:

CONNECT <ws_token>

Event Types

  • task.sent Send an SMS to the customer
  • task_bootstrapped Customer opened the link in their browser
  • task.started Customer began the task
  • task.succeeded Customer completed the task
  • task.failed Customer failed to complete the task
  • task.timed_out Customer didn't complete the task in time

Custom Application Events

  • webauthn.timeout_or_cancelled (Passkeys app)
  • biometrics.consent (Passkeys app)

Event Format

typescript
{
  id: string
  type: string
  timestamp: string
  error?: string
  payload?: {
    id: string
    app: string
    timestamp: string
    status?: string
    event?: string
    request: {
      id: string
    }
    session: {
      ref: string
    }
    customer: {
      ref: string
    }
    delivery: {
      method: string
      phoneNumber?: string
    }

    // App-specific metadata

    // task.succeeded
    "e-form"?: {
      form: {
        id: string
        title: string
      }
      data?: Record<string, any>
    }
  }
}

Error Event Format

typescript
{
  id: string
  type: string
  timestamp: string
  error: string
}