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
| Parameter | Type | Required | Description |
|---|---|---|---|
method | String | Yes | Must be config-upload. |
api_key | String | Yes (or use auth_token) | API key for authentication. |
auth_token | String | No | Auth token as query parameter or countly-token header. |
app_id | String | Yes | App id. |
config | String (JSON Object) or Object | Yes | SDK 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
| Field | Type | Description |
|---|---|---|
result | String | Success 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
configis a string, endpoint parses it as JSON. - If payload has
c, endpoint storesconfig.c; otherwise storesconfigdirectly. - Unknown keys are removed; only SDK valid option keys are saved.
Related Endpoints
Implementation details
Database Collections
| Collection | Used for | Data touched by this endpoint |
|---|---|---|
countly_out.sdk_configs | SDK config storage | Upserts app config as { _id: app_id, config: ... }. |