Skip to main content

SDK - Config Upload

Endpoint

/o?method=config-upload

Overview

Saves SDK config for an app.

Authentication

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

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.

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}

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

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

Database Collections

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