Skip to main content

/i/plugins

Endpoint​

/i/plugins

Overview​

Updates feature enablement state by applying a JSON object passed in the plugin parameter. The endpoint writes feature flags into the plugins configuration document, logs the change, reloads configuration, and returns a start confirmation.

Authentication​

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

Permissions​

  • Required permission: Global Admin.

Request Parameters​

ParameterTypeRequiredDescription
api_keyStringYes (or use auth_token)API key for authentication.
auth_tokenStringNoAuth token as query parameter or countly-token header.
pluginJSON String (Object)YesJSON-stringified map of feature state updates.

plugin Object Structure​

FieldTypeRequiredDescription
{feature_code}BooleanYestrue to enable, false to disable the feature.

Example plugin payload:

{
"drill": true,
"cohorts": false
}

Examples​

Enable two features​

/i/plugins?api_key=YOUR_API_KEY&plugin={"drill":true,"cohorts":true}

Disable a feature​

/i/plugins?api_key=YOUR_API_KEY&plugin={"crashes":false}

Response​

Success Response​

Accepted update:

{
"result": "started"
}

Parameter-rejected branch:

"Not enough parameters"

Response Fields​

FieldTypeDescription
resultStringReturns started when feature state update is accepted.
(root value)StringReturns Not enough parameters when plugin is missing or set to plugins.

Error Responses​

200 OK (missing or reserved parameter)

"Not enough parameters"

400 Bad Request

{
"result": "Missing parameter \"api_key\" or \"auth_token\""
}

400 Bad Request

{
"result": "Token not valid"
}

401 Unauthorized

{
"result": "User does not exist"
}

401 Unauthorized

{
"result": "User does not have right"
}

401 Unauthorized

{
"result": "User is locked"
}

401 Unauthorized

{
"result": "Token is invalid"
}

Behavior​

Behavior Modes​

ModeTriggerProcessing PathResponse Shape
Update modeplugin exists and is not equal to "plugins"Parses plugin JSON, updates plugins.{feature} keys in countly.plugins, logs action, reloads configs.Wrapped object: { "result": "started" }
Parameter-rejected modeplugin missing or plugin=pluginsSkips update path.Raw root string: "Not enough parameters"

Impact on Other Data​

  • Updates feature flags under _id: "plugins" in countly.plugins.
  • Reloads in-memory plugin config state used by API processes.

Operational Considerations​

  • This endpoint accepts a configuration update and returns immediately.
  • Validate resulting state with Features - State Check.

Limitations​

  • plugin must be a JSON object. Non-object values are not valid for update logic.
  • Passing plugin=plugins is explicitly rejected.
  • Invalid JSON in plugin can result in no update and no explicit error payload.
Implementation details

Audit & System Logs

ActionTriggerPayload
change_pluginsValid plugin object is persisted{ before: feature map before change, update: submitted feature map }

Database Collections

CollectionUsed forData touched by this endpoint
countly.membersGlobal-admin validationReads authenticated user and global-admin status.
countly.pluginsStores feature enablement/configuration stateUpdates plugins.{feature_code} keys under _id: "plugins".