Docs

POST /api/v1/runtime/session/init

Initialize a new flow session for a customer.

Request

POST /api/v1/runtime/session/init
Content-Type: application/json

{
  "flow_slug": "pro-plan-cancel-abc123"
}

Response (201)

{
  "session_id": "uuid",
  "flow": {
    "name": "Pro Plan Cancellation",
    "branding": {
      "primary_color": "#2563EB",
      "logo_url": "https://..."
    },
    "entry_node": {
      "key": "node_start",
      "type": "start",
      "config": { "title": "Cancellation Request" }
    }
  }
}

Errors

StatusReason
400Invalid request body
403Workspace session limit reached
404Flow not found or not published

Notes

  • This endpoint is public (no auth required) — it's called from the widget
  • Creates a flow_session record with status "in_progress"
  • Increments the workspace usage counter
  • Returns the flow's entry node so the widget knows what to render first