Skip to main content

Compliance Hub - Consents Read

Endpoint

/o?method=consents

Overview

Returns consent metric time-series for the selected app and period.

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 compliance_hub Read permission.

Request Parameters

ParameterTypeRequiredDescription
methodStringYesMust be consents.
app_idStringConditionalRequired for non-global-admin users during read validation.
periodStringNoStandard Countly period value.
api_keyStringConditionalRequired if auth_token is not provided.
auth_tokenStringConditionalRequired if api_key is not provided.

Response

Success Response

{
"2026": {
"2": {
"17": {
"0": {
"p": 12,
"e": 3
},
"1": {
"p": 9,
"e": 1
}
}
}
}
}

Response Fields

FieldTypeDescription
(root object)ObjectTime-bucketed consent metric object for requested period.

Error Responses

  • 400
{
"result": "Missing parameter \"api_key\" or \"auth_token\""
}
  • 401
{
"result": "No app_id provided"
}
  • 401
{
"result": "User does not have right"
}

Behavior/Processing

Behavior Modes

ModeTriggerProcessing PathResponse Shape
Consent metrics readmethod=consentsValidates read rights and fetches consent time object via common fetch pipeline.Raw metrics object

Impact on Other Data

  • Read-only endpoint.

Database Collections

CollectionUsed forData touched by this endpoint
countly.membersAuthentication and permission checksReads member account and feature access for read validation.
countly.appsApp validation/context loadingValidates app_id and timezone context when app-scoped validation applies.
countly.consentsConsent metric sourceReads consent metric documents by app/time period.

Examples

/o?
method=consents&
api_key=YOUR_API_KEY&
app_id=6991c75b024cb89cdc04efd2&
period=30days

Last Updated

2026-02-17