Analytics

Get analytics summary

Cached KPI totals (impressions, engagements, engagement rate, follower growth) for one account or the whole workspace, over a trailing period or explicit date range. LinkedIn numbers come from imports, X numbers from the periodic X sync (never a live X read).

GET/api/public/analytics/summary
cURLGET /api/public/analytics/summary
curl "https://postiv.ai/api/public/analytics/summary?accountId=all" \
  -H "Authorization: Bearer pk_postiv_..."
200Response
{
  "success": true,
  "summary": {
    "platform": "linkedin",
    "current": {
      "totalImpressions": 48210,
      "totalEngagements": 1930,
      "avgEngagementRate": 4,
      "followers": 5120,
      "postsPublished": 9,
      "netNewFollowers": 62,
      "profileVisits": 310
    },
    "previous": {
      "totalImpressions": 41800,
      "totalEngagements": 1650,
      "avgEngagementRate": 3.9,
      "followers": 5058,
      "postsPublished": 8,
      "netNewFollowers": 40,
      "profileVisits": 280
    }
  }
}

Authorization

Requires an organization API key with the analytics:read scope, sent as Authorization: Bearer or x-api-key.

Query parameters

accountIduuid|'all'required

Alias: account_id. One LinkedIn profile/page or X account from list-analytics-accounts. 'all' answers per channel and never sums LinkedIn and X together.

channelstring

Narrows accountId 'all' to one channel. With a specific accountId it must match that account's channel (400 channel_mismatch).

One of:linkedinx
periodintdefault: 30

Trailing days, 1-365; ignored if start/end given.

startstring

YYYY-MM-DD, must pair with end.

endstring

YYYY-MM-DD, must pair with start.

Response

KPI totals for the window. One account (or one channel) returns that channel's summary; accountId 'all' with both LinkedIn and X returns { platform: 'all', channels: { linkedin, x } }.

summary.platformstring

linkedin, x, or all when a workspace-wide answer covers both channels.

summary.current / summary.previousobject

Totals for the window and the window before it: totalImpressions, totalEngagements, avgEngagementRate, followers, postsPublished, netNewFollowers, profileVisits. X also has likes, reposts, replies, quotes, bookmarks and linkClicks; its followers is null.

summary.channelsobject

Only for accountId 'all' across both channels: { linkedin, x }, each the channel's own summary plus accountCount.

summary.accountCountint

Only for accountId 'all': how many accounts the answer covers. With both channels it sits inside each channel's answer under summary.channels.

summary.tracking / budgetState / notesmixed

X only: tracked, measured and budget-paused post counts, a status of ok, degraded or paused, and plain-language notes that explain empty or paused data.

Errors

400missing_account_id: accountId omitted
400validation_error: start given without end (or vice versa)
400invalid_channel: channel is not linkedin or x / channel_mismatch: channel contradicts the channel of accountId
404analytics_account_not_found: accountId not 'all' and not in this org, or channel has no analytics accounts in this workspace

Good to know

  • Same accountId resolution and default period (30d) as the MCP tool get_analytics_summary. LinkedIn and X are never added together: impressions mean different things on each.