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).
/api/public/analytics/summarycurl "https://postiv.ai/api/public/analytics/summary?accountId=all" \
-H "Authorization: Bearer pk_postiv_..."{
"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'requiredAlias: account_id. One LinkedIn profile/page or X account from list-analytics-accounts. 'all' answers per channel and never sums LinkedIn and X together.
channelstringNarrows accountId 'all' to one channel. With a specific accountId it must match that account's channel (400 channel_mismatch).
linkedinxperiodintdefault: 30Trailing days, 1-365; ignored if start/end given.
startstringYYYY-MM-DD, must pair with end.
endstringYYYY-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.platformstringlinkedin, x, or all when a workspace-wide answer covers both channels.
summary.current / summary.previousobjectTotals 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.channelsobjectOnly for accountId 'all' across both channels: { linkedin, x }, each the channel's own summary plus accountCount.
summary.accountCountintOnly 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 / notesmixedX 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
| 400 | missing_account_id: accountId omitted |
| 400 | validation_error: start given without end (or vice versa) |
| 400 | invalid_channel: channel is not linkedin or x / channel_mismatch: channel contradicts the channel of accountId |
| 404 | analytics_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.