Skip to main content

Filtering Rules - List

Endpoint

/o/blocks

Enterprise Only
This API is available exclusively in Countly Enterprise.

Overview

Lists filtering rules configured for the selected application.

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

  • Filtering Rules: Read permission (or global admin equivalent).

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYes (or auth_token)API key authentication
auth_tokenStringYes (or api_key)Auth token authentication
app_idStringYesApplication ID

Response

Success Response

[
{
"_id": "rule1",
"is_arbitrary_input": false,
"key": "*",
"name": "Rule 1",
"rule": "{\"up.cc\":{\"$in\":[\"DE\"]}}",
"status": true,
"type": "session"
}
]

Response Fields

Each array item is a rule object:

FieldTypeDescription
_idStringRule ID
is_arbitrary_inputBooleanArbitrary input matching flag
keyStringRule key/event key (* for all)
nameStringRule display text
ruleStringStringified rule definition
statusBooleanRule active state
typeStringRule type (all, session, event)
_onReqBooleanEarly request-stage evaluation flag (when present)
last_triggeredNumberLast trigger Unix timestamp (seconds, when present)

Error Responses

  • HTTP 400 - Missing app ID:
{
"result": "Provide app_id"
}
  • HTTP 400 - Missing auth params:
{
"result": "Missing parameter \"api_key\" or \"auth_token\""
}
  • HTTP 401 - Auth/user validation failed:
{
"result": "User does not exist"
}

Behavior/Processing

  1. Validates read permission.
  2. Loads app blocks array.
  3. Returns [] when no rules exist.

Database Collections

CollectionUsed forData touched by this endpoint
countly.appsApp configuration and metadataStores app-level feature settings and metadata used or modified by this endpoint.

Examples

Example: List rules

curl "https://your-server.com/o/blocks?api_key=YOUR_API_KEY&app_id=YOUR_APP_ID"

Ⓔ 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-15

Last Updated

2026-02-16