Skip to main content
POST
/
api
/
calendar
/
posts
/
sync-status
Sync scheduled-post publish status from Late
curl --request POST \
  --url https://app.puffle.ai/api/calendar/posts/sync-status \
  --header 'Authorization: Bearer <token>'
{
  "synced": 0,
  "updated": []
}

Overview

Walks every scheduled post whose scheduled_at is now in the past and whose late_post_id is set, fetches the current Late status, and:
  • Flips to posted if Late reports published
  • Resets to draft with late_post_id: null if Late reports failed
  • Leaves untouched if Late still reports pending
Safe to call repeatedly — idempotent per post. Per-post errors are logged and skipped; one bad post will not fail the whole sync.

AI agent notes

When to call:
  • After a scheduled post’s scheduled_at has passed, to flip it from scheduled to posted
  • As part of a recurring reconciliation loop (e.g., every 5 minutes in the background)
Does not read platform-level analytics — for engagement metrics (likes, comments, impressions), call getLatePostAnalytics separately. Those metrics lag publication by roughly 24 hours.Cost — each inspected post triggers one Late API call. If the caller has many stale scheduled posts, this can be chatty. Pair with post-level scheduling so only recently-scheduled posts accumulate.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Response

Sync completed. Counts in synced; flipped IDs in updated.

synced
integer
required

Number of scheduled posts inspected (any post whose scheduled_at is now in the past and whose Late ID is set).

Required range: 0 <= x <= 9007199254740991
updated
string<uuid>[]
required

Post IDs that flipped to posted (or were reset to draft on Late-side failure) as a result of this sync.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$