Skip to main content

Update custom property expiration

Enterprise Only
This API is available exclusively in Countly Enterprise.

Endpoint

/i/data-manager/property-expire

Overview

Sets or removes TTL for a custom user property in Data Manager metadata.

Authentication

Countly API supports three authentication methods:

  1. API key query parameter: api_key=YOUR_API_KEY
  2. Auth token query parameter: auth_token=YOUR_AUTH_TOKEN
  3. Auth token header: countly-token: YOUR_AUTH_TOKEN

Permissions

Requires data_manager Update permission.

Request Parameters

ParameterTypeRequiredDescription
app_idStringYesTarget app ID.
customPropertyStringYesCustom property key under custom.{property}.
ttlString or NumberConditionalTTL value. Must be a number or SESSION (case-insensitive input accepted as session).
disableExpireStringNoIf present, removes TTL instead of setting it.
api_keyStringConditionalRequired if auth_token is not provided.
auth_tokenStringConditionalRequired if api_key is not provided.

Response

Success Response

"Success"

Response Fields

FieldTypeDescription
(root value)StringSuccess when TTL update/removal is applied.

Error Responses

  • 400
{
"result": "TTL must be a number or SESSION"
}
  • 500
500

Behavior/Processing

  • Updates countly_drill.drill_meta record _id={app_id}_meta_up.
  • Sets custom.{customProperty}.ttl when TTL is valid.
  • Removes custom.{customProperty}.ttl when disableExpire is provided.
  • Invalidates Data Manager cache after update.

Audit & System Logs

  • This endpoint does not emit /systemlogs actions.

Database Collections

CollectionUsed forData touched by this endpoint
countly_drill.drill_metaUser-property metadata storageUpdates/removes custom.{property}.ttl under the app-level _meta_up document.

Examples

Set property TTL to 30 days

/i/data-manager/property-expire?
app_id=64f5c0d8f4f7ac0012ab3456&
customProperty=campaign_code&
ttl=30

Set session-based expiration

/i/data-manager/property-expire?
app_id=64f5c0d8f4f7ac0012ab3456&
customProperty=temp_flag&
ttl=SESSION

Disable expiration

/i/data-manager/property-expire?
app_id=64f5c0d8f4f7ac0012ab3456&
customProperty=temp_flag&
disableExpire=true

Operational Considerations

  • TTL changes affect future retention behavior for the property; existing stored values are not rewritten immediately.

Limitations

  • disableExpire is treated as a truthy flag; any provided value triggers TTL removal path.
  • On runtime exceptions, this endpoint can return HTTP 200 with raw JSON body 500.


Last Updated

2026-02-16