Skip to main content

/i/configs

Endpoint

/i/configs

Overview

Updates global Countly configuration values stored in the plugins configuration document. This endpoint accepts a JSON object of config changes, persists them, reloads configuration in memory, and returns the updated global configuration object.

Authentication

Countly API supports three authentication methods:

  1. API Key (parameter): api_key=YOUR_API_KEY
  2. Auth Token (parameter): auth_token=YOUR_AUTH_TOKEN
  3. Auth Token (header): countly-token: YOUR_AUTH_TOKEN

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.
configsJSON String (Object)YesJSON-stringified object of configuration changes.

configs Object Structure

FieldTypeRequiredDescription
{namespace}ObjectYesConfiguration namespace to update (for example api, frontend, or feature namespace).
{namespace}.{setting}VariesYesSetting value to update under that namespace.

Example configs payload:

{
"frontend": {
"session_timeout": 30
},
"api": {
"country_data": false
}
}

Configuration Impact

SettingDefaultAffectsUser-visible impact
frontend.session_timeoutServer-definedAuth token lifetimeUpdates ttl and ends for authenticated user's LoggedInAuth tokens when no user-level frontend override exists.
api.country_datatrueGeo data collection behaviorWhen set to false, endpoint also forces api.city_data=false in stored config.
api.city_datatrueGeo data collection behaviorIf set to true while api.country_data=false, endpoint forces api.country_data=true.

Response

Success Response

{
"api": {
"country_data": false,
"city_data": false
},
"frontend": {
"session_timeout": 30
},
"plugins": {
"drill": true,
"crashes": true
}
}

Response Fields

FieldTypeDescription
(root)ObjectGlobal configuration object returned as a raw root payload.
{namespace}ObjectNamespace-level configuration map.
{namespace}.{setting}VariesEffective setting value after update and reload.

Error Responses

400 Bad Request

{
"result": "Error updating configs"
}

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

  • Parses configs as JSON; an empty or invalid payload returns Error updating configs.
  • Merges provided changes into existing config state and writes them to countly.plugins.
  • Reloads configuration before returning the response payload.
  • When frontend.session_timeout is provided, token TTL/expiry fields are updated for active login tokens unless a user-level frontend override exists.
  • If api.country_data is set to false, api.city_data is also forced to false in the update logic.
  • If api.city_data is set to true while api.country_data is false, api.country_data is forced to true.

Impact on Other Data

  • Updates the global plugin/config document in countly.plugins.
  • May update active login token TTL fields in countly.auth_tokens.

Audit & System Logs

ActionTriggerPayload
change_configsConfig payload is valid and update flow starts{ before: previous configs, update: submitted configs }

Database Collections

CollectionUsed forData touched by this endpoint
countly.membersGlobal-admin validationReads authenticated user and global-admin status.
countly.pluginsStores global feature/config namespacesUpdates flattened configuration keys under _id: "plugins".
countly.auth_tokensStores active dashboard auth tokensConditionally updates ttl and ends for LoggedInAuth tokens of the authenticated user.

Examples

Update global frontend session timeout

/i/configs?api_key=YOUR_API_KEY&configs={"frontend":{"session_timeout":30}}

Disable country-level API geo enrichment (also disables city-level)

/i/configs?api_key=YOUR_API_KEY&configs={"api":{"country_data":false}}

Operational Considerations

  • Config changes are persisted and reloaded immediately in this process.
  • In multi-process deployments, expect short propagation delay until all processes refresh shared state.

Limitations

  • configs must be valid JSON and non-empty.
  • Invalid JSON is handled as an empty payload and returns Error updating configs.

Last Updated

2026-02-17