# nv.retrieveCompanyDMs

> 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 company decision makers from Sales Navigator and perform additional person-related actions if needed.

:::surface node,python
In the SDK this action runs inside `nvFetchCompany` with `retrieveDMs` enabled; its result comes back in `data.dms`, and its errors in `errors`.
:::

:::surface cli
In the CLI this action runs inside `linkedin navigator company fetch` with `--dms`; that command's other options are on [`nv.openCompanyPage`](/docs/action-nv-open-company-page).
:::

> Decision makers are ranked by seniority, starting with the highest-level positions. For example, founders and C-level executives are returned first, followed by VPs, directors, and so on.

## Constraints

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

> ⬆️ **Parent Actions:** [nv.openCompanyPage](/docs/action-nv-open-company-page).

> ⬇️ **Child Actions:** [nv.doForPeople](/docs/action-nv-do-for-people).

## Parameters

```json tab=HTTP
{
  "actionType": "nv.retrieveCompanyDMs",
  "label": "company1DMs",
  "limit": 3,
  "then": { ... }
}
```

```typescript tab=Node
const workflow = await linkedapi.nvFetchCompany.execute({
  companyHashedUrl: "https://www.linkedin.com/company/12345678",
  retrieveDMs: true,
});

const { data, errors } = await linkedapi.nvFetchCompany.result(workflow.workflowId);
console.log(data?.dms);
console.log(errors);
```

```python tab=Python
from linkedapi import NvFetchCompanyParams

workflow = linkedapi.nv_fetch_company.execute(
    NvFetchCompanyParams(
        company_hashed_url="https://www.linkedin.com/company/12345678",
        retrieve_dms=True,
    )
)

result = linkedapi.nv_fetch_company.result(workflow.workflow_id)
if result.data:
    print(result.data.dms)
print(result.errors)
```

```bash tab=CLI
linkedin navigator company fetch https://www.linkedin.com/company/12345678 --dms --json
```

- `label` (optional) – custom label for tracking this action in workflow completion.
- `limit` (optional) – maximum number of decision makers to retrieve. Defaults to **20**, with a maximum value of **20**. If a company has fewer decision makers than specified, only the available ones will be returned.
- `then` (optional) – object or array of child actions to be executed within this action.

## Result options

1. **Successful retrieval:**

```json
{
  "actionType": "nv.retrieveCompanyDMs",
  "label": "company1DMs",
  "success": true,
  "data": [
    {
      "name": "John Doe",
      "urn": "urn:li:member:123456789",
      "hashedUrl": "https://www.linkedin.com/in/SInQBmjJ015eLr8OeJoj0mrkxx7Jiuy0",
      "position": "Founder",
      "location": "New York, USA",
      "avatarUrl": "https://media.licdn.com/dms/image/v2/D5603AQE/profile-displayphoto-shrink_100_100/0/1700000000000",
      "countryCode": "US",
      "viewerState": { "connectionDegree": "2nd" },
      "then": { ... }
    },
    {
      "name": "Jane Smith",
      "urn": null,
      "hashedUrl": "https://www.linkedin.com/in/ACoAA2DdsSV83B48UDvgO5jPoу3Gho0o",
      "position": "CEO",
      "location": "San Francisco, USA",
      "avatarUrl": null,
      "countryCode": "US",
      "viewerState": { "connectionDegree": "3rd+" },
      "then": { ... }
    }
  ]
}
```

- `label` – included only if specified in the action parameters.
- `data` – array of decision makers with results of child actions execution.
  - `name` – full name of the decision-maker.
  - `urn` – [URN](/docs/data-conventions#linkedin-urns) of the decision-maker, or `null` if LinkedIn does not expose it.
  - `hashedUrl` – [hashed](/faq/what-are-hashed-url-and-public-url) LinkedIn URL of the decision-maker.
  - `position` – job position of the decision-maker.
  - `location` – free-form string indicating the decision-maker's location.
  - `avatarUrl` – URL of the decision-maker's profile photo, or `null` if the decision-maker has no photo.
  - `countryCode` – two-character code of the decision-maker's country.
  - `viewerState` – how your account relates to the decision-maker, see [viewer state](/docs/data-conventions#viewer-state).
    - `connectionDegree` – `1st`, `2nd`, or `3rd+`, as LinkedIn shows it next to the name, or `null` if LinkedIn does not show it.
  - `then` – results of child actions execution.

2. **Failed retrieval:**

```json
{
  "actionType": "nv.retrieveCompanyDMs",
  "label": "company1DMs",
  "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:
  - `retrievingNotAllowed` – LinkedIn has blocked performing the retrieval due to exceeding limits or other restrictions.
  - `searchTemporarilyUnavailable` – Sales Navigator search, which this action uses to list decision makers, is temporarily unavailable on LinkedIn's side because too many requests were made in a short time. This can last from about an hour to several hours, so wait at least an hour before retrying: retrying sooner fails the same way. The `message` is: `Sales Navigator search is temporarily unavailable on LinkedIn's side due to too many requests in a short time. Please try again a little later.` If the action has child actions, they may already have run for decision makers found before this error. The failed result does not list them, so check what those actions did, for example which messages were sent, before retrying.
