Skip to main content

SDK - Config Upload

Endpoint

/o?method=config-upload

Overview

Saves SDK config for an app.

Authentication

Countly API supports three authentication methods:

  1. api_key=YOUR_API_KEY
  2. auth_token=YOUR_AUTH_TOKEN
  3. countly-token: YOUR_AUTH_TOKEN

Permissions

Requires sdk Update permission.

Request Parameters

ParameterTypeRequiredDescription
methodStringYesMust be config-upload.
api_keyStringYes (or use auth_token)API key for authentication.
auth_tokenStringNoAuth token as query parameter or countly-token header.
app_idStringYesApp id.
configString (JSON Object) or ObjectYesSDK config payload. Accepts raw config or wrapped payload with c field.

Response

Success Response

{
"result": "Success"
}

Response Fields

FieldTypeDescription
resultStringSuccess when config is saved.

Error Responses

  • 400
{
"result": "Invalid config format"
}
  • 400
{
"result": "Config must be a valid object"
}
  • 500
{
"result": "Error saving config to database"
}

Behavior/Processing

  • If config is a string, endpoint parses it as JSON.
  • If payload has c, endpoint stores config.c; otherwise stores config directly.
  • Unknown keys are removed; only SDK valid option keys are saved.

Database Collections

CollectionUsed forData touched by this endpoint
countly_out.sdk_configsSDK config storageUpserts app config as { _id: app_id, config: ... }.

Examples

Upload SDK config

/o?method=config-upload&api_key=YOUR_API_KEY&app_id=6991c75b024cb89cdc04efd2&config={"tracking":true,"crt":true,"bom":true,"bom_rqp":50}

Last Updated

2026-03-05