@@ -52,6 +52,8 @@ import {
5252 TApiUsageParams ,
5353 TConversationPollRequest ,
5454 TConversationPollResult ,
55+ TInboxPersonPollRequest ,
56+ TInboxPersonPollResult ,
5557 TInboxPollRequest ,
5658 TInboxPollResult ,
5759 TLinkedApiActionErrorType ,
@@ -264,22 +266,21 @@ class LinkedApi {
264266 public sendMessage : SendMessage ;
265267
266268 /**
267- * Sync a conversation with a LinkedIn user for standard LinkedIn messaging.
269+ * Load the message history with a person for standard LinkedIn messaging.
268270 *
269- * This method synchronizes a conversation with a person, preparing it for future message polling.
270- * Each conversation must be synced once before you can poll it for messages. This is a time-consuming
271- * process that retrieves the conversation history and prepares it for future updates .
271+ * This method reads the whole conversation with a person, whatever its age, so you can read it together
272+ * with the messages the inbox captures through { @link pollInbox} with `personUrl`. Run it once per
273+ * person – not to check for new messages: those arrive through the inbox enabled by { @link syncInbox} .
272274 *
273- * Syncing lasts for a limited period: `days` (1-90, 30 by default) counted from the moment the action
274- * starts running. The action returns the resulting `syncUntil` deadline, which {@link pollConversations}
275- * also reports. Once it passes, the conversation stops being updated — polling keeps returning the
276- * messages collected so far. Call this action again on the same person to start a new period; the
277- * accumulated history is preserved.
275+ * `days` (1-90, 30 by default) is the syncing period, not the depth of history: it sets how many days
276+ * new messages keep being added to the loaded history, until the returned `syncUntil`. Running the action
277+ * again keeps the accumulated history and never shortens the period. Running it again within 24 hours of a
278+ * completed reading responds quickly and may finish the check during the next periodic syncs.
278279 *
279280 * @param params - Parameters including the person's URL and, optionally, how many days to sync for
280281 * @returns Promise resolving to the sync action with the `syncUntil` deadline
281282 *
282- * @see {@link https://linkedapi.io/docs/working-with-conversations/ Working with Conversations Documentation }
283+ * @see {@link https://linkedapi.io/docs/working-with-conversations/ Loading Conversation History Documentation }
283284 * @see {@link https://linkedapi.io/docs/action-st-sync-conversation/ st.syncConversation Action Documentation }
284285 *
285286 * @example
@@ -392,22 +393,20 @@ class LinkedApi {
392393 public nvSendMessage : NvSendMessage ;
393394
394395 /**
395- * Sync a conversation with a LinkedIn user for Sales Navigator messaging .
396+ * Load the Sales Navigator message history with a person .
396397 *
397- * This method synchronizes a Sales Navigator conversation with a person, preparing it for future message polling.
398- * Each conversation must be synced once before you can poll it for messages. This retrieves the conversation
399- * history from Sales Navigator and prepares it for future updates .
398+ * This method finds the person's Sales Navigator threads and reads each of them, so you can read the history
399+ * together with the messages the inbox captures through { @link pollInbox} with `personUrl`. Run it once per
400+ * person – not to check for new messages: those arrive through the inbox enabled by { @link nvSyncInbox} .
400401 *
401- * Syncing lasts for a limited period: `days` (1-90, 30 by default) counted from the moment the action
402- * starts running. The action returns the resulting `syncUntil` deadline, which {@link pollConversations}
403- * also reports. Once it passes, the conversation stops being updated — polling keeps returning the
404- * messages collected so far. Call this action again on the same person to start a new period; the
405- * accumulated history is preserved.
402+ * `days` (1-90, 30 by default) is the syncing period, not the depth of history: it sets how many days
403+ * new messages keep being added to the loaded history, until the returned `syncUntil`. Running the action
404+ * again keeps the accumulated history and never shortens the period.
406405 *
407406 * @param params - Parameters including the person's URL and, optionally, how many days to sync for
408407 * @returns Promise resolving to the sync action with the `syncUntil` deadline
409408 *
410- * @see {@link https://linkedapi.io/docs/working-with-conversations/ Working with Conversations Documentation }
409+ * @see {@link https://linkedapi.io/docs/working-with-conversations/ Loading Conversation History Documentation }
411410 * @see {@link https://linkedapi.io/docs/action-nv-sync-conversation/ nv.syncConversation Action Documentation }
412411 *
413412 * @example
@@ -477,6 +476,10 @@ class LinkedApi {
477476 /**
478477 * Poll multiple conversations to retrieve message history and new messages.
479478 *
479+ * @deprecated Legacy, kept working for existing integrations. Use {@link pollInbox} with `personUrl`: it
480+ * returns the same history together with the messages the inbox captured, and does not fail for people
481+ * whose history was never loaded.
482+ *
480483 * This method retrieves messages from one or more previously synced conversations using direct HTTP requests.
481484 * Unlike syncing, polling is fast and can be done continuously to get real-time message updates.
482485 * You can specify a timestamp to get only messages since that time.
@@ -556,17 +559,22 @@ class LinkedApi {
556559 }
557560
558561 /**
559- * Poll the monitored inbox to retrieve message history and new messages .
562+ * Poll the monitored inbox to retrieve new messages, or the whole conversation with one person .
560563 *
561- * This method reads messages from the inbox previously enabled for monitoring via {@link syncInbox}
562- * and/or {@link nvSyncInbox}, using a direct HTTP request. Unlike {@link pollConversations}, it is not
563- * scoped to specific person URLs: it returns messages across the whole monitored inbox, newest-first.
564- * You can optionally filter by `since` timestamp, messaging `type`, and `threadId`.
564+ * This is the default way to read messages. Without `personUrl`, it reads messages from the inbox
565+ * previously enabled for monitoring via {@link syncInbox} and/or {@link nvSyncInbox}, across every
566+ * conversation, newest-first. You can optionally filter by `since` timestamp, messaging `type`, and `threadId`.
565567 *
566- * @param request - Optional filters: `since` timestamp, `type` ("st" | "nv"), and `threadId`
567- * @returns Promise resolving to a response containing the inbox messages
568+ * With `personUrl`, it returns the whole known conversation with that person instead: the messages the
569+ * inbox captured together with the history loaded by {@link syncConversation} / {@link nvSyncConversation },
570+ * each message once, plus `threads` with `historyFrom` and `historyComplete`. In this shape `threadId` may be
571+ * `null` and each message carries `inboxMessageId`, its `id` in the result without `personUrl`. A hashed
572+ * person URL always matches; a public URL matches only once Linked API knows that person's public URL.
568573 *
569- * @see {@link https://linkedapi.io/docs/working-with-conversations/ Working with Conversations Documentation }
574+ * @param request - Optional filters: `since` timestamp, `type` ("st" | "nv"), `threadId`, and `personUrl`
575+ * @returns Promise resolving to a response containing the inbox messages, or the person's messages and threads
576+ *
577+ * @see {@link https://linkedapi.io/docs/monitoring-inbox/ Monitoring Inbox Documentation }
570578 *
571579 * @example
572580 * ```typescript
@@ -582,12 +590,30 @@ class LinkedApi {
582590 * } else {
583591 * console.error("Polling failed:", pollResponse.errors);
584592 * }
593+ *
594+ * // The whole known conversation with one person
595+ * const { data } = await linkedapi.pollInbox({
596+ * personUrl: "https://www.linkedin.com/in/john-doe",
597+ * });
598+ * data?.threads.forEach((thread) => {
599+ * console.log(`${thread.threadId ?? "(unknown)"}: complete=${thread.historyComplete}`);
600+ * });
585601 * ```
586602 */
603+ public pollInbox (
604+ request : TInboxPersonPollRequest ,
605+ ) : Promise < TMappedResponse < TInboxPersonPollResult > > ;
606+ public pollInbox ( request ?: TInboxPollRequest ) : Promise < TMappedResponse < TInboxPollResult > > ;
607+ public pollInbox (
608+ request : TInboxPollRequest & { personUrl ?: string } ,
609+ ) : Promise < TMappedResponse < TInboxPollResult | TInboxPersonPollResult > > ;
587610 public async pollInbox (
588- request : TInboxPollRequest = { } ,
589- ) : Promise < TMappedResponse < TInboxPollResult > > {
590- const response = await this . httpClient . post < TInboxPollResult > ( '/inbox/poll' , request ) ;
611+ request : TInboxPollRequest & { personUrl ?: string } = { } ,
612+ ) : Promise < TMappedResponse < TInboxPollResult | TInboxPersonPollResult > > {
613+ const response = await this . httpClient . post < TInboxPollResult | TInboxPersonPollResult > (
614+ '/inbox/poll' ,
615+ request ,
616+ ) ;
591617 if ( response . success && response . result ) {
592618 return {
593619 data : response . result ,
0 commit comments