Analytics

Sync an external post

Changed on

Fetch an account's latest external posts (published directly on the platform, not through Zernio) on demand, so a newly published post is retrievable within seconds instead of waiting for the background sync (which refreshes each account at most every ~90 minutes).

Primary use case: verifying a submitted post. When a user publishes on the platform and immediately pastes the post URL into your app, call this with accountId plus url (or postId) to confirm the post exists and return its metadata.

Behavior:

  • Account access and connection state are checked before any platform call, including requests inside the debounce window.
  • Inactive accounts or accounts marked needsReconnection return 409 with code ads_connection_required. Stop scheduled retries for that account until it is reconnected, then read GET /v1/accounts for its current account ID.
  • For connected accounts, we fetch the latest posts live from the platform, then match and return the submitted post.
  • Requests are debounced per account (~15s): if the account was synced inside that window, the live fetch is skipped.

accountId is required, because a post URL or id alone cannot be resolved to an account, and the account must be connected to Zernio (we use its token to read the platform). Supported for every platform with a listing API (Instagram, Facebook, TikTok, YouTube, X, Threads, Pinterest, Reddit, Bluesky, Google Business Profile, and LinkedIn organization accounts).

LinkedIn personal profiles: LinkedIn has no listing API for personal profiles, so a url is REQUIRED and imports that single post. Pass any LinkedIn post URL (linkedin.com/posts/…, linkedin.com/feed/update/urn:li:activity:…) or a urn:li:share:… / urn:li:ugcPost:… URN. Works for posts published outside Zernio and before the account was connected, any age; the post must be authored by the connected member. Imported posts return full analytics (impressions, reach, reactions, comments, reshares, saves) and keep refreshing on the background analytics cycle, but carry no content/media (LinkedIn does not expose them for personal profiles). publishedAt comes from the post id: an activity URL (linkedin.com/feed/update/urn:li:activity:…) carries the publication time, while a urn:li:share:… / urn:li:ugcPost:… URN only carries the creation time, which is earlier for a post scheduled in another tool. Pass the activity URL for the exact publication date; importing it again for a post already imported by its URN corrects publishedAt on the same record. Right after an import, the per-post GET /v1/analytics?postId= read can show zeros for a few minutes while the metrics are ingested; this endpoint's response carries the fetched values immediately.

TikTok Business accounts: a postId or TikTok url that the listing has not stored is fetched from TikTok and imported as an external post, at any age, with its current metrics.

url accepts any format the platform uses (e.g. instagram.com/p/…, instagram.com/reel/…, youtu.be/…, youtube.com/shorts/…, tiktok.com/@user/video/…, vm.tiktok.com short links, pinterest.com/pin/… on any regional domain, and pin.it short links). Pass postId (the platform media/video/pin id) as an alternative locator.

Note: post-level analytics (reach, impressions) still carry the platform's own delay (e.g. ~24h on Instagram). This endpoint confirms the post exists and returns its metadata plus basic engagement (likes, comments), not delayed insights.

post/v1/posts/sync-external

Request

  • Base URL: https://zernio.com/api
  • URL: https://zernio.com/api/v1/posts/sync-external
  • Auth: HTTP bearer

Request body

accountIdstring required

SocialAccount ID whose posts to sync. Must be connected to Zernio.

urlstring

The post URL to locate. Optional. Provide url or postId to return a specific post; omit both to refresh and return the account's recent posts.

postIdstring

The platform post/media/video id to locate, as an alternative to url. Optional.

Response

Sync result. When url or postId is provided, returns the matched post (or found: false). When neither is provided, returns the account's freshly-synced recent posts.

foundboolean

Present only when a locator (url/postId) was provided: whether the post was found.

Changes

    • warning

      added the new account enum value to the / response property for the response status

    • warning

      added the new account enum value to the / response property for the response status

    • warning

      added the new account enum value to the / response property for the response status

    • warning

      added the new account enum value to the / response property for the response status

    • warning

      added the new account enum value to the / response property for the response status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status