API Reference
Apps statistics
Manage the statistic manifest for the authenticated developer app. Definitions describe how ingested event types aggregate into daily rollups and reports. Guide: Custom statistics.
Endpoint
GETPUT
/api/v1/apps/statisticsAuthenticate with the same wp_live_* key as ingest. The key implicitly scopes to one developer app — no app id in the path.
GET
Returns the current manifest (may be an empty array).
curl "https://wepeople.app/api/v1/apps/statistics" \
-H "Authorization: Bearer $WEPEOPLE_API_KEY"{
"requestId": "req_01HP3K5V4J3M9NVT8XZKQ9YQ2E",
"statistics": [
{
"id": "crm-hub.tickets_resolved",
"label": "Tickets resolved",
"description": "Support tickets closed per day",
"pillar": "DELIVERY",
"format": "number",
"aggregation": "count",
"sourceEventTypes": ["ticket.resolved"],
"sourceEventCategories": ["TASK_UPDATE"],
"feedsDimensions": ["efficiency"],
"defaultEnabled": true,
"ownedBy": "none"
}
]
}PUT
Replaces the entire manifest atomically. Body accepts either:
{ "statistics": [ … ] }- A bare JSON array of definitions
Maximum 32 definitions. Every id must start with {appSlug}.(the authenticated app’s slug).
curl -X PUT "https://wepeople.app/api/v1/apps/statistics" \
-H "Authorization: Bearer $WEPEOPLE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"statistics": [
{
"id": "crm-hub.tickets_resolved",
"label": "Tickets resolved",
"description": "Support tickets closed per day",
"pillar": "DELIVERY",
"format": "number",
"aggregation": "count",
"sourceEventTypes": ["ticket.resolved"],
"sourceEventCategories": ["TASK_UPDATE"],
"defaultEnabled": true,
"ownedBy": "none"
}
]
}'Definition fields
| Field | Type | Notes |
|---|---|---|
| id | string | Must start with `{appSlug}.`; max 80 chars |
| label | string | 1–120 chars |
| description | string | ≤ 500 chars |
| pillar | StatisticPillar | ACTIVITY | COMMUNICATION | DELIVERY | REVIEW | KNOWLEDGE |
| format | enum | number | duration_minutes | percent | time_of_day | rate_per_day |
| aggregation | enum | count | sumField | durationMinutes | rate | ratio |
| valueField | string? | Required for sumField / ratio |
| sourceEventTypes | string[] | 1–32 whitelisted event types |
| sourceEventCategories | EventCategory[] | 1–8 categories |
| feedsDimensions | enum[] | satisfaction | performance | activity | communication | efficiency (≤ 5) |
| defaultEnabled | boolean | Default true |
| ownedBy | enum | extractor | none (default none) |
Errors
invalid_body(400) — schema validation or id prefix mismatch- Standard auth errors — Error codes