Skip to main content

System Logs - Record

Endpoint

/i/systemlogs

Ⓔ Enterprise Only

Overview

Creates a system log entry with a custom action and optional payload data.

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 an authenticated user context.

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYes (or use auth_token)API key for authentication.
auth_tokenStringNoAuth token as query parameter or countly-token header.
actionStringNoAction name to record. If omitted, no log entry is inserted and response is still success.
dataString (JSON Object) or ObjectNoPayload saved to log field i. If sent as string, server attempts JSON.parse(...).

Configuration Impact

SettingDefaultAffectsUser-visible impact
systemlogs.preventIPTrackingfalseLog insertion payloadWhen true, new records store ip: null; otherwise they store request IP.

Response

Success Response

{
"result": "Success"
}

Response Fields

FieldTypeDescription
resultStringAlways Success when authentication passes.

Error Responses

  • 400
{
"result": "Missing parameter \"api_key\" or \"auth_token\""
}
  • 400
{
"result": "Token not valid"
}
  • 401
{
"result": "User does not exist"
}
  • 401
{
"result": "User does not have right"
}
  • 401
{
"result": "User is locked"
}
  • 401
{
"result": "Token is invalid"
}

Behavior/Processing

  • If data is a string and parsing fails, the endpoint logs a parse error server-side and continues with original value.
  • If data.before and data.update are both provided, only changed fields are recorded (before/after diff snapshot).
  • Every successful insert also updates countly.systemlogs metadata document _id: "meta_v2" for action filter values.

Impact on Other Data

  • Writes a new action log document to countly.systemlogs.
  • Updates countly.systemlogs metadata document (meta_v2).

Database Collections

CollectionUsed forData touched by this endpoint
countly.systemlogsSystem audit log storageInserts action record, updates metadata document (meta_v2).
countly.membersUser attribution fallbackReads user data when actor identity must be resolved from member record.

Examples

Record app configuration change

/i/systemlogs?api_key=YOUR_API_KEY&action=app_updated&data={"app_id":"6991c75b024cb89cdc04efd2","before":{"timezone":"UTC"},"update":{"timezone":"Europe/Istanbul"}}

Record user operation

/i/systemlogs?api_key=YOUR_API_KEY&action=user_deleted&data={"user_id":"65f1f7b2ad5b9b001f12ab34","name":"Test User"}

Limitations

  • Endpoint returns success response even when action is missing; no log record is created in that case.
  • If data parse fails, payload may be stored without structured diff processing.

Last Updated

2026-03-05