Linkedin

From seaworld008/Commonly-used-high-value-skills · View interactive version

Linkedin is an AI agent skill from the GitHub repository seaworld008/Commonly-used-high-value-skills. General-purpose LinkedIn automation – fetch profiles, search people and companies, send messages, manage connections, create posts, and more. Use when the user wants to interact with LinkedIn.

How to use this skill

Skill file

LinkedIn Skill

You have access to linkedin – a CLI tool for LinkedIn 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 LinkedIn. Operations are not instant – expect 30 seconds to several minutes depending on complexity.

Check command -v linkedin first. If it is missing, explain that the following command installs the CLI globally. Run it only when the task authorizes a global installation.

npm install -g @linkedapi/linkedin-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 and sign up or log in
  2. Connect their LinkedIn account
  3. Copy the Linked API Token and Identification Token from the dashboard

The account owner completes authentication in their own secure local setup. Do not ask for tokens in chat or place them in command arguments. Inspect the installed CLI help for its supported secure configuration path; the following is a local setup responsibility, not an agent command:

Account owner: configure Linked API and Identification credentials locally.
Agent: retry only after the configured CLI reports authentication is available.

Global Flags

Always use --json and -q for machine-readable output:

LINKEDAPI_CLIENT=skill:linkedin linkedin <command> --json -q

When using this skill, run every linkedin ... example below with the

LINKEDAPI_CLIENT=skill:linkedin prefix so Linked API can attribute usage to the skill.

| 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

Read the detailed procedure and examples when working on this part of the task.

Commands

Fetch a Person Profile

Read the detailed procedure and examples when working on this part of the task.

Endorse a Person's Skills

linkedin person endorse <url> --skill 'Project Management' --json -q
linkedin person endorse <url> --pattern manage --pattern '^scrum$' --json -q
linkedin person endorse <url> --all --json -q

Choose exactly one of --skill, --pattern or --all:

Skill names are in the profile owner's language, regardless of your own LinkedIn language. Fetch the profile with --skills first when you need to discover the names; a German profile may list Projektmanagement rather than Project Management.

Only 1st-degree connections can receive endorsements. An already-endorsed skill stays endorsed and counts as success. Each successful endorsement, including an existing one, counts toward the account's stEndorsements limit. With --pattern or --all, check every item's success and error.type in data: a failed skill does not stop the others, and limitExceeded can affect only part of the result.

Endorsements are external account writes. Execute only for the authorized account, selected people/skills and approved batch scope. Enabling ongoing inbox sync is a separate persistent operation.

Search People

linkedin 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 |

| --connection-degrees | Comma-separated connection degrees: 1st, 2nd, 3rd+ |

linkedin person search --term "product manager" --locations "San Francisco" --json -q
linkedin person search --term "engineer" --current-companies "Google" --position "Engineer" --limit 20 --json -q

Fetch a Company

Read the detailed procedure and examples when working on this part of the task.

Search Companies

linkedin 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 |

linkedin company search --term "fintech" --sizes "11-50,51-200" --json -q

Send a Message

linkedin message send <person-url> '<text>' --json -q

Text up to 1900 characters. Wrap the message in single quotes to avoid shell interpretation issues.

linkedin message send https://www.linkedin.com/in/username 'Hey, loved your latest post!' --json -q

Inbox

To read messages use inbox get. Call message get only when you need a person's earlier history, and never repeat it to check for new messages.

If the account holder authorized ongoing monitoring of this inbox, enable sync once for that inbox. It captures only messages received after activation.

linkedin inbox sync --json -q          # standard inbox
linkedin inbox sync --nv --json -q     # Sales Navigator inbox

New messages from everyone, with an advancing --since:

linkedin inbox get --since 2024-01-15T10:30:00Z --json -q

The whole known conversation with one person, including history loaded by message get:

linkedin inbox get --person https://www.linkedin.com/in/username --json -q

With --person, the output has messages and threads. Each thread has historyComplete: if it is false and you need earlier messages, run message get <person-url> once, then inbox get --person again. A hashed person URL (personHashedUrl from a message) always matches; a public URL matches only once Linked API knows it, so prefer the hashed URL when messages show personPublicUrl: null. Message times are whole minutes: to check for a reply, pass --type of your message and --since a few minutes before it, take the earliest us message in the result (the one you sent, not a later follow-up) and count a them message that is not earlier than it; if your message is not in the result yet, the reply is not known yet.

Get Conversation

linkedin message get <person-url> [--since TIMESTAMP] --json -q

Loads the person's earlier history on the first call, which may take longer; subsequent calls are faster. Prefer linkedin inbox get --person <url> to read messages – use this only when you need history from before inbox monitoring was enabled.

linkedin message get https://www.linkedin.com/in/username --json -q
linkedin message get https://www.linkedin.com/in/username --since 2024-01-15T10:30:00Z --json -q

Connection Management

Check connection status
linkedin connection status <url> --json -q
Send connection request
linkedin connection send <url> [--note 'text'] [--email user@example.com] --json -q
List connections
linkedin 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 |

linkedin connection list --limit 50 --json -q
linkedin connection list --current-companies "Google" --position "Engineer" --json -q
linkedin connection list --since 2024-01-01T00:00:00Z --json -q
List pending outgoing requests
linkedin connection pending --json -q
List incoming connection requests

Invitations that others have sent to you (received requests).

linkedin connection requests --json -q
Accept an incoming request
linkedin connection accept <url> --json -q
Ignore an incoming request
linkedin connection ignore <url> --json -q
Withdraw a pending request
linkedin connection withdraw <url> [--no-unfollow] --json -q

By default, withdrawing also unfollows the person. Use --no-unfollow to keep following.

Remove a connection
linkedin connection remove <url> --json -q

Posts

Fetch a post
linkedin 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) |

linkedin post fetch https://www.linkedin.com/posts/username_activity-123 --json -q

# With comments sorted by most recent, including replies
linkedin post fetch https://www.linkedin.com/posts/username_activity-123 \
  --comments --comments-sort mostRecent --comments-replies --json -q
Search posts
linkedin post search [flags] --json -q

| Flag | Description |

|------|-------------|

| --term | Search keyword or phrase, up to 50 characters |

| --limit | Max results to return, up to 100 |

| --from-members | People whose posts to keep |

| --from-companies | Companies whose posts to keep |

| --mentioning-members | People the post must mention |

| --mentioning-companies | Companies the post must mention |

| --author-companies | Companies the author works at |

Each actor flag is a comma-separated list. An element is name or name:identifier, where the identifier is a URN or LinkedIn URL of that person or company and pins the filter to exactly them. A name alone may match a namesake. When an entry cannot be applied, the action fails with filterNotApplied; correct or remove it rather than retrying.

linkedin post search --term "ai" --from-members "Bill Gates,Example Person:urn:li:member:123456789" --json -q
Create a post
linkedin 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. |

| --mention | One mention, bound to @[key] in the text. Format below. Can be specified multiple times, up to 20. |

Attachment limits: up to 9 images, or 1 video, or 1 document. Cannot mix types.

Mention format — write @[key] in the text, then describe that key with --mention as key:name or key:name:identifier. Everything after the second : is the identifier, so its own colons need no escaping. The identifier is optional and is one of urn:li:member:<id>, urn:li:organization:<id>, a hashed profile URL, or a hashed company URL; without it LinkedIn's first suggestion for name is used, which may not be the entity you meant. Every @[key] must have a matching --mention and vice versa, and keys cannot repeat.

linkedin post create 'Excited to share our latest update!' --json -q

# With a document
linkedin post create 'Our Q4 report' \
  --attachments "https://example.com/report.pdf:document:Q4 Report" --json -q

# Mentioning a person
linkedin post create 'Huge thanks to @[author] for the write-up!' \
  --mention "author:Example Person:urn:li:member:123456789" --json -q

# Post as a company
linkedin post create 'Company announcement' \
  --company-url https://www.linkedin.com/company/name --json -q
Repost a post
linkedin post repost <url> [flags] --json -q

| Flag | Description |

|------|-------------|

| --text | Your own commentary (up to 3000 characters). Without it the post is reposted as is. |

| --mention | One mention, bound to @[key] in --text. Same format as for post create. Can be specified multiple times, up to 20. |

The repost's own postUrl and postUrn come back, not those of the post you reposted. They are empty when the repost was published but LinkedIn did not return its address — do not retry, the repost is already live.

alreadyReposted is returned only when LinkedIn refuses an instant repost (one without --text). LinkedIn does not always refuse a repeat repost: a repost of your own post, or a repost with commentary, can be published again. Keep track of what you have already reposted instead of relying on this error.

linkedin post repost https://www.linkedin.com/posts/username_activity-123 --json -q

# With commentary
linkedin post repost urn:li:activity:1234567890123456789 \
  --text 'Worth reading, especially the part on onboarding.' --json -q
React to a post
linkedin post react <url> --type <reaction> [--company-url <url>] --json -q

Reaction types: like, love, support, celebrate, insightful, funny.

linkedin post react https://www.linkedin.com/posts/username_activity-123 --type like --json -q

# React on behalf of a company
linkedin post react https://www.linkedin.com/posts/username_activity-123 --type celebrate \
  --company-url https://www.linkedin.com/company/name --json -q
Comment on a post
linkedin post comment <url> '<text>' [--company-url <url>] --json -q

Text up to 1000 characters.

linkedin post comment https://www.linkedin.com/posts/username_activity-123 'Great insights!' --json -q

# Comment on behalf of a company
linkedin post comment https://www.linkedin.com/posts/username_activity-123 'Well said!' \
  --company-url https://www.linkedin.com/company/name --json -q

Statistics

Read the detailed commands and examples when this feature is needed.

Sales Navigator

Read the detailed commands and examples when this feature is needed.

Custom Workflows

Execute a custom workflow definition from a file, stdin, or inline:

# From file
linkedin workflow run --file workflow.json --json -q

# From stdin
cat workflow.json | linkedin workflow run --json -q

# Inline
echo '{"actions":[...]}' | linkedin workflow run --json -q

Check workflow status or wait for completion:

linkedin workflow status <id> --json -q
linkedin workflow status <id> --wait --json -q

See Building Workflows for the workflow JSON schema.

Changelog

Read what is new in Linked API. Check it before telling the user that something is not supported yet – the capability may have shipped recently. No authentication is needed:

linkedin changelog --json -q                       # Every release, newest first
linkedin changelog --since 2026-10-01 --json -q    # Releases from that week on

The JSON is the changelog itself, not the usual success/data envelope: entries holds releases, each with a date (the Monday of its week) and items with title, body and docs (a path on https://linkedapi.io). A release counts as shipped at the end of its week, so --since in the middle of a week still returns that week's release – deduplicate by date. A malformed --since exits with code 5 and the server's message.

Account Management

linkedin account list                            # List accounts (* = active)
linkedin account switch "Name"                   # Switch active account
linkedin account rename "Name" --name "New Name" # Rename account
linkedin reset                                   # Remove active account
linkedin reset --all                             # Remove all accounts

Important Behavior

<!-- LOCAL-CURATION-SUPPLEMENT:START -->

Boundaries and Safe Authorization

changes, and workflows containing any of those steps as external writes. Run them only

when the user has explicitly requested the specific action. For bulk writes, confirm the

account, audience, approximate count, content, and timing before execution unless those

details were already approved in the current request.

impersonate another person, or use this skill for deceptive, discriminatory, harassing,

or indiscriminate outreach.

limits, CAPTCHAs, account warnings, or access restrictions; stop and report them instead.

history, or committed files, and do not retain profile data longer than the task requires.

write and ask the user to clarify it.

<!-- LOCAL-CURATION-SUPPLEMENT:END -->

Reviewed CLI compatibility (2026-11-23)

Standard and Sales Navigator person/company searches require a term or a correctly typed search URL; URL input overrides words and filters. In CLI ≥ 1.2.24, list items containing commas use a single JSON string-array argument, e.g. --locations '["Chicago, Illinois","Denver"]'. Search-based identification of anonymous viewers returns candidates, not proof of identity.

Signals (CLI ≥ 1.4.0; listAlerts ≥ 1.4.1), Sales Navigator saved lists/searches (≥ 1.2.26, Plus), and Recruiter Lite (≥ 1.3.0, Plus and a Recruiter seat) are optional contracts. navigator alerts --subject also accepts urn:li:member:<id> and urn:li:organization:<id> in CLI ≥ 1.4.1. Do not create ongoing monitoring from a one-off search. Signals consume quotas, first checks generally establish a baseline, listAlerts (alertPublished) matches members via subjectUrn / subjectHashedUrl and consumes zero account limits, events require a detectedAt cursor and ID deduplication, and stopped signals cannot resume.

For saved-list operations distinguish removing one membership, unsaving from all lists, and deleting a list while keeping members saved. Preserve IDs as strings. Recruiter search URLs and filter/term input are mutually exclusive. Never add --allow-paid-credit unless the specific message and its paid-credit use are authorized. An uncertain send or create result must be reconciled by reading before retrying. Verify installed CLI help and account entitlements before these optional workflows; no live account operation was performed in this review.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.