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/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": {
    "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'required

Alias: account_id. 'all' aggregates every active account in the org.

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; exact shape is produced by lib/analytics/queries.getMetricsSummary(ForAccounts): not enumerated here since this route just passes it through.

summaryobject

Impressions/engagements/engagement-rate/follower-growth totals for the resolved account(s) and period.

Errors

400missing_account_id: accountId omitted
400validation_error: start given without end (or vice versa)
404analytics_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.