Skip to main content

/i/cms/save_entries

Endpoint

/i/cms/save_entries

Overview

Save transformed CMS entries into countly.cms_cache.

Authentication

  • API Key (parameter): api_key=YOUR_API_KEY
  • Auth Token (parameter): auth_token=YOUR_AUTH_TOKEN
  • Auth Token (header): countly-token: YOUR_AUTH_TOKEN

Permissions

  • Requires app-level write/admin access for app_id.

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYes (or use auth_token)Dashboard API authentication key.
auth_tokenStringYes (or use api_key)Dashboard auth token.
app_idStringYesApp ID used by write-permission validation.
_idStringNoEntry namespace prefix used by cache cleanup and meta marker updates (for example server-guides).
entriesJSON String (Array)YesArray of transformed entry objects to store.

entries Array Structure

FieldTypeRequiredDescription
[] ._idStringYesCache document ID (for example server-guides_123).
[] .*Any JSON typeNoEntry payload fields to store.

Response

Success Response

{
"result": "Entries saved"
}

Response Fields

FieldTypeDescription
resultStringSave status message.

Error Responses

Status Code: 400 Bad Request

{
"result": "Invalid entries parameter"
}

Status Code: 400 Bad Request

{
"result": "Missing parameter \"api_key\" or \"auth_token\""
}

Status Code: 401 Unauthorized

{
"result": "User does not have right"
}

Status Code: 500 Internal Server Error

{
"result": "Error occured when saving entries to DB: Write operation failed"
}

Behavior/Processing

Behavior Modes

ModeTriggerProcessing PathResponse Shape
Standard saveValid entries JSON and permissionsParses entries, stamps lu on each record, upserts into cache, updates meta marker, removes older prefixed entries.Wrapped string: { "result": "Entries saved" }

Impact on Other Data

  • Upserts cache entries in countly.cms_cache.
  • Replaces meta marker document ${_id}_meta with latest lu timestamp.
  • Deletes older cache entries under the same _id prefix.

Database Collections

CollectionUsed forData touched by this endpoint
countly.membersAuthentication and permission validationReads member identity and app write permissions.
countly.cms_cacheCMS cache persistenceUpserts provided entries, updates meta marker, and deletes old prefixed cache docs.

Examples

Example 1: Save guides cache entries

/i/cms/save_entries?api_key=YOUR_API_KEY&app_id=6991c75b024cb89cdc04efd2&_id=server-guides&entries=[{"_id":"server-guides_1","title":"Guide 1","body":"Welcome"},{"_id":"server-guides_2","title":"Guide 2","body":"Advanced setup"}]
/i/cms/save_entries?api_key=YOUR_API_KEY&app_id=6991c75b024cb89cdc04efd2&_id=server-consents&entries=[{"_id":"server-consents_10","title":"Consent v2","required":true}]

Limitations

  • entries must be valid JSON array data.
  • Save flow assumes transformed entries already contain stable _id values.

Last Updated

2026-02-17