Skip to main content
Return likes, comments, reach, and engagement rate per platform and workspace-wide totals. This endpoint reads only from the Postsiva database — it does not call LinkedIn, Meta, or other external APIs on each request.

Base URL & auth

https://backend.postsiva.com
curl "https://backend.postsiva.com/unified/analytics" \
  -H "X-API-Key: psk_live_YOUR_KEY"
HeaderRequiredNotes
X-API-KeyYes (or Bearer)Workspace from key
X-Workspace-IdJWT onlyRequired with JWT
Requires an Analytics plan feature (REQUIRE_ANALYTICS). Blocked workspaces receive a plan upgrade message. See Authentication.

GET /unified/analytics

Query parameters

ParameterTypeDefaultDescription
platformsstring[]all connectedFilter: linkedin, facebook, instagram, tiktok, youtube, threads, pinterest, bluesky
facebook_page_idsstring[]Limit Facebook aggregation to these Page IDs
linkedin_organization_idsstring[]Limit LinkedIn to org/page posts; excludes personal when set
Omit 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

curl -G "https://backend.postsiva.com/unified/analytics" \
  -H "X-API-Key: psk_live_YOUR_KEY" \
  --data-urlencode "platforms=linkedin" \
  --data-urlencode "platforms=facebook" \
  --data-urlencode "linkedin_organization_ids=10987654321" \
  --data-urlencode "facebook_page_ids=123456789012345"

Response structure

FieldDescription
successtrue on success
messagee.g. "Unified analytics from database."
sourceAlways "database" for this endpoint
last_updatedISO timestamp of newest underlying row, when available
platformsMap of platform name → slice
totalsWorkspace-wide sums across included platforms

Per-platform slice (platforms.linkedin, etc.)

FieldTypeDescription
post_countintegerPosts/rows counted in DB
total_likesintegerSum of likes/reactions
total_commentsintegerSum of comments/replies
total_reachintegerSum of reach/impressions/views (platform-specific)
average_engagement_ratefloat(likes + comments) / max(reach, 1), capped at 1.0
messagestringOptional notes (e.g. Pinterest uses saves/clicks vs impressions)
errorstringSet if aggregation failed for this platform

Workspace totals (totals)

Cross-platform sums for the filtered set, typically:
KeyDescription
post_countTotal posts counted
total_likesSum of likes
total_commentsSum of comments
total_reachSum of reach/impressions
average_engagement_rateWeighted or combined engagement metric

Example response

{
  "success": true,
  "message": "Unified analytics from database.",
  "source": "database",
  "last_updated": "2026-07-08T06:00:00Z",
  "platforms": {
    "linkedin": {
      "post_count": 24,
      "total_likes": 890,
      "total_comments": 112,
      "total_reach": 45000,
      "average_engagement_rate": 0.0223,
      "message": null,
      "error": null
    },
    "instagram": {
      "post_count": 18,
      "total_likes": 2100,
      "total_comments": 340,
      "total_reach": 82000,
      "average_engagement_rate": 0.0298,
      "message": null,
      "error": null
    },
    "pinterest": {
      "post_count": 6,
      "total_likes": 0,
      "total_comments": 0,
      "total_reach": 12000,
      "average_engagement_rate": 0.015,
      "message": "Pinterest engagement uses saves and clicks vs impressions."
    }
  },
  "totals": {
    "post_count": 48,
    "total_likes": 2990,
    "total_comments": 452,
    "total_reach": 139000,
    "average_engagement_rate": 0.0248
  }
}

DB-only vs live refresh

EndpointData sourceUse when
GET /unified/analyticsDatabase onlyDashboards, billing reports, fast MCP tool calls
GET /unified/posts?refresh_stats=trueLive platform APIsYou need freshly synced per-post metrics
Analytics numbers reflect what Postsiva has stored from prior syncs and post activity. For the freshest per-post breakdown, use Posts with refresh_stats=true, then rely on analytics for rollups.

Engagement rate formula

Most platforms:
average_engagement_rate = (total_likes + total_comments) / max(total_reach, 1)
Capped at 1.0. When total_reach is 0, rate is 0. Pinterest uses platform-specific save/click semantics — see the slice message.

MCP equivalent

MCP toolREST
get_unified_analyticsGET /unified/analytics
Same parameters: optional platforms, Facebook page ids, LinkedIn org ids. Connect at https://mcp.postsiva.com/mcpMCP tools.
  • Posts — list posts and optionally refresh stats from platforms
  • Comments — unified inbox on recent posts
  • Authentication — plan gates for analytics