/o/push/user
Endpoint
/o/push/user
Ⓔ Enterprise Only
Overview
Returns push notification history for a single user, identified by user ID (id) or device ID (did).
Authentication
This endpoint requires authentication and uses read-permission validation.
Supported authentication methods:
- Query parameter:
api_key - Query parameter:
auth_token - Header:
countly-token: YOUR_AUTH_TOKEN
Permissions
Requires Read permission for Push Notifications.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | String | Yes* | API key authentication |
auth_token | String | Yes* | Session token authentication |
app_id | String | Yes | App ID |
messages | BooleanString | Yes | true to include full message documents |
id | String | Conditional | User uid; required if did is not provided |
did | String | Conditional | Device ID; required if id is not provided |
* Provide either api_key or auth_token.
Response
Success Response
messages=false
{
"notifications": {
"67cab1234d1e2a001f3b4567": [1709856000000, 1709942400000],
"67cab1234d1e2a001f3b4568": [1709942400000]
}
}
messages=true
{
"notifications": {
"67cab1234d1e2a001f3b4567": [1709856000000, 1709942400000]
},
"messages": [
{
"_id": "67cab1234d1e2a001f3b4567",
"status": "sent",
"platforms": ["i", "a"],
"info": {"title": "Welcome campaign"}
}
]
}
Response Fields
| Field | Type | Description |
|---|---|---|
notifications | Object | Map of messageId -> delivery timestamps/details from push_{appId}.msgs |
messages | Array of objects | Included only when messages=true; matching docs from countly.messages |
Error Responses
400 Bad Request
{
"result": {
"errors": ["One of id & did parameters is required"]
}
}
404 Not Found
{
"result": {
"errors": ["User with the did specified is not found"]
}
}
Behavior/Processing
- Validates
app_id,messages, and optionalid/did. - If only
didis provided, resolves user bycountly.app_users{appId}.didand readsuid. - Reads user push history from
countly.push_{appId}using_id = uid. - Returns
{}when user has no push history document or nomsgskeys. - If
messages=true, fetches matching message documents fromcountly.messages.
Impact on Other Data
This endpoint is read-only and does not modify data.
Database Collections
| Collection | Purpose | Key Fields |
|---|---|---|
countly.app_users{appId} | Resolves uid from did when needed | did, uid |
countly.push_{appId} | Stores per-user push history (msgs) | _id (uid), msgs |
countly.messages | Source of full message objects (optional branch) | _id, status, platforms, info |
Examples
Read user history by user ID
https://your-server.com/o/push/user
?api_key=YOUR_API_KEY
&app_id=6991c75b024cb89cdc04efd2
&id=user_123
&messages=false
Read user history by device ID with full message objects
https://your-server.com/o/push/user
?api_key=YOUR_API_KEY
&app_id=6991c75b024cb89cdc04efd2
&did=device_abc_001
&messages=true
Limitations
- Requires either
idordid; sending both is allowed butidis used directly. - Response may be empty (
{}) when user exists but has no push history record.
Related Endpoints
Last Updated
2026-03-07