1. On-demand with a cache
Nothing to import. You read LinkedIn when a user looks at something, and the webhook keeps what you cached up to date.- Inbox screen —
list_inbox, paginated withcursor. To refresh it, passsince(your last refresh, in ms): you only get the conversations that moved. - Opening a conversation —
get_conversationwithcount(e.g. 25). When the user scrolls up, call it again with the returnednext_cursorto load older messages. - New messages — a webhook subscribed to messages, with
message_type: "all"to also get what the account sends. Append eachmessageevent to the conversation you cached, keyed bymetadata.conversation_urn.
2. Full sync into your storage
You keep every message in your database. Import the history once, then let real time take over — everything arrives through the same webhook, in the same format.- Create the webhook (
events:allormessage_received,message_type: "all"). - Call
POST /v2/accounts/{account_id}/syncright after connecting the account. LinkupAPI reads the inbox in the background and posts every message to your webhook, conversation by conversation. - Real time continues on the same webhook as soon as the account is connected. Messages delivered by real time are never sent again by the sync.
events. Each item is exactly the event object of a real-time message webhook, so one parser handles both:
Sync webhook (several messages)
Real-time webhook (one message)
Both approaches: nothing is lost
If the real-time connection of an account is interrupted (network, proxy, reconnection), LinkupAPI catches up the messages of the gap automatically and delivers them to your webhook as normalmessage events with a top-level catch_up: true.