Analytics
Get post analytics
Cached analytics for one specific post. Accepts either a Postiv post id or an analytics post id (from get-top-posts).
GET
/api/public/analytics/posts/:idcURLGET /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...",
"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
idstringrequiredResource 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.* mixedSame fields as a get-top-posts posts[] entry.
analytics.postivPostIduuid|nullanalytics.accountobject{ id, integrationId, accountType, profileType, name, picture }
Errors
| 404 | analytics_account_not_found: accountId given but not in this org |
| 404 | post_analytics_not_found: a matching Postiv post exists but has no analytics yet (not published or not yet imported); details include { postId, status, integrationId } |
| 404 | analytics_post_not_found: id doesn't match any post at all |