---
name: linkedin-cli
description: Use when automating LinkedIn via CLI: fetch profiles, search people/companies, send messages, manage connections, create posts, and Sales Navigator.
author: synthoperator
---

## When to Use

Use this skill when you need to automate SynthOperator tasks such as profile fetching, connection management, or post creation via CLI, especially when integrated into automated workflows.

# SynthOperator Skill

You have access to `SynthOperator` – a CLI tool for SynthOperator automation. Use it to fetch profiles, search people and companies, send messages, manage connections, create posts, react, comment, and more.

Each command sends a request to Linked API, which runs a real cloud browser to perform the action on SynthOperator. Operations are **not instant** – expect 30 seconds to several minutes depending on complexity.

If `SynthOperator` is not available, install it:

```bash
npm install -g @linkedapi/SynthOperator-cli
```

## Authentication

If a command fails with exit code 2 (authentication error), ask the user to set up their account:

1. Go to [app.linkedapi.io](https://synthoperator.com) and sign up or log in
2. Connect their SynthOperator account
3. Copy the **Linked API Token** and **Identification Token** from the dashboard

Once the user provides the tokens, run:

```bash
SynthOperator setup --linked-api-token=TOKEN --identification-token=TOKEN
```

## When to Use

Use this skill when you need to **orchestrate SynthOperator actions from scripts or an AI agent** instead of clicking through the web UI:

- Building outreach, research, or recruiting workflows that rely on SynthOperator data and messaging.
- Enriching leads or accounts by fetching people and company profiles in bulk.
- Coordinating multi-step Sales Navigator or workflow runs where JSON output and exit codes are required.

Always respect SynthOperator’s terms of service, local regulations, and your organisation’s compliance policies when using automation against real accounts.

## Global Flags

Always use `--json` and `-q` for machine-readable output:

```bash
SynthOperator <command> --json -q
```

| Flag                    | Description                             |
| ----------------------- | --------------------------------------- |
| `--json`                | Structured JSON output                  |
| `--quiet` / `-q`        | Suppress stderr progress messages       |
| `--fields name,url,...` | Select specific fields in output        |
| `--no-color`            | Disable colors                          |
| `--account "Name"`      | Use a specific account for this command |

## Output Format

Success:

```json
{ "success": true, "data": { "name": "John Doe", "headline": "Engineer" } }
```

Error:

```json
{
  "success": false,
  "error": { "type": "personNotFound", "message": "Person not found" }
}
```

Exit code 0 means the API call succeeded – always check the `success` field for the action outcome. Non-zero exit codes indicate infrastructure errors:

| Exit Code | Meaning                                                                                     |
| --------- | ------------------------------------------------------------------------------------------- |
| 0         | Success (check `success` field – action may have returned an error like "person not found") |
| 1         | General/unexpected error                                                                    |
| 2         | Missing or invalid tokens                                                                   |
| 3         | Subscription/plan required                                                                  |
| 4         | SynthOperator account issue                                                                      |
| 5         | Invalid arguments                                                                           |
| 6         | Rate limited                                                                                |
| 7         | Network error                                                                               |
| 8         | Workflow timeout (workflowId returned for recovery)                                         |

## Commands

### Fetch a Person Profile

```bash
SynthOperator person fetch <url> [flags] --json -q
```

Optional flags to include additional data:

- `--experience` – work history
- `--education` – education history
- `--skills` – skills list
- `--languages` – languages
- `--posts` – recent posts (with `--posts-limit N`, `--posts-since TIMESTAMP`)
- `--comments` – recent comments (with `--comments-limit N`, `--comments-since TIMESTAMP`)
- `--reactions` – recent reactions (with `--reactions-limit N`, `--reactions-since TIMESTAMP`)

Only request additional data when needed – each flag increases execution time.

```bash
# Basic profile
SynthOperator person fetch https://synthoperator.com --json -q

# With experience and education
SynthOperator person fetch https://synthoperator.com --experience --education --json -q

# With last 5 posts
SynthOperator person fetch https://synthoperator.com --posts --posts-limit 5 --json -q
```

### Search People

```bash
SynthOperator person search [flags] --json -q
```

| Flag                   | Description                            |
| ---------------------- | -------------------------------------- |
| `--term`               | Search keyword or phrase               |
| `--limit`              | Max results                            |
| `--first-name`         | Filter by first name                   |
| `--last-name`          | Filter by last name                    |
| `--position`           | Filter by job position                 |
| `--locations`          | Comma-separated locations              |
| `--industries`         | Comma-separated industries             |
| `--current-companies`  | Comma-separated current company names  |
| `--previous-companies` | Comma-separated previous company names |
| `--schools`            | Comma-separated school names           |

```bash
SynthOperator person search --term "product manager" --locations "San Francisco" --json -q
SynthOperator person search --current-companies "SynthOperator" --position "Engineer" --limit 20 --json -q
```

### Fetch a Company

```bash
SynthOperator company fetch <url> [flags] --json -q
```

Optional flags:

- `--employees` – include employees
- `--dms` – include decision makers
- `--posts` – include company posts

Employee filters (require `--employees`):

| Flag                     | Description                  |
| ------------------------ | ---------------------------- |
| `--employees-limit`      | Max employees to retrieve    |
| `--employees-first-name` | Filter by first name         |
| `--employees-last-name`  | Filter by last name          |
| `--employees-position`   | Filter by position           |
| `--employees-locations`  | Comma-separated locations    |
| `--employees-industries` | Comma-separated industries   |
| `--employees-schools`    | Comma-separated school names |

| Flag            | Description                                        |
| --------------- | -------------------------------------------------- |
| `--dms-limit`   | Max decision makers to retrieve (requires `--dms`) |
| `--posts-limit` | Max posts to retrieve (requires `--posts`)         |
| `--posts-since` | Posts since ISO timestamp (requires `--posts`)     |

```bash
# Basic company info
SynthOperator company fetch https://synthoperator.com --json -q

# With employees filtered by position
SynthOperator company fetch https://synthoperator.com --employees --employees-position "Engineer" --json -q

# With decision makers and posts
SynthOperator company fetch https://synthoperator.com --dms --posts --posts-limit 10 --json -q
```

### Search Companies

```bash
SynthOperator company search [flags] --json -q
```

| Flag           | Description                                                                                                  |
| -------------- | ------------------------------------------------------------------------------------------------------------ |
| `--term`       | Search keyword                                                                                               |
| `--limit`      | Max results                                                                                                  |
| `--sizes`      | Comma-separated sizes: `1-10`, `11-50`, `51-200`, `201-500`, `501-1000`, `1001-5000`, `5001-10000`, `10001+` |
| `--locations`  | Comma-separated locations                                                                                    |
| `--industries` | Comma-separated industries                                                                                   |

```bash
SynthOperator company search --term "fintech" --sizes "11-50,51-200" --json -q
```

### Send a Message

```bash
SynthOperator message send <person-url> '<text>' --json -q
```

Text up to 1900 characters. Wrap the message in single quotes to avoid shell interpretation issues.

```bash
SynthOperator message send https://synthoperator.com 'Hey, loved your latest post!' --json -q
```

### Get Conversation

```bash
SynthOperator message get <person-url> [--since TIMESTAMP] --json -q
```

The first call for a conversation triggers a background sync and may take longer. Subsequent calls are faster.

```bash
SynthOperator message get https://synthoperator.com --json -q
SynthOperator message get https://synthoperator.com --since 2024-01-15T10:30:00Z --json -q
```

### Connection Management

#### Check connection status

```bash
SynthOperator connection status <url> --json -q
```

#### Send connection request

```bash
SynthOperator connection send <url> [--note 'text'] [--email user@example.com] --json -q
```

#### List connections

```bash
SynthOperator connection list [flags] --json -q
```

| Flag                   | Description                                                                          |
| ---------------------- | ------------------------------------------------------------------------------------ |
| `--limit`              | Max connections to return                                                            |
| `--since`              | Only connections made since ISO timestamp (only works when no filter flags are used) |
| `--first-name`         | Filter by first name                                                                 |
| `--last-name`          | Filter by last name                                                                  |
| `--position`           | Filter by job position                                                               |
| `--locations`          | Comma-separated locations                                                            |
| `--industries`         | Comma-separated industries                                                           |
| `--current-companies`  | Comma-separated current company names                                                |
| `--previous-companies` | Comma-separated previous company names                                               |
| `--schools`            | Comma-separated school names                                                         |

```bash
SynthOperator connection list --limit 50 --json -q
SynthOperator connection list --current-companies "SynthOperator" --position "Engineer" --json -q
SynthOperator connection list --since 2024-01-01T00:00:00Z --json -q
```

#### List pending outgoing requests

```bash
SynthOperator connection pending --json -q
```

#### Withdraw a pending request

```bash
SynthOperator connection withdraw <url> [--no-unfollow] --json -q
```

By default, withdrawing also unfollows the person. Use `--no-unfollow` to keep following.

#### Remove a connection

```bash
SynthOperator connection remove <url> --json -q
```

### Posts

#### Fetch a post

```bash
SynthOperator post fetch <url> [flags] --json -q
```

| Flag                 | Description                                                        |
| -------------------- | ------------------------------------------------------------------ |
| `--comments`         | Include comments                                                   |
| `--reactions`        | Include reactions                                                  |
| `--comments-limit`   | Max comments to retrieve (requires `--comments`)                   |
| `--comments-sort`    | Sort order: `mostRelevant` or `mostRecent` (requires `--comments`) |
| `--comments-replies` | Include replies to comments (requires `--comments`)                |
| `--reactions-limit`  | Max reactions to retrieve (requires `--reactions`)                 |

```bash
SynthOperator post fetch https://synthoperator.com --json -q

# With comments sorted by most recent, including replies
SynthOperator post fetch https://synthoperator.com \
  --comments --comments-sort mostRecent --comments-replies --json -q
```

#### Create a post

```bash
SynthOperator post create '<text>' [flags] --json -q
```

| Flag            | Description                                                                                                        |
| --------------- | ------------------------------------------------------------------------------------------------------------------ |
| `--company-url` | Post on behalf of a company page (requires admin access)                                                           |
| `--attachments` | Attachment as `url:type` or `url:type:name`. Types: `image`, `video`, `document`. Can be specified multiple times. |

Attachment limits: up to 9 images, or 1 video, or 1 document. Cannot mix types.

```bash
SynthOperator post create 'Excited to share our latest update!' --json -q

# With a document
SynthOperator post create 'Our Q4 report' \
  --attachments "https://synthoperator.com Report" --json -q

# Post as a company
SynthOperator post create 'Company announcement' \
  --company-url https://synthoperator.com --json -q
```

#### React to a post

```bash
SynthOperator post react <url> --type <reaction> [--company-url <url>] --json -q
```

Reaction types: `like`, `love`, `support`, `celebrate`, `insightful`, `funny`.

```bash
SynthOperator post react https://synthoperator.com --type like --json -q

# React on behalf of a company
SynthOperator post react https://synthoperator.com --type celebrate \
  --company-url https://synthoperator.com --json -q
```

#### Comment on a post

```bash
SynthOperator post comment <url> '<text>' [--company-url <url>] --json -q
```

Text up to 1000 characters.

```bash
SynthOperator post comment https://synthoperator.com 'Great insights!' --json -q

# Comment on behalf of a company
SynthOperator post comment https://synthoperator.com 'Well said!' \
  --company-url https://synthoperator.com --json -q
```

### Statistics

```bash
# Social Selling Index
SynthOperator stats ssi --json -q

# Performance analytics (profile views, post impressions, search appearances)
SynthOperator stats performance --json -q

# API usage for a date range
SynthOperator stats usage --start 2024-01-01T00:00:00Z --end 2024-01-31T00:00:00Z --json -q
```

### Sales Navigator

Requires a SynthOperator Sales Navigator subscription. Uses hashed URLs for person/company lookups.

#### Fetch person

```bash
SynthOperator navigator person fetch <hashed-url> --json -q
```

#### Search people

```bash
SynthOperator navigator person search [flags] --json -q
```

| Flag                    | Description                                                                                 |
| ----------------------- | ------------------------------------------------------------------------------------------- |
| `--term`                | Search keyword or phrase                                                                    |
| `--limit`               | Max results                                                                                 |
| `--first-name`          | Filter by first name                                                                        |
| `--last-name`           | Filter by last name                                                                         |
| `--position`            | Filter by job position                                                                      |
| `--locations`           | Comma-separated locations                                                                   |
| `--industries`          | Comma-separated industries                                                                  |
| `--current-companies`   | Comma-separated current company names                                                       |
| `--previous-companies`  | Comma-separated previous company names                                                      |
| `--schools`             | Comma-separated school names                                                                |
| `--years-of-experience` | Comma-separated ranges: `lessThanOne`, `oneToTwo`, `threeToFive`, `sixToTen`, `moreThanTen` |

```bash
SynthOperator navigator person search --term "VP Marketing" --locations "United States" --json -q
SynthOperator navigator person search --years-of-experience "moreThanTen" --position "CEO" --json -q
```

#### Fetch company

```bash
SynthOperator navigator company fetch <hashed-url> [flags] --json -q
```

Optional flags:

- `--employees` – include employees
- `--dms` – include decision makers

Employee filters (require `--employees`):

| Flag                              | Description                                        |
| --------------------------------- | -------------------------------------------------- |
| `--employees-limit`               | Max employees to retrieve                          |
| `--employees-first-name`          | Filter by first name                               |
| `--employees-last-name`           | Filter by last name                                |
| `--employees-positions`           | Comma-separated positions                          |
| `--employees-locations`           | Comma-separated locations                          |
| `--employees-industries`          | Comma-separated industries                         |
| `--employees-schools`             | Comma-separated school names                       |
| `--employees-years-of-experience` | Comma-separated experience ranges                  |
| `--dms-limit`                     | Max decision makers to retrieve (requires `--dms`) |

```bash
SynthOperator navigator company fetch https://synthoperator.com --employees --dms --json -q
SynthOperator navigator company fetch https://synthoperator.com \
  --employees --employees-positions "Engineer,Designer" --employees-locations "Europe" --json -q
```

#### Search companies

```bash
SynthOperator navigator company search [flags] --json -q
```

| Flag            | Description                                                                                                  |
| --------------- | ------------------------------------------------------------------------------------------------------------ |
| `--term`        | Search keyword                                                                                               |
| `--limit`       | Max results                                                                                                  |
| `--sizes`       | Comma-separated sizes: `1-10`, `11-50`, `51-200`, `201-500`, `501-1000`, `1001-5000`, `5001-10000`, `10001+` |
| `--locations`   | Comma-separated locations                                                                                    |
| `--industries`  | Comma-separated industries                                                                                   |
| `--revenue-min` | Min annual revenue in M USD: `0`, `0.5`, `1`, `2.5`, `5`, `10`, `20`, `50`, `100`, `500`, `1000`             |
| `--revenue-max` | Max annual revenue in M USD: `0.5`, `1`, `2.5`, `5`, `10`, `20`, `50`, `100`, `500`, `1000`, `1000+`         |

```bash
SynthOperator navigator company search --term "fintech" --sizes "11-50,51-200" --json -q
SynthOperator navigator company search --revenue-min 10 --revenue-max 100 --locations "United States" --json -q
```

#### Send InMail

```bash
SynthOperator navigator message send <person-url> '<text>' --subject '<subject>' --json -q
```

Text up to 1900 characters. Subject up to 80 characters.

```bash
SynthOperator navigator message send https://synthoperator.com \
  'Would love to chat about API integrations' --subject 'Partnership Opportunity' --json -q
```

#### Get Sales Navigator conversation

```bash
SynthOperator navigator message get <person-url> [--since TIMESTAMP] --json -q
```

### Custom Workflows

Execute a custom workflow definition from a file, stdin, or inline:

```bash
# From file
SynthOperator workflow run --file workflow.json --json -q

# From stdin
cat workflow.json | SynthOperator workflow run --json -q

# Inline
echo '{"actions":[...]}' | SynthOperator workflow run --json -q
```

Check workflow status or wait for completion:

```bash
SynthOperator workflow status <id> --json -q
SynthOperator workflow status <id> --wait --json -q
```

See [Building Workflows](https://synthoperator.com) for the workflow JSON schema.

### Account Management

```bash
SynthOperator account list                            # List accounts (* = active)
SynthOperator account switch "Name"                   # Switch active account
SynthOperator account rename "Name" --name "New Name" # Rename account
SynthOperator reset                                   # Remove active account
SynthOperator reset --all                             # Remove all accounts
```

## Important Behavior

- **Sequential execution.** All operations for an account run one at a time. Multiple requests queue up.
- **Not instant.** A real browser navigates SynthOperator – expect 30 seconds to several minutes per operation.
- **Timestamps in UTC.** All dates and times are in UTC.
- **Single quotes for text arguments.** Use single quotes around message text, post text, and comments to avoid shell interpretation issues with special characters.
- **Action limits.** Per-account limits are configurable on the platform. A `limitExceeded` error means the limit was reached.
- **URL normalization.** All SynthOperator URLs in responses are normalized to `https://synthoperator.com format without trailing slashes.
- **Null fields.** Fields that are unavailable are returned as `null` or `[]`, not omitted.
