# st.syncConversation

This action loads the message history with a person, so you can read it through inbox polling with personUrl.

> The API Reference is also the SDK and CLI reference. Consecutive code fences marked `tab=HTTP`, `tab=Node`, `tab=Python` and `tab=CLI` are the same call on each surface (a fence marked `tab=HTTP,CLI` is the same text for both), and a block between `:::surface <names>` and `:::` applies only to the surfaces it names. Identifiers in the text are written as in Node and in HTTP JSON (camelCase); the Python SDK spells methods, parameters and result attributes in snake_case (`sendMessage` → `send_message`, `reconnectionLink` → `reconnection_link`), while names inside HTTP JSON stay camelCase.

This action loads your message history with a person. Read it, together with the new messages the inbox captures, through [`/inbox/poll` with `personUrl`](/docs/monitoring-inbox#polling-one-person). See [Loading conversation history](/docs/working-with-conversations) for when you need it.

:::surface node,python
In the SDK this is the `syncConversation` method. It takes the parameters below except `label` and `then`, which exist only in workflow JSON, and returns the result below in `data`.
:::

:::surface cli
In the CLI this is `linkedin message get` – the command is below, under [Parameters](#parameters).
:::

> 💡 Run it once per person – not to check for new messages. New messages reach you through [inbox monitoring](/docs/monitoring-inbox).

## Constraints

> ⏺️ **Root Start:** allowed, when `personUrl` parameter is provided.

> ⬆️ **Parent Actions:** [st.openPersonPage](/docs/action-st-open-person-page).

> ⬇️ **Child Actions:** N/A.

## Parameters

```json tab=HTTP
{
  "actionType": "st.syncConversation",
  "label": "sync1",
  "personUrl": "https://www.linkedin.com/in/person1",
  "days": 14
}
```

```typescript tab=Node
const workflow = await linkedapi.syncConversation.execute({
  personUrl: "https://www.linkedin.com/in/person1",
  days: 14
});

const { data, errors } = await linkedapi.syncConversation.result(workflow.workflowId);
```

```python tab=Python
from linkedapi import SyncConversationParams

workflow = linkedapi.sync_conversation.execute(
    SyncConversationParams(
        person_url="https://www.linkedin.com/in/person1",
        days=14,
    )
)

result = linkedapi.sync_conversation.result(workflow.workflow_id)
```

```bash tab=CLI
linkedin message get https://www.linkedin.com/in/person1 --days 14
```

In AI assistants, the MCP server runs this action as the `sync_conversation` tool.

:::surface cli
The CLI has no command that only loads history: `linkedin message get` reads one conversation and, when its earlier history was never loaded, loads it with this action first.

```bash
linkedin message get <person-url> [flags]
```

| Flag | Type | Description |
| --- | --- | --- |
| `--since` | string | Only return messages since this ISO timestamp |
| `--days` | integer | Syncing period for the first call, 1–90 (default 30): how many days new messages keep being added to the loaded history, not how far back it is read |

```bash
linkedin message get https://www.linkedin.com/in/john-doe --since 2024-01-15T10:30:00Z --json
```

The first call for a conversation takes longer; later calls read what is already loaded. Call it once per person for the earlier history – new messages reach you through `linkedin inbox get --person <url>` ([`POST /inbox/poll`](/docs/monitoring-inbox?surface=cli)).
:::

- `label` (optional) – custom label for tracking this action in workflow completion.
- `personUrl` (required for root start, forbidden for parent start) – [public or hashed](/faq/what-are-hashed-url-and-public-url) LinkedIn URL of the person whose conversation you want to load.
- `days` (optional) – how many days Linked API keeps adding this person's new messages to the loaded history, from 1 to 90. Defaults to 30.

## Syncing period

> 💡 **`days` is the syncing period, not the depth of history.** It sets how many days new messages keep being added; the action always reads the whole conversation, however old it is.

Linked API keeps adding this person's new messages to the loaded history until the `syncUntil` moment returned by this action, counted from the moment the action starts running. With [inbox monitoring](/docs/monitoring-inbox) enabled, new messages from this person keep arriving through the inbox after that moment as well.

After that moment nothing is deleted: [polling](/docs/monitoring-inbox#polling-one-person) keeps returning the messages collected so far. Running this action again for the same person keeps the accumulated history and never shortens the period: `syncUntil` stays at the later of the current end and the new one.

A reply from the other person does not extend the period.

A thread read back to its first message is reported with `historyComplete: true` when you [poll the person](/docs/monitoring-inbox#polling-one-person). A very long conversation may not be read to its start within the action's time limit: the messages read are kept, and the thread stays `historyComplete: false`.

This action does not enable inbox monitoring and does not produce [inbox webhook events](/docs/webhook-event-types#inbox-events).

## Repeating within 24 hours

If you run this action again within 24 hours of a completed reading of the same person, it responds quickly instead of reading the whole conversation again:

- if Linked API already knows the thread identifier, it rereads only the messages since that reading and then responds;
- otherwise it responds immediately, without opening LinkedIn, and the check is finished during the next periodic syncs.

In the second case, a message the periodic sync missed can appear in polling later – usually within minutes – rather than by the time the action completes.

## Result options

1. **Successful syncing:**

```json
{
  "actionType": "st.syncConversation",
  "label": "sync1",
  "success": true,
  "data": {
    "syncUntil": "2026-09-09T09:55:31.582Z"
  }
}
```

- `label` – included only if specified in the action parameters.
- `data.syncUntil` – moment until which Linked API keeps adding this person's new messages to the loaded history.

2. **Failed syncing:**

```json
{
  "actionType": "st.syncConversation",
  "label": "sync1",
  "success": false,
  "error": {
    "type": "personNotFound",
    "message": "The provided URL is not an existing LinkedIn person."
  }
}
```

- `label` – included only if specified in the action parameters.
- `error.type` – enum with the following possible values:
  - `personNotFound` – provided URL is not an existing LinkedIn person.
  - `selfProfileNotAllowed` – action cannot be performed on your own profile.
