Analytics
List analytics accounts
Lists the analytics accounts tracked in the workspace: LinkedIn profiles and company pages, and X accounts. Each has a platform. Call first to resolve accountId for every other analytics endpoint.
/api/public/analytics/accountscurl "https://postiv.ai/api/public/analytics/accounts" \
-H "Authorization: Bearer pk_postiv_..."{
"success": true,
"accounts": [
{
"id": "acc1...",
"orgId": "9e6397ad-...",
"integrationId": 1234,
"accountType": "personal",
"platform": "linkedin",
"profileType": "personal",
"externalRef": "urn:li:person:...",
"isActive": true,
"name": "Jan van Musscher",
"picture": "https://...",
"username": null,
"createdAt": "...",
"lastImport": {
"source": "api",
"imported_at": "2026-07-19T06:00:00.000Z"
}
},
{
"id": "acc2...",
"orgId": "9e6397ad-...",
"integrationId": 2345,
"accountType": "personal",
"platform": "x",
"profileType": "x_account",
"externalRef": "1469...",
"isActive": true,
"name": "Jan van Musscher",
"username": "janvm",
"picture": "https://...",
"createdAt": "...",
"lastImport": {
"source": "x_analytics_sync",
"imported_at": "2026-07-19T06:00:00.000Z"
},
"tracking": {
"trackedPosts": 12,
"measuredPosts": 12,
"budgetPausedPosts": 0
},
"budgetState": "ok"
}
]
}Authorization
Requires an organization API key with the analytics:read scope, sent as Authorization: Bearer or x-api-key.
Query parameters
channelstringNarrow the list to one channel. Omit for LinkedIn and X together.
linkedinxintegrationIdintOne connected account (LinkedIn or X integration id). An account decides the channel; a contradicting channel returns 400 channel_mismatch.
Response
Tracked accounts with last-import timestamps.
accounts[].iduuidaccounts[].orgIduuidaccounts[].integrationIdintaccounts[].accountTypestringaccounts[].platformstringThe account's channel.
accounts[].profileTypestringaccounts[].externalRefstringaccounts[].isActivebooleanaccounts[].name / picturemixedaccounts[].usernamestring|nullX handle. Null for LinkedIn.
accounts[].createdAttimestampaccounts[].lastImportobject|nullFreshness of the stored data: the last LinkedIn import, or for X the last X sync as { source: 'x_analytics_sync', imported_at }. Null when nothing was imported yet.
accounts[].trackingobjectX accounts only: { trackedPosts, measuredPosts, budgetPausedPosts }. Explains an empty or paused account.
accounts[].budgetStatestringX accounts only: ok, degraded or paused. paused means the account's monthly X read budget is used up until the next month.
Errors
| 400 | invalid_channel: channel is not linkedin or x / channel_mismatch: channel contradicts the channel of integrationId |
| 404 | integration_not_found: integrationId is not an account in this workspace |
| 404 | analytics_not_set_up: integrationId is an X account that has no analytics yet; metrics appear after the next X analytics sync |
Good to know
- Data is cached, never live: LinkedIn comes from imports and X from the periodic X sync (this endpoint never reads the X API). Freshness is indicated by lastImport.