# st.retrieveConnections

> 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 allows you to retrieve your connections and perform additional person-related actions if needed.

:::surface node,python
In the SDK this is the `retrieveConnections` 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 connection list` – the command is below, under [Parameters](#parameters).
:::

## Constraints

> ⏺️ **Root Start:** allowed.

> ⬆️ **Parent Actions:** N/A.

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

## Parameters

```json tab=HTTP
{
  "actionType": "st.retrieveConnections",
  "label": "listConnections1",
  "limit": 100,
  "since": "2022-01-01",
  "filter": {
    "firstName": "John",
    "lastName": "Doe",
    "position": "CEO",
    "locations": ["New York", "San Francisco", "London"],
    "industries": ["Software Development", "Professional Services"],
    "currentCompanies": ["Tech Solutions", "Innovatech"],
    "previousCompanies": ["FutureCorp"],
    "schools": ["Harvard University", "MIT"]
  }
}
```

```typescript tab=Node
const workflow = await linkedapi.retrieveConnections.execute({
  limit: 100,
  since: "2022-01-01",
  filter: {
    firstName: "John",
    lastName: "Doe",
    position: "CEO",
    locations: ["New York", "San Francisco", "London"],
    industries: ["Software Development", "Professional Services"],
    currentCompanies: ["Tech Solutions", "Innovatech"],
    previousCompanies: ["FutureCorp"],
    schools: ["Harvard University", "MIT"]
  }
});

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

```python tab=Python
from linkedapi import RetrieveConnectionsParams

workflow = linkedapi.retrieve_connections.execute(
    RetrieveConnectionsParams(
        limit=100,
        since="2022-01-01",
        filter={
            "first_name": "John",
            "last_name": "Doe",
            "position": "CEO",
            "locations": ["New York", "San Francisco", "London"],
            "industries": ["Software Development", "Professional Services"],
            "current_companies": ["Tech Solutions", "Innovatech"],
            "previous_companies": ["FutureCorp"],
            "schools": ["Harvard University", "MIT"],
        },
    )
)

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

```bash tab=CLI
linkedin connection list \
  --limit 100 \
  --since 2022-01-01 \
  --first-name John \
  --last-name Doe \
  --position CEO \
  --locations "New York,San Francisco,London" \
  --industries "Software Development,Professional Services" \
  --current-companies "Tech Solutions,Innovatech" \
  --previous-companies FutureCorp \
  --schools "Harvard University,MIT"
```

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

:::surface cli
In the CLI this is `linkedin connection list`:

```bash
linkedin connection list [flags]
```

| Flag | Type | Description |
| --- | --- | --- |
| `--limit` | integer | Max connections to return |
| `--since` | string | Only connections made since this ISO timestamp |
| `--first-name` | string | Filter by first name |
| `--last-name` | string | Filter by last name |
| `--position` | string | Filter by job position |
| `--locations` | string | Comma-separated locations |
| `--industries` | string | Comma-separated industries |
| `--current-companies` | string | Comma-separated current company names |
| `--previous-companies` | string | Comma-separated previous company names |
| `--schools` | string | Comma-separated school names |

> `--since` only works when no filter flags are used.
:::

- `label` (optional) – custom label for tracking this action in workflow completion.
- `limit` (optional) – number of connections to return. Returns all connections if not provided.
- `since` (optional) –  ISO date string that filters connections to only include those made on or after the specified date. Only works when `filter` is not provided.
- `filter` (optional) – object that specifies filtering criteria for people. When multiple filter fields are specified, they are combined using `AND` logic.
  - `firstName` (optional) – first name of person.
  - `lastName` (optional) – last name of person.
  - `position` (optional) – job position of person.
  - `locations` (optional) – array of free-form strings representing locations. Matches if person is located in any of the listed locations.
  - `industries` (optional) – array of enums representing industries. Matches if person works in any of the listed industries. Takes specific values available in the LinkedIn interface.
  - `currentCompanies` (optional) – array of company names. Matches if person currently works at any of the listed companies.
  - `previousCompanies` (optional) – array of company names. Matches if person previously worked at any of the listed companies.
  - `schools` (optional) – array of institution names. Matches if person currently attends or previously attended any of the listed institutions.

## Result options

1. **Successful retrieval:**

```json
{
  "actionType": "st.retrieveConnections",
  "label": "listConnections1",
  "success": true,
  "data": [
    {
      "name": "John Doe",
      "urn": "urn:li:member:123456789",
      "publicUrl": "https://www.linkedin.com/in/johndoe",
      "headline": "Founder & CEO at Example Company",
      "connectedAt": "2025-01-02T00:00:00Z"
    },
    {
      "name": "Jane Smith",
      "urn": "urn:li:member:234567890",
      "publicUrl": "https://www.linkedin.com/in/janesmith",
      "headline": "CEO at Tech Solutions",
      "connectedAt": "2024-11-22T00:00:00Z"
    },
    {
      "name": "Carlos Santos",
      "urn": null,
      "publicUrl": "https://www.linkedin.com/in/carlossantos",
      "headline": "Project Manager at Startup Hub",
      "connectedAt": "2022-07-06T00:00:00Z"
    }
  ]
}
```

- `label` – included only if specified in the action parameters.
- `data` – array of your connections with results of child actions execution.
  - `name` – full name of the person.
  - `urn` – [URN](/docs/data-conventions#linkedin-urns) of the person, or `null` if LinkedIn does not expose it.
  - `publicUrl` – [public](/faq/what-are-hashed-url-and-public-url) LinkedIn URL of the person.
  - `headline` – headline of the person.
  - `connectedAt` – date when connection was established. Returned only when `filter` is not provided.

2. **Successful retrieval (with filter):**

```json
{
  "actionType": "st.retrieveConnections",
  "label": "listConnections1",
  "success": true,
  "data": [
    {
      "name": "John Doe",
      "urn": "urn:li:member:123456789",
      "publicUrl": "https://www.linkedin.com/in/johndoe",
      "headline": "Founder & CEO at Example Company",
      "location": "Lisbon, Portugal",
      "avatarUrl": "https://media.licdn.com/dms/image/v2/D5603AQE/profile-displayphoto-shrink_100_100/0/1700000000000"
    },
    {
      "name": "Jane Smith",
      "urn": "urn:li:member:234567890",
      "publicUrl": "https://www.linkedin.com/in/janesmith",
      "headline": "CEO at Tech Solutions",
      "location": "San Francisco Bay Area",
      "avatarUrl": null
    },
    {
      "name": "Carlos Santos",
      "urn": null,
      "publicUrl": "https://www.linkedin.com/in/carlossantos",
      "headline": "Project Manager at Startup Hub",
      "location": "Madrid",
      "avatarUrl": null
    }
  ]
}
```

- `label` – included only if specified in the action parameters.
- `data` – array of your connections with results of child actions execution.
  - `name` – full name of the person.
  - `urn` – [URN](/docs/data-conventions#linkedin-urns) of the person, or `null` if LinkedIn does not expose it.
  - `publicUrl` – [public](/faq/what-are-hashed-url-and-public-url) LinkedIn URL of the person.
  - `headline` – headline of the person.
  - `location` – free-form string indicating the person's location. Returned only when `filter` is provided.
  - `avatarUrl` – URL of the person's profile photo, or `null` if the person has no photo. Returned only when `filter` is provided.

3. **Failed retrieval:**

```json
{
  "actionType": "st.retrieveConnections",
  "label": "listConnections1",
  "success": false,
  "error": {
    "type": "retrievingNotAllowed",
    "message": "LinkedIn has blocked performing the retrieval."
  }
}
```

- `label` – included only if specified in the action parameters.
- `error.type` – enum with the following possible values:
  - `filterNotApplied` – LinkedIn offered no matching option for one or more filter values. The message lists each field and value, so correct or remove them rather than retrying.
  - `retrievingNotAllowed` – LinkedIn has blocked performing the retrieval due to exceeding limits or other restrictions.
