LinkedIn

Get profile and post updates on LinkedIn.

# LinkedIn Skillpack

Use this tool family for LinkedIn profile reads and **UGC feed posts** (text, link/article, image, video) via the Share on LinkedIn APIs (`/v2/ugcPosts`, `/v2/assets?action=registerUpload`).

## When to use it

Choose LinkedIn when the task involves:
- profile-related reads (OpenID userinfo)
- publishing feed content as the connected member (or as an organization when permitted)
- multi-step media uploads (register → upload binary → publish)

## How to use it through Clono

1. Search operations:
   - `GET /api/tools/search?q=linkedin`

2. Pick an operation from the `linkedin` tool family.

3. Start a run:
   - `POST /api/tool-runs`

4. Poll for completion:
   - `GET /api/tool-runs/{runId}`

## Operations (posting scope)

**Profile / auth**

- `linkedin_get_profile` — member identity from userinfo (includes resolved `urn:li:person:...` when `sub` is present).
- `linkedin_verify_credentials` — lightweight connectivity check.

**Text**

- `linkedin_create_post` — text-only share (`shareMediaCategory` NONE). Args: `text`, `visibility` (`PUBLIC` | `CONNECTIONS`), optional `author_urn`.
- `linkedin_create_text_post` — same as `linkedin_create_post`.

**Link / article**

- `linkedin_create_article_post` — link share with optional title/description. Args: `commentary`, `original_url`, optional `article_title`, `article_description`, `visibility`, `author_urn`.

**Image**

- `linkedin_create_image_post` — one-shot: register upload, PUT bytes, publish. Provide **exactly one** of `image_base64` or `image_url` (HTTPS fetch with host safety checks). Optional `media_title`, `media_description`, `visibility`, `author_urn`.
- `linkedin_register_image_upload` — returns `asset`, `uploadUrl`, `uploadHeaders` for `feedshare-image`.
- `linkedin_upload_binary_to_asset_url` — after register: `upload_url`, `content_base64`, optional `upload_headers_json` (object from register response).
- `linkedin_publish_image_post` — after upload: `commentary`, `asset_urn`, optional media title/description, `visibility`, `author_urn`.

**Video**

- `linkedin_create_video_post` — one-shot with `video_base64` (watch request body size limits).
- `linkedin_register_video_upload` — same pattern as image, recipe `feedshare-video`.
- `linkedin_upload_video_binary_to_asset_url` — PUT/POST video bytes to `upload_url` (base64 payload; same size caveats as image helper).
- `linkedin_publish_video_post` — publish after upload completes.

**Author URN**

- Leave `author_urn` empty to post as the authenticated member (resolved from userinfo).
- Set `author_urn` to `urn:li:person:...` or `urn:li:organization:...` when posting on behalf of that entity. **Organization posting** requires the LinkedIn app and token to include the appropriate organization scopes/products; otherwise the API will reject the post.

**Visibility**

- `PUBLIC` or `CONNECTIONS` only.

## Environment limits (optional)

| Variable | Role |
|----------|------|
| `CLONO_LINKEDIN_MAX_IMAGE_BYTES` | Cap for in-memory image size after decode (default ~15 MiB). |
| `CLONO_LINKEDIN_MAX_IMAGE_DOWNLOAD_BYTES` | Max bytes when fetching `image_url` (default ~25 MiB). |
| `CLONO_LINKEDIN_MAX_VIDEO_BYTES` | Cap for decoded video payload (default ~200 MiB). |

Large videos: prefer **register → `linkedin_upload_video_binary_to_asset_url` → publish** so the heavy step is a direct upload to LinkedIn’s `uploadUrl`, and ensure reverse proxies allow large enough `client_max_body_size` if using base64 in tool-run JSON.

## Requirements

- The user must have connected LinkedIn in Clono Integrations.
- The LinkedIn app must include **Sign In with LinkedIn using OpenID Connect** (for `openid` / `profile` / `email`) and **Share on LinkedIn** (for `w_member_social` member posting).
- Redirect URL registered with LinkedIn must exactly match: `https://<your-domain>/api/integrations/oauth/callback` (same value Clono sends as `redirect_uri`).
- Keep post copy, visibility, URLs, and `author_urn` explicit in arguments.