Skip to main content
Version: 24.05

Create flow

Enterprise

This endpoint is part of Countly Enterprise. To get access, contact sales or compare versions. Existing customers can reach the support portal with questions.

Endpoint​

/i/flows/create

Overview​

Creates a flow schema definition.

Authentication​

Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.

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.

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

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​

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

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
Implementation details

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.