Skip to main content
Version: 26.01

SDK - SDK Logs Delete

Endpoint​

/i/sdk_logs/delete

Overview​

Deletes the SDK logs gathered for one app user and resets the user's gathered line count. A capture that is running keeps running.

Authentication​

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

Permissions​

Requires sdk Delete permission.

Request Parameters​

ParameterTypeRequiredDescription
api_keyStringConditionalRequired if auth_token is not provided.
auth_tokenStringConditionalRequired if api_key is not provided.
app_idStringYesApp id.
uidStringYesCountly internal user ID.

Examples​

Delete gathered logs​

/i/sdk_logs/delete?api_key=YOUR_API_KEY&app_id=6991c75b024cb89cdc04efd2&uid=1

Response​

Success Response​

{
"result": "Success",
"deleted": 3
}

Response Fields​

FieldTypeDescription
resultStringSuccess when the logs are deleted.
deletedNumberNumber of stored log batches deleted.

Error Responses​

  • 400
{
"result": "Missing parameter \"app_id\""
}
  • 400
{
"result": "Error: ..."
}
  • 500
{
"result": "Failed to delete SDK log batches"
}

The message names what failed: line allowance, log batches, or both joined with and.

Behavior​

  • Deletes every stored log batch of the user.
  • Resets the gathered line count of the user to 0.
  • The gathering state itself is kept.

Impact on Other Data​

  • Deletes the user's batches from countly.sdk_logs{appId}.
  • Updates the user's document in countly.app_users{appId}.