Skip to main content

Compliance Hub - App Users Consents

Endpoint​

/o/app_users/consents

Overview​

Returns app users with consent fields from the app-users collection using search/sort/pagination controls.

Authentication​

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

Permissions​

Requires compliance_hub Read permission.

Request Parameters​

ParameterTypeRequiredDescription
app_idStringYesTarget app ID.
sSearchStringNoDevice ID regex text filter.
query / filterJSON String (Object)NoJSON-stringified user filter object.
project / projectionJSON String (Object)NoProjection object; defaults to consent-related user fields.
sortJSON String (Object)NoExplicit sort object.
iSortCol_0NumberNoDataTables sort column index.
sSortDir_0StringNoDataTables sort direction (asc/desc).
limit / iDisplayLengthNumberNoPage size.
skip / iDisplayStartNumberNoOffset.
sEchoString or NumberNoEcho value returned in response.
api_keyStringConditionalRequired if auth_token is not provided.
auth_tokenStringConditionalRequired if api_key is not provided.

Examples​

/o/app_users/consents?
api_key=YOUR_API_KEY&
app_id=6991c75b024cb89cdc04efd2&
limit=20&
skip=0

Search by device ID​

/o/app_users/consents?
api_key=YOUR_API_KEY&
app_id=6991c75b024cb89cdc04efd2&
sSearch=device_123

Response​

Success Response​

{
"sEcho": "1",
"iTotalRecords": 1200,
"iTotalDisplayRecords": 1200,
"aaData": [
{
"did": "device_123",
"d": "Chrome",
"av": "1.2.0",
"consent": {
"sessions": true,
"events": true,
"crashes": false
},
"lac": 1739788800000,
"uid": "user_1"
}
]
}

Empty dataset response:

{
"sEcho": "1",
"iTotalRecords": 0,
"iTotalDisplayRecords": 0,
"aaData": []
}

Response Fields​

FieldTypeDescription
sEchoString or NumberEcho value from request.
iTotalRecordsNumberTotal app-user records for query scope.
iTotalDisplayRecordsNumberDisplayed total in response (same as iTotalRecords).
aaDataArrayApp user records with consent and selected profile fields.

Error Responses​

  • 400
{
"result": "Missing parameter \"api_key\" or \"auth_token\""
}
  • 400
{
"result": "Missing parameter \"app_id\""
}
  • 401
{
"result": "User does not have right"
}
  • 400
{
"result": "Application users query error"
}

Behavior​

Behavior Modes​

ModeTriggerProcessing PathResponse Shape
User-consent listingApp has user recordsRuns app-user count, applies query/search/sort/pagination, returns DataTables-style payload.Raw DataTables-style object
Empty app-users pathNo users for app/query scopeReturns zero totals and empty data array.Raw object with empty aaData

Impact on Other Data​

  • Read-only endpoint.
Implementation details

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 app context for user lookup scope.
countly.app_users{appId}App user consent sourceReads app user documents including consent and profile fields.