Analytics

Get post analytics

Analytics for one specific post. A LinkedIn post gets a live refresh attempt with an explicit cached fallback; an X post is always served from the periodic X sync and never refreshed live. Accepts either a Postiv post id or an analytics post id (from get-top-posts).

GET/api/public/analytics/posts/:id
cURLGET /api/public/analytics/posts/:id
curl "https://postiv.ai/api/public/analytics/posts/ID_ID?accountId=all" \
  -H "Authorization: Bearer pk_postiv_..."
200Response
{
  "success": true,
  "analytics": {
    "id": "ap1...",
    "postivPostId": "post1...",
    "hook": "I lost my biggest client...",
    "lastFetchedAt": "2026-09-28T12:00:00.000Z",
    "refresh": {
      "status": "partial",
      "fetchedAt": "2026-09-28T14:00:00.000Z",
      "refreshedFields": [
        "impressions"
      ]
    },
    "metrics": {
      "impressions": 12400,
      "engagements": 640
    },
    "account": {
      "id": "acc1...",
      "integrationId": 1234,
      "accountType": "personal",
      "profileType": "personal",
      "name": "Jan",
      "picture": "https://..."
    }
  }
}

Authorization

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

Path parameters

idstringrequired

Resource id from the corresponding list or create endpoint.

Query parameters

accountIduuid|'all'

Alias: account_id. Disambiguates when omitted the search spans the whole workspace.

Response

One post's analytics, same metric/outlier shape as get-top-posts plus account context.

analytics.refreshobject

status is refreshed, partial, or cached. refreshedFields lists live SQL metric names (for example members_reached maps to metrics.membersReached); fetchedAt timestamps only those live fields. Cached fallbacks include reason and an empty refreshedFields list, without fetchedAt. Missing company-page metrics preserve cached values; derived engagements stay cached if any required count, including clicks, is missing. Each member request makes 11 LinkedIn reads. For an X post status is always cached, with reason x_periodic_sync, syncStatus and a message.

analytics.* mixed

Same fields as a get-top-posts posts[] entry. lastFetchedAt remains the stored snapshot timestamp; outliers and fields absent from refresh.refreshedFields remain cached.

analytics.postivPostIduuid|null
analytics.accountobject

{ id, integrationId, accountType, profileType, name, picture }

Errors

404analytics_account_not_found: accountId given but not in this org
404post_analytics_not_found: a matching Postiv post exists but has no analytics yet (not published or not yet imported); details include { postId, status, integrationId } (for an X post also tracking and budgetState when analytics are set up). Only X posts published through Postiv while X analytics tracking is active are measured
404analytics_post_not_found: id doesn't match any post at all