Skip to main content

Create flow

Enterprise Only
This API is available exclusively in Countly Enterprise.

Endpoint

/i/flows/create

Overview

Creates a flow schema definition.

Authentication

Countly API supports three authentication methods:

  1. API key query parameter: api_key=YOUR_API_KEY
  2. Auth token query parameter: auth_token=YOUR_AUTH_TOKEN
  3. Auth token header: countly-token: YOUR_AUTH_TOKEN

Permissions

Requires flows Create permission.

Request Parameters

ParameterTypeRequiredDescription
app_idStringYesTarget app ID.
nameStringYesFlow name.
typeStringNoevents or views. Default: events.
startJSON String (Object)NoStart node object.
endJSON String (Object)NoEnd node object.
excludeJSON String (Array)NoExcluded path items.
user_segmentationJSON String (Object)NoUser filter object.
periodString or JSON String (Array/Object)NoDefault 30days.
disabledBoolean/StringNoDisabled flag.
api_keyStringConditionalRequired if auth_token is not provided.
auth_tokenStringConditionalRequired if api_key is not provided.

Response

Success Response

{
"result": "Success"
}

Response Fields

FieldTypeDescription
resultStringSuccess when flow schema is inserted.

Error Responses

  • 400
{
"result": "Missing request parameter:app_id"
}
  • 400
{
"result": "Missing request parameter:name"
}
  • 400
{
"result": "type must be one of: events, views"
}
  • 400
{
"result": "Bad request parameter: period"
}
  • 400
{
"result": "data base error. Please check logs."
}

Behavior/Processing

  • Parses JSON inputs: start, end, exclude, user_segmentation, optional period payload.
  • Defaults to start.event = [CLY]_session if both start/end events are missing.
  • Removes vid unless event is [CLY]_view.
  • Removes cid unless event is [CLY]_crash.
  • Creates schema with _id = <app_id>_<ObjectId>, status = new, and creator metadata.

Database Collections

CollectionUsed forData touched by this endpoint
countly.flow_schemasEndpoint data sourceStores endpoint-related records this endpoint reads or modifies.
countly.systemlogsAudit trailContains system action records used by this endpoint for audit output or audit writes.

Examples

/i/flows/create?
app_id=64f5c0d8f4f7ac0012ab3456&
name=Signup to Purchase&
type=events&
start={"event":"signup"}&
end={"event":"purchase"}&
exclude=[]&
user_segmentation={"cc":"US"}&
period=30days


Use Cases

  1. Conversion path flow Tracks users from signup to purchase.
/i/flows/create?
app_id=64f5c0d8f4f7ac0012ab3456&
name=Signup to Purchase&
type=events&
start={"event":"signup"}&
end={"event":"purchase"}&
period=30days
  1. Onboarding navigation flow Tracks screen progression for view-based onboarding.
/i/flows/create?
app_id=64f5c0d8f4f7ac0012ab3456&
name=Onboarding Views&
type=views&
start={"event":"[CLY]_view","vid":"welcome_screen"}&
end={"event":"[CLY]_view","vid":"home_screen"}&
period=7days
  1. Crash-ending flow Tracks paths that end in a specific crash group.
/i/flows/create?
app_id=64f5c0d8f4f7ac0012ab3456&
name=Checkout to Crash&
type=events&
start={"event":"checkout_start"}&
end={"event":"[CLY]_crash","cid":"67aef9ad7c2f4c0012ab33aa"}&
period=30days
  1. Region-specific flow Creates the same journey for a filtered audience.
/i/flows/create?
app_id=64f5c0d8f4f7ac0012ab3456&
name=US Signup to Purchase&
type=events&
start={"event":"signup"}&
end={"event":"purchase"}&
user_segmentation={"cc":"US"}&
period=30days

Last Updated

2026-02-16