Skip to main content

Update funnel

Endpoint

/i/funnels/edit

Enterprise Only
This API is available exclusively in Countly Enterprise.

Overview

Updates existing funnel definitions using funnel_map.

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

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/Processing

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

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.

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
}
}


Last Updated

2026-02-16