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.
GET
/api/public/analytics/summarycURLGET /api/public/analytics/summary
curl "https://postiv.ai/api/public/analytics/summary?accountId=all" \
-H "Authorization: Bearer pk_postiv_..."200Response
{
"success": true,
"summary": {
"impressions": 48210,
"engagements": 1930,
"engagementRate": 4,
"followerGrowth": 62
}
}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. 'all' aggregates every active account in the org.
periodintdefault: 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; exact shape is produced by lib/analytics/queries.getMetricsSummary(ForAccounts): not enumerated here since this route just passes it through.
summaryobjectImpressions/engagements/engagement-rate/follower-growth totals for the resolved account(s) and period.
Errors
| 400 | missing_account_id: accountId omitted |
| 400 | validation_error: start given without end (or vice versa) |
| 404 | analytics_account_not_found: accountId not 'all' and not in this org |
Good to know
- Same accountId resolution and default period (30d) as the MCP tool get_analytics_summary.