REST APIPOST

Analytics Sync

Check how fresh your analytics are per connected account, see which accounts need reconnecting, and ask for a refresh right after publishing.

Analytics are read from each platform on a schedule, every few hours depending on the platform's rate limits. Two endpoints let you see where that stands and ask for a refresh when you cannot wait.

GET /api/v1/analytics/sync-status

GET /api/v1/analytics/sync-status
{
  "accountGroupId": "ag_01j9x",
  "syncInProgress": false,
  "lastSyncedAt": "2026-09-08T06:12:41.000Z",
  "historyHorizonAt": "2026-03-12T00:00:00.000Z",
  "platforms": [
    {
      "platform": "INSTAGRAM",
      "connectionId": "cmlxmnxn20006hzpzvo291ckg",
      "accountName": "adaptlypost",
      "status": "IDLE",
      "lastSyncedAt": "2026-09-08T06:12:41.000Z",
      "lastErrorMessage": null,
      "historyHorizonAt": "2026-03-12T00:00:00.000Z",
      "lastDiscoveryAt": "2026-09-08T06:10:03.000Z",
      "needsAnalyticsReconnect": false
    }
  ]
}
FieldDescription
syncInProgressTrue while any account is queued or syncing
historyHorizonAtEarliest date any account has data for. Earlier dates have no data rather than zero activity
connectionIdThe account id from Social Accounts
statusIDLE, QUEUED, SYNCING or FAILED
lastErrorMessageWhy the last sync failed, when it did
needsAnalyticsReconnectTrue when the account was connected before analytics permissions existed

Accounts on platforms without analytics (X) are not listed.

Reconnecting for analytics

Social platforms do not let an app add permissions to an existing grant. An account connected before AdaptlyPost asked for analytics access stays parked, with no syncs and no errors, until the person who owns it reconnects and approves the extra permissions. That is what needsAnalyticsReconnect flags. A connect link works for this, so an agent or a client can reconnect without sharing a password.

POST /api/v1/analytics/sync

POST /api/v1/analytics/sync

No body. Queues a sync for every account with analytics and re-reads the last 7 days. Use it right after publishing, when the scheduled refresh is too far away.

{
  "queued": true,
  "message": "Analytics sync queued. Fresh numbers will appear within a few minutes",
  "cooldownSecondsRemaining": null
}

One run per workspace every 10 minutes. Inside the cooldown the response is still 200:

{
  "queued": false,
  "message": "Analytics were synced recently. Please try again in 412 seconds",
  "cooldownSecondsRemaining": 412
}

The run is asynchronous. Poll GET /api/v1/analytics/sync-status until syncInProgress is false, then read the metrics again. Do not retry inside the cooldown; the answer will not change.