Skip to main content
Version: 25.03

Journey Engine - User Content

Enterprise

This endpoint is part of Countly Enterprise. To get access, contact sales or compare versions. Existing customers can reach the support portal with questions.

Endpoint​

/o/journey-engine/user-content

Overview​

Returns the content cooldown state of one app user and the content items currently queued for that user. Queued items are content blocks or surveys that journeys have scheduled and that have not yet expired.

Authentication​

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

Permissions​

Requires Read permission on the journey_engine feature.

Request Parameters​

ParameterTypeRequiredDescription
api_keyStringConditionalRequired if auth_token is not provided.
auth_tokenStringConditionalRequired if api_key is not provided.
app_idStringYesApp ID.
uidStringYesApp user ID (uid).

Examples​

Read the content state of a user​

/o/journey-engine/user-content?api_key=YOUR_API_KEY&app_id=6991c75b024cb89cdc04efd2&uid=12

Response​

Success Response​

{
"cooldown_hours": 24,
"cooldown_total_ms": 86400000,
"cooldown_remaining_ms": 3600000,
"last_view_ts": 1760000000000,
"queue": [
{
"content_id": "65f0cbf8bca6b8e8fbf7f901",
"name": "Welcome offer",
"type": "content",
"source": "content",
"priority": 5,
"category": null,
"created_ts": 1760000000000,
"expiry_ts": 1760600000000,
"journey_id": "65f0cbf8bca6b8e8fbf7f902"
}
]
}

Response Fields​

FieldTypeDescription
cooldown_hoursNumberCooldown that applies to this app, in hours. The app's own setting is used when it has one, otherwise the server-wide setting, otherwise 24.
cooldown_total_msNumberThe cooldown in milliseconds.
cooldown_remaining_msNumberMilliseconds until the user can be shown content again. 0 when the cooldown has passed or is 0.
last_view_tsNumberTimestamp (ms) when the user was last shown content. 0 if never.
queueArrayUnexpired queued items for the user, highest priority first, then newest first. Empty when nothing is queued.
queue[].content_idStringID of the queued content block or survey.
queue[].nameStringContent title or survey name. Empty string if it can no longer be found.
queue[].typeStringContent or survey type. Falls back to category, then an empty string.
queue[].sourceStringcontent for content blocks, survey for surveys, empty if not found.
queue[].priorityNumberQueue priority.
queue[].categoryStringCategory of the item, or null.
queue[].created_tsNumberWhen the item was queued (ms).
queue[].expiry_tsNumberWhen the item expires (ms).
queue[].journey_idStringJourney that queued the item, or null.

Error Responses​

  • 400
{
"result": "app_id and uid are required"
}
  • 500
{
"result": "Error: <message>"
}

Behavior​

  • Read-only. Nothing is modified.
  • Items whose expiry time has passed are not returned.
Implementation details

Database Collections

CollectionUsed forData touched by this endpoint
countly.membersAuthentication and permission checkReads the member and permissions.
countly.appsApp cooldown settingReads the app's journey_engine cooldown.
countly.app_users{appId}Last content viewReads the user's last view time.
countly.content_queueQueued itemsReads unexpired items for the user.
countly.content_blocksContent namesReads titles and types of queued content blocks.
countly.feedback_widgetsSurvey namesReads names and types of queued surveys.