Skip to main content
Version: 25.03

Update funnel

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/funnels/edit

Overview​

Updates existing funnel definitions using funnel_map.

Authentication​

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

Permissions​

Requires funnels Update permission.

Request Parameters​

ParameterTypeRequiredDescription
app_idStringYesTarget app ID.
funnel_mapJSON String (Object)YesMap of funnel_id -> update payload.
api_keyStringConditionalRequired if auth_token is not provided.
auth_tokenStringConditionalRequired if api_key is not provided.

funnel_map Payload​

FieldTypeRequiredDescription
funnel_nameStringConditionalFunnel name to update.
funnel_descStringConditionalFunnel description to update.
funnel_typeStringConditionalFunnel type (session-independent or same-session).
stepsJSON String (Array)ConditionalUpdated step events.
queriesJSON String (Array)ConditionalUpdated per-step query definitions.
queryTextsJSON String (Array)ConditionalUpdated per-step query text labels.
stepGroupsJSON String (Array)ConditionalUpdated per-step grouping config.
orderNumberConditionalFunnel order update (when only ordering is changed).

Examples​

/i/funnels/edit?
app_id=64f5c0d8f4f7ac0012ab3456&
funnel_map={
"67f1c22912df5acb8f8d5caaf0f89a31": {
"funnel_name": "Purchase Funnel v2",
"funnel_desc": "Added checkout step",
"funnel_type": "session-independent",
"steps": "[\"Product View\",\"Add to Cart\",\"Checkout\",\"Purchase\"]",
"queries": "[\"{}\",\"{}\",\"{}\",\"{}\"]",
"queryTexts": "[\"All Users\",\"All Users\",\"All Users\",\"All Users\"]",
"stepGroups": "[{\"c\":\"and\"},{\"c\":\"and\"},{\"c\":\"and\"},{\"c\":\"and\"}]"
}
}
/i/funnels/edit?
app_id=64f5c0d8f4f7ac0012ab3456&
funnel_map={
"67f1c22912df5acb8f8d5caaf0f89a31": {
"order": 1
}
}

Response​

Success Response​

{
"result": "Success"
}

Response Fields​

FieldTypeDescription
resultStringUpdate result message.

Error Responses​

  • 400
{
"result": "Not enough args"
}
  • 400
{
"result": "Duplicate events in steps are not allowed"
}

Behavior​

  • Parses funnel_map and nested JSON-string values (steps, queries, queryTexts, stepGroups).
  • For queries, object entries are converted to JSON strings before save.
  • Updates each mapped funnel by _id and app_id.
  • Supports two update styles: full funnel data update or order-only update.
  • Writes funnel_updated system log entries.
Implementation details

Database Collections

CollectionUsed forData touched by this endpoint
countly.funnelsEndpoint 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.