WePeopleDocs
IntegrationsPricingDocsSign inGet started
Get started
Docs home

Getting Started

  • What is WePeople
  • First week checklist
  • Core concepts

Product

  • Monitoring
  • Reports
  • People & profiles
  • SPACE scoring
  • Organization settings
  • Statistics
  • Billing & retention
  • Privacy model

Integrations

  • Overview
  • Slack
  • GitHub
  • Jira
  • Trust model

Developers

  • Platform overview
  • Quick start
  • Ingest guide
  • Custom statistics
  • Hosted MCP
  • TypeScript SDK

API Reference

  • Overview
  • Auth & headers
  • GET ping
  • POST events
  • POST snapshots
  • Apps statistics
  • Error codes
  • OpenAPI & SDK

Browse docs

Developers

Custom statistics

Declare how your app’s event types aggregate into org-wide statistics — the same rollups native integrations use for reports and MCP get_statistic_rollups.

Overview

Each developer app can publish a statistic manifest — up to 32 definitions describing id, label, pillar, format, aggregation, and which eventType values contribute. The manifest is stored on the app and loaded into the in-process registry when updated.

API: GET/PUT /api/v1/apps/statistics. Authenticate with the same wp_live_* key as ingest.

Id prefix

Every statistic id must start with {appSlug}. — e.g. crm-hub.tickets_resolved for an app whose slug is crm-hub.

Manifest fields

FieldTypeNotes
idstringUnique id; must start with `{appSlug}.`
labelstringDisplay name (1–120 chars)
descriptionstringHelp text (≤ 500 chars)
pillarStatisticPillarACTIVITY | COMMUNICATION | DELIVERY | REVIEW | KNOWLEDGE
formatenumnumber | duration_minutes | percent | time_of_day | rate_per_day
aggregationenumcount | sumField | durationMinutes | rate | ratio
valueFieldstring?Metadata field for sumField / ratio aggregations
sourceEventTypesstring[]1–32 event types that feed this statistic
sourceEventCategoriesEventCategory[]1–8 categories (communication, code, …)
feedsDimensionsenum[]Optional SPACE dimension hints (≤ 5)
defaultEnabledbooleanDefault true — org can toggle
ownedByenumextractor | none (default none)

Register definitions

PUT replaces the entire manifest. Body accepts either { "statistics": [ … ] } or a bare array. GET returns the current manifest.

PUT manifestbash
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"],
        "feedsDimensions": ["efficiency"],
        "defaultEnabled": true,
        "ownedBy": "none"
      }
    ]
  }'
Response 200json
{
  "requestId": "req_01HP3K5V4J3M9NVT8XZKQ9YQ2E",
  "statistics": [ … ]
}

Linking events

When you ingest events, any statistic whose sourceEventTypes includes the event’s eventType is considered a recipient during rollup. Optionally set statisticId on an event to target one definition explicitly (must exist in your manifest).

Optionally override pillar on an event when one category feeds multiple pillars.

Example event with explicit statistic

Event with statisticIdjson
{
  "eventType": "ticket.resolved",
  "category": "TASK_UPDATE",
  "statisticId": "crm-hub.tickets_resolved",
  "actor": { "externalId": "agent-7" },
  "metadata": { "ticket_id": "SUP-431" }
}

Limits

  • Maximum 32 statistic definitions per app.
  • Up to 32 source event types per definition.
  • Invalid ids (wrong prefix) or schema violations return invalid_body — see error codes.

Product UI for toggling statistics: Statistics guide.

On this page

  • Overview
  • Manifest fields
  • Register definitions
  • Linking events
  • Limits
WePeople

Team insight, not surveillance. A lead's-eye view built on metadata from the tools your team already uses — never source code, never messages, never DMs.

Product

  • Monitoring & Reports
  • SPACE scoring
  • Pricing

Docs

  • Docs home
  • Getting started
  • Developer platform
  • API reference
  • MCP

Integrations

  • Browse integrations

Company

  • Support
  • Status

Legal

  • Brand
  • Privacy
  • Terms

© 2026 WePeople. Built with care.

Metadata only. No source code, no message bodies, no DMs — read the policy.