/flows/:slug
GET / POSTFlow content and event tracking endpoints.
Overview#
These endpoints serve flow content and track flow events. They're called automatically by the React Native SDK when you use startFlow().
If you're building a native iOS, Android, or Flutter app without React Native, you can use these endpoints directly to integrate flows into your app. Fetch the flow HTML/CSS/JS, render it in a WebView, and use the event endpoint to track user interactions.
We're working on native Swift and Kotlin SDKs that will handle all of this for you. In the meantime, these endpoints give you everything you need to build a custom integration.
Get Flow Content#
Endpoint
GET https://YOUR_APP_ID.mobana.ai/flows/:slugRequest
GET https://YOUR_APP_ID.mobana.ai/flows/onboarding
X-App-Key: YOUR_APP_KEY
# With installId (when tracking is enabled):
GET https://YOUR_APP_ID.mobana.ai/flows/onboarding?installId=520e8400-c466-a554-40e0-0
X-App-Key: YOUR_APP_KEY| Parameter | Type | Description |
|---|---|---|
slugRequired | string | Flow slug/identifier (in URL path) |
installId | string | Install ID for analytics and consistent A/B version assignment. Omit when tracking is disabled (enableTracking: false) — the flow is served anonymously with no session recorded. |
versionId | string | Cached version ID. If provided and matches current version, returns cached: true instead of full content. |
Response (Success)
{
"versionId": "clx123abc",
"html": "<!DOCTYPE html>...",
"css": ".container { ... }",
"js": "document.addEventListener('DOMContentLoaded', ...)"
}| Property | Type | Description |
|---|---|---|
versionId | string | Unique version identifier |
html | string | Flow HTML content |
css | string | Flow CSS (may be embedded in HTML) |
js | string | Flow JavaScript (may be embedded in HTML) |
Response (Cached)
If the client's cached version matches the current version:
{
"cached": true
}Response (Error)
{
"error": "NOT_FOUND"
}| Property | Type | Description |
|---|---|---|
error | string | Error code: NOT_FOUND, PLAN_REQUIRED, or FLOW_LIMIT_EXCEEDED |
Track Flow Event#
Endpoint
POST https://YOUR_APP_ID.mobana.ai/flows/:slug/eventsRequest
POST https://YOUR_APP_ID.mobana.ai/flows/onboarding/events
Content-Type: application/json
X-App-Key: YOUR_APP_KEY
{
"installId": "520e8400-c466-a554-40e0-0",
"versionId": "clx123abc",
"sessionId": "session-uuid-123",
"event": "step_1_completed",
"data": { "selectedOption": "premium" }
}| Parameter | Type | Description |
|---|---|---|
slugRequired | string | Flow slug/identifier (in URL path) |
installIdRequired | string | Install ID. When tracking is disabled, the SDK does not call this endpoint — events are suppressed client-side. |
versionIdRequired | string | Flow version that was shown |
sessionIdRequired | string | Unique session ID for this flow presentation |
eventRequired | string | Event name (e.g., 'step_1_completed', '__completed__') |
step | number | Optional step number for multi-step flows |
data | object | Optional event data (stored as JSON) |
Response
{ "success": true }Like /conversion, this endpoint uses the silent success pattern. It always returns success, even for invalid requests.
System Events#
These events are tracked automatically by the SDK:
__started__— Flow was shown__completed__— User completed the flow__dismissed__— User dismissed the flow
A/B Testing#
When a flow has multiple published versions, the API randomly selects one. When an installId is present, the same install consistently sees the same version across requests, enabling reliable A/B testing. Without an installId (i.e., when tracking is disabled), a random version is selected on each request.