Skip to main content

Retrieve content blocks

Endpoint

/o/content
/o/content/by-id

Enterprise Only
This API is available exclusively in Countly Enterprise.

Overview

Retrieves content blocks. Use /o/content to list blocks for an app, and /o/content/by-id to fetch one block.

Authentication

  • Authentication methods:
    • 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

  • Required permission: Read on the content feature

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYes (or auth_token)API key for authentication
auth_tokenStringYes (or api_key)Auth token for authentication
app_idStringYesApplication identifier
_idStringYes for /o/content/by-idContent block ObjectID

Response

Success Response

List response (/o/content):

[
{
"_id": "507f1f77bcf86cd799439011",
"app": "5be987d7b93798516eb5289a",
"type": "modal",
"blocks": [],
"details": {
"title": "Welcome Modal",
"created": 1567474533960,
"updated": 1567474533960,
"creatorId": "5d4472152de8f07336f3b100",
"favorite": false,
"creator": "Jane Doe"
}
}
]

Single-item response (/o/content/by-id):

{
"_id": "507f1f77bcf86cd799439011",
"app": "5be987d7b93798516eb5289a",
"type": "modal",
"blocks": [],
"details": {
"title": "Welcome Modal",
"created": 1567474533960,
"updated": 1567474533960,
"creatorId": "5d4472152de8f07336f3b100",
"favorite": false
}
}

Response Fields

FieldTypeDescription
_idStringContent block ObjectID
appStringApplication identifier
typeStringContent type
blocksArrayBlock definitions as stored
detailsObjectMetadata
details.titleStringBlock title
details.createdNumberCreation timestamp
details.updatedNumberUpdate timestamp
details.creatorIdStringCreator member ID
details.favoriteBooleanFavorite flag
details.creatorStringCreator full name (added in /o/content list response)

Error Responses

HTTP StatusResponse
400"Missing _id parameter" (/o/content/by-id)
400"Invalid _id format" (/o/content/by-id)
404"Content not found" (/o/content/by-id)
500"Error"

Behavior/Processing

  1. /o/content lists blocks, sorted by details.created descending.
  2. /o/content enriches each block with creator full name from countly.members.
  3. /o/content/by-id returns a single block by _id and app.

Database Collections

CollectionUsed forData touched by this endpoint
countly.content_blocksEndpoint data source** - Content block definitions
countly.membersEndpoint data source** - Creator profile lookup for list endpoint

Examples

Example 1: List Content Blocks

/o/content?api_key=YOUR_API_KEY&app_id=5be987d7b93798516eb5289a

Example 2: Get Content Block by ID

/o/content/by-id?api_key=YOUR_API_KEY&app_id=5be987d7b93798516eb5289a&_id=5d4472152de8f07336f3b352

Ⓔ Enterprise

This feature is part of Countly Enterprise.

Get Access:

Already a Customer? Use support portal if you have any questions


Last Updated

2026-02-16