Base URL & auth
| Header | Required | Notes |
|---|---|---|
X-API-Key | Yes (or Bearer) | Workspace from key |
X-Workspace-Id | JWT only | Required with JWT |
Requires an Analytics plan feature (
REQUIRE_ANALYTICS). Blocked workspaces receive a plan upgrade message. See Authentication.GET /unified/analytics
Query parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
platforms | string[] | all connected | Filter: linkedin, facebook, instagram, tiktok, youtube, threads, pinterest, bluesky |
facebook_page_ids | string[] | — | Limit Facebook aggregation to these Page IDs |
linkedin_organization_ids | string[] | — | Limit LinkedIn to org/page posts; excludes personal when set |
platforms to aggregate all supported networks the workspace has connected (OAuth batch + Threads from workspace DB). Disconnected platforms appear with zero counts and an explanatory message.
Example — LinkedIn org + Facebook pages only
Response structure
| Field | Description |
|---|---|
success | true on success |
message | e.g. "Unified analytics from database." |
source | Always "database" for this endpoint |
last_updated | ISO timestamp of newest underlying row, when available |
platforms | Map of platform name → slice |
totals | Workspace-wide sums across included platforms |
Per-platform slice (platforms.linkedin, etc.)
| Field | Type | Description |
|---|---|---|
post_count | integer | Posts/rows counted in DB |
total_likes | integer | Sum of likes/reactions |
total_comments | integer | Sum of comments/replies |
total_reach | integer | Sum of reach/impressions/views (platform-specific) |
average_engagement_rate | float | (likes + comments) / max(reach, 1), capped at 1.0 |
message | string | Optional notes (e.g. Pinterest uses saves/clicks vs impressions) |
error | string | Set if aggregation failed for this platform |
Workspace totals (totals)
Cross-platform sums for the filtered set, typically:
| Key | Description |
|---|---|
post_count | Total posts counted |
total_likes | Sum of likes |
total_comments | Sum of comments |
total_reach | Sum of reach/impressions |
average_engagement_rate | Weighted or combined engagement metric |
Example response
DB-only vs live refresh
| Endpoint | Data source | Use when |
|---|---|---|
GET /unified/analytics | Database only | Dashboards, billing reports, fast MCP tool calls |
GET /unified/posts?refresh_stats=true | Live platform APIs | You need freshly synced per-post metrics |
Engagement rate formula
Most platforms:1.0. When total_reach is 0, rate is 0. Pinterest uses platform-specific save/click semantics — see the slice message.
MCP equivalent
| MCP tool | REST |
|---|---|
get_unified_analytics | GET /unified/analytics |
platforms, Facebook page ids, LinkedIn org ids. Connect at https://mcp.postsiva.com/mcp — MCP tools.
Related
- Posts — list posts and optionally refresh stats from platforms
- Comments — unified inbox on recent posts
- Authentication — plan gates for analytics