Skip to main content
GET
/
api
/
late
/
callback
Complete Late OAuth callback
curl --request GET \
  --url https://app.puffle.ai/api/late/callback \
  --header 'Authorization: Bearer <token>'

Overview

OAuth redirect target — not intended to be called directly by agents. The human’s browser lands here after authorizing on the platform. The handler:
  1. Fetches any new accounts across every Late profile owned by the user
  2. Detects duplicates by platform + username, disconnecting the fresh attempt and surfacing a friendly error if the same handle is already connected
  3. Upserts fresh accounts into social_accounts
  4. For LinkedIn, either associates existing onboarding-stub posts with the new account, or kicks off an Apify scrape of recent posts (fire-and-forget)
Always 302-redirects back to /profile?tab=socials with either connected=<platform> (success) or error=<message> (failure).

AI agent notes

Not an agent-callable endpoint. Agents trigger the flow via connectLateAccount, then wait for the human to complete OAuth. Inspect listLateAccounts afterwards to confirm the new account appeared.Duplicate detection — if a user tries to connect the same LinkedIn handle twice (e.g. once personal, once via re-OAuth), the second attempt is rolled back and they land on /profile?tab=socials&error=....Post backfill — only LinkedIn accounts trigger the Apify post sync, and it runs in the background. The redirect happens before the sync completes.

Authorizations

Authorization
string
header
required

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

Query Parameters

platform
string

Platform key forwarded from the initiating connectLateAccount call. Included in the final redirect as ?connected=<platform> on success.

error
string

If the OAuth provider rejected the connection, the error description lands here and is forwarded to the UI as ?error=<error>.

Response

302

Redirect to /profile?tab=socials with success or error parameters. No JSON body. Unauthenticated callers get redirected to /login instead.