/flows/:slug

GET / POST

Flow 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.

Native SDKs Coming Soon

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/:slug

Request

Request
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
ParameterTypeDescription
slugRequiredstringFlow slug/identifier (in URL path)
installIdstringInstall ID for analytics linking. Omit when tracking is disabled (enableTracking: false) — the flow is served anonymously with no session recorded.
versionIdstringCached version ID. If provided and still in the active set, returns cached: true and the SDK renders from local cache.

Response (Success)

Response
{
  "versionId": "clx123abc",
  "html": "<!DOCTYPE html>...",
  "css": ".container { ... }",
  "js": "document.addEventListener('DOMContentLoaded', ...)"
}
PropertyTypeDescription
versionIdstringUnique version identifier
htmlstringFlow HTML content
cssstringFlow CSS (may be embedded in HTML)
jsstringFlow JavaScript (may be embedded in HTML)

Response (Cached)

If the client's cached versionId is still in the active set, the server confirms it instead of re-sending content. The SDK renders from local cache keeping the install sticky to its assigned variant for A/B testing.

Response
{
  "cached": true,
  "versionId": "clx123abc"
}

Response (Error)

Response
{
  "error": "NOT_FOUND"
}
PropertyTypeDescription
errorstringError code: NOT_FOUND, PLAN_REQUIRED, or FLOW_LIMIT_EXCEEDED

Track Flow Event#

Endpoint

POST https://YOUR_APP_ID.mobana.ai/flows/:slug/events

Request

Request
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" },
  "placement": "post_signup"
}
ParameterTypeDescription
slugRequiredstringFlow slug/identifier (in URL path)
installIdRequiredstringInstall ID. When tracking is disabled, the SDK does not call this endpoint — events are suppressed client-side.
versionIdRequiredstringFlow version that was shown
sessionIdRequiredstringUnique session ID for this flow presentation
eventRequiredstringEvent name (e.g., 'step_1_completed', '__completed__')
stepnumberOptional step number for multi-step flows
dataobjectOptional event data (stored as JSON)
placementstringWhere in the host app the flow was triggered (analytics dimension). Max 64 characters, pattern /^[a-z0-9_\-.:/]+$/i. Invalid values are silently ignored. Automatically set by the React Native SDK when you pass placement to startFlow().

Response

Response
{ "success": true }
Silent Success

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 active versions, the server picks one on the first fetch and returns its versionId alongside the content. The SDK caches it locally and sends it back as versionId on subsequent fetches. As long as that version is still in the active set, the server replies cached: true and the SDK renders from cache — so the same install consistently sees the same variant across presentations, regardless of whether tracking is enabled.

Reassignment happens automatically when the cached version is deactivated in the dashboard: the server picks a new variant from the remaining active set, returns its content, and the SDK overwrites its cache.

AI agents: for complete Mobana SDK & API documentation, get full context here or visit llms.txt