> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# LinkedIn API reference

> API reference for the LinkedIn plugin in Corsair: every `linkedin.api.*` operation with its input and output types, taken from the plugin's Zod schemas.

> [!NOTE]
>
> **New to Corsair?** See [API access](https://docs.corsair.dev/concepts/api.md), [authentication](https://docs.corsair.dev/concepts/auth.md), and [error handling](https://docs.corsair.dev/concepts/error-handling).

## Ads

### getAudienceCounts

`ads.getAudienceCounts`

Retrieve audience size counts for targeting criteria.

**Risk:** `read`

```ts theme={null}
await corsair.linkedin.api.ads.getAudienceCounts({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `target` | `Record<string, any>` | Yes | Targeting criteria to estimate audience size for, as a LinkedIn targeting object (e.g. \{ and: \[ \{ or: \[...] }] }). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `elements` | `Record<string, any>[]` | No | Audience size entries for the given targeting criteria. |
| `paging` | `object` | No | — |

> [accordion] paging full type
>
> ```ts theme={null}
> {
>   start?: number,
>   count?: number,
>   total?: number,
>   links?: Record<string, any>[]
> }
> ```

***

### getTargetingFacets

`ads.getTargetingFacets`

Retrieve available LinkedIn ad targeting facets.

**Risk:** `read`

```ts theme={null}
await corsair.linkedin.api.ads.getTargetingFacets({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `facets` | `Record<string, any>[]` | No | Available targeting facets. |
| `elements` | `Record<string, any>[]` | No | — |

***

### searchTargetingEntities

`ads.searchTargetingEntities`

Search LinkedIn ad targeting entities via typeahead.

**Risk:** `read`

```ts theme={null}
await corsair.linkedin.api.ads.searchTargetingEntities({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `query` | `string` | Yes | Typeahead search query for targeting entities. |
| `type` | `string` | No | Optional facet type to scope the search (e.g. locations, titles, industries). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `elements` | `Record<string, any>[]` | No | Matching targeting entities. |
| `paging` | `object` | No | — |

> [accordion] paging full type
>
> ```ts theme={null}
> {
>   start?: number,
>   count?: number,
>   total?: number,
>   links?: Record<string, any>[]
> }
> ```

***

## Comments

### create

`comments.create`

Create a comment on a LinkedIn share, UGC post, or comment.

**Risk:** `write`

```ts theme={null}
await corsair.linkedin.api.comments.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `commented_on_urn` | `string` | Yes | URN of the object being commented on: a share, UGC post, or parent comment. |
| `actor` | `string` | Yes | URN of the member or organization posting the comment, e.g. urn:li:person:... or urn:li:organization:.... |
| `message` | `string` | Yes | The text of the comment (max 3000 characters). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | No | The URN of the created comment. |
| `message` | `string` | No | The comment text. |
| `object` | `string` | No | The URN the comment was posted on. |
| `lastModified` | `Record<string, any>` | No | — |

***

## Images

### get

`images.get`

Retrieve details of a single LinkedIn image by URN.

**Risk:** `read`

```ts theme={null}
await corsair.linkedin.api.images.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `image_urn` | `string` | Yes | The image URN (e.g. urn:li:image:C4D22...) whose details to retrieve. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The image URN. |
| `owner` | `string` | No | — |
| `status` | `string` | No | UPLOADING, AVAILABLE, WAITING\_UPLOAD, etc. |
| `downloadUrl` | `string \| null` | No | — |
| `original` | `object` | No | — |

> [accordion] original full type
>
> ```ts theme={null}
> {
>   size?: string,
>   width?: number,
>   height?: number
> }
> ```

***

### initializeUpload

`images.initializeUpload`

Initialize a LinkedIn image upload and return an upload URL.

**Risk:** `write`

```ts theme={null}
await corsair.linkedin.api.images.initializeUpload({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `owner` | `string` | Yes | Owner URN that will own the uploaded image, e.g. urn:li:person:... or urn:li:organization:.... |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `value` | `object` | Yes | — |

> [accordion] value full type
>
> ```ts theme={null}
> {
>   image: string,
>   uploadUrl?: string,
>   uploadUrlExpiresAt?: number
> }
> ```

***

### list

`images.list`

Retrieve LinkedIn image metadata.

**Risk:** `read`

```ts theme={null}
await corsair.linkedin.api.images.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `owner` | `string` | No | Owner URN. Returns images owned by this member/org. |
| `urns` | `string[]` | No | Specific image URNs to fetch in a single batch request. |
| `start` | `number` | No | Pagination start index. |
| `count` | `number` | No | Number of images per page. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `elements` | `object[]` | Yes | — |
| `paging` | `object` | No | — |

> [accordion] elements full type
>
> ```ts theme={null}
> {
>   id: string,
>   owner?: string,
>   status?: string,
>   downloadUrl?: string | null,
>   original?: {
>     size?: string,
>     width?: number,
>     height?: number
>   }
> }[]
> ```

> [accordion] paging full type
>
> ```ts theme={null}
> {
>   start?: number,
>   count?: number,
>   total?: number,
>   links?: Record<string, any>[]
> }
> ```

***

### registerUpload

`images.registerUpload`

Register a native image upload for feed shares.

**Risk:** `write`

```ts theme={null}
await corsair.linkedin.api.images.registerUpload({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `owner` | `string` | Yes | Owner URN for the media asset, e.g. urn:li:person:... or urn:li:organization:.... |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `value` | `object` | Yes | — |

> [accordion] value full type
>
> ```ts theme={null}
> {
>   asset: string,
>   mediaArtifact?: string,
>   uploadMechanism?: Record<string, any>
> }
> ```

***

## Organizations

### getCompanyInfo

`organizations.getCompanyInfo`

Retrieve organizations where the user has roles.

**Risk:** `read`

```ts theme={null}
await corsair.linkedin.api.organizations.getCompanyInfo({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `role_assignee` | `string` | No | Person URN whose organization roles to list. Defaults to the authenticated member. |
| `role` | `(ADMINISTRATOR \| DIRECT_SPONSORED_CONTENT_POSTER \| RECRUITING_POSTER \| LEAD_GEN_FORMS_MANAGER \| CONTENT_ADMIN \| ANALYTICS_ROLE)[]` | No | Filter to specific organization roles. |
| `state` | `APPROVED \| PENDING \| REVOKED` | No | Filter to ACLs in a given state. Defaults to APPROVED. |
| `start` | `number` | No | Zero-based pagination offset into the role list. |
| `count` | `number` | No | Maximum number of roles to return per page. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `elements` | `object[]` | Yes | — |
| `paging` | `object` | No | — |

> [accordion] elements full type
>
> ```ts theme={null}
> {
>   organization?: string,
>   organizationRoleAssignee?: string,
>   role?: string,
>   state?: string
> }[]
> ```

> [accordion] paging full type
>
> ```ts theme={null}
> {
>   start?: number,
>   count?: number,
>   total?: number,
>   links?: Record<string, any>[]
> }
> ```

***

### getNetworkSize

`organizations.getNetworkSize`

Retrieve the follower count for a LinkedIn organization.

**Risk:** `read`

```ts theme={null}
await corsair.linkedin.api.organizations.getNetworkSize({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `organization_urn` | `string` | Yes | The organization URN (e.g. urn:li:organization:2414183) whose follower count to retrieve. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `totalFollowerCount` | `number` | No | Total followers of the organization. |
| `organizationFollowerCount` | `number` | No | — |
| `elements` | `Record<string, any>[]` | No | — |
| `paging` | `object` | No | — |

> [accordion] paging full type
>
> ```ts theme={null}
> {
>   start?: number,
>   count?: number,
>   total?: number,
>   links?: Record<string, any>[]
> }
> ```

***

### getPageStats

`organizations.getPageStats`

Retrieve page statistics for a LinkedIn organization.

**Risk:** `read`

```ts theme={null}
await corsair.linkedin.api.organizations.getPageStats({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `organization_urn` | `string` | Yes | The organization URN whose page statistics to retrieve. |
| `time_integrated` | `object` | No | Optional time range for time-bound (aggregate) statistics. |
| `start` | `number` | No | Pagination start index. |
| `count` | `number` | No | Number of results per page. |

> [accordion] time\_integrated full type
>
> ```ts theme={null}
> {
>   start?: number,
>   end?: number
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `elements` | `Record<string, any>[]` | Yes | Page statistics entries. |
| `paging` | `object` | No | — |

> [accordion] paging full type
>
> ```ts theme={null}
> {
>   start?: number,
>   count?: number,
>   total?: number,
>   links?: Record<string, any>[]
> }
> ```

***

### getShareStats

`organizations.getShareStats`

Retrieve share statistics for an organization.

**Risk:** `read`

```ts theme={null}
await corsair.linkedin.api.organizations.getShareStats({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `organization_urn` | `string` | Yes | The organization URN whose share statistics to retrieve. |
| `time_integrated` | `object` | No | Optional time range to filter statistics. |
| `start` | `number` | No | Pagination start index. |
| `count` | `number` | No | Number of results per page. |

> [accordion] time\_integrated full type
>
> ```ts theme={null}
> {
>   start?: number,
>   end?: number
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `elements` | `Record<string, any>[]` | Yes | Share statistics entries. |
| `paging` | `object` | No | — |

> [accordion] paging full type
>
> ```ts theme={null}
> {
>   start?: number,
>   count?: number,
>   total?: number,
>   links?: Record<string, any>[]
> }
> ```

***

## Posts

### create

`posts.create`

Create a new LinkedIn post for a member or organization.

**Risk:** `write`

```ts theme={null}
await corsair.linkedin.api.posts.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `author` | `string` | Yes | Author URN. Use urn:li:person:... to post as a person (w\_member\_social) or urn:li:organization:... to post as an organization (w\_organization\_social). |
| `commentary` | `string` | Yes | The text commentary (body) of the post. |
| `visibility` | `PUBLIC \| CONNECTIONS \| LOGGED_IN_MEMBERS` | No | Who can see the post. Defaults to PUBLIC. |
| `lifecycleState` | `PUBLISHED \| DRAFT` | No | PUBLISHED to post immediately, DRAFT to save as a draft. |
| `isReshareDisabledByAuthor` | `boolean` | No | When true, other members cannot reshare this post. |
| `article_url` | `string` | No | Optional URL to attach as article content with the post. |
| `article_title` | `string` | No | Title for the attached article. Requires article\_url. |
| `article_description` | `string` | No | Description for the attached article. Requires article\_url. |
| `image_urn` | `string` | No | Optional image URN to attach as media. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The URN of the newly created post. |

***

### createArticleShare

`posts.createArticleShare`

Create an article or URL share on LinkedIn.

**Risk:** `write`

```ts theme={null}
await corsair.linkedin.api.posts.createArticleShare({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `authorUrn` | `string` | Yes | Author URN, e.g. urn:li:person:... or urn:li:organization:.... |
| `text` | `string` | No | Optional commentary to include alongside the shared URL. |
| `article_url` | `string` | Yes | The URL to share as an article. |
| `article_title` | `string` | No | Optional title for the article. |
| `article_description` | `string` | No | Optional description for the article. |
| `article_thumbnail` | `string` | No | Optional thumbnail URL for the article. |
| `visibility` | `PUBLIC \| CONNECTIONS` | No | Visibility of the share. Defaults to PUBLIC. |
| `lifecycleState` | `PUBLISHED \| DRAFT` | No | PUBLISHED to post immediately, DRAFT to save as a draft. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The URN of the newly created UGC post. |
| `activity` | `string` | No | — |

***

### delete

`posts.delete`

Delete a LinkedIn post via the Posts API.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.linkedin.api.posts.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `post_id` | `string` | Yes | The post URN or ID to delete via the Posts API (idempotent, returns 204). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | Whether the delete operation completed. |

***

### deleteShare

`posts.deleteShare`

Delete a LinkedIn post (share) by its share\_id.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.linkedin.api.posts.deleteShare({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `share_id` | `string` | Yes | The share ID of the LinkedIn share to delete. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | Whether the delete operation completed. |

***

### deleteUgc

`posts.deleteUgc`

Delete a UGC post via the legacy v2/ugcPosts endpoint.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.linkedin.api.posts.deleteUgc({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `ugc_post_urn` | `string` | Yes | The UGC post URN (e.g. urn:li:ugcPost:12345) to delete. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | Whether the delete operation completed. |

***

### getContent

`posts.getContent`

Retrieve detailed content of a specific LinkedIn post.

**Risk:** `read`

```ts theme={null}
await corsair.linkedin.api.posts.getContent({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `post_urn` | `string` | Yes | The post URN (e.g. urn:li:post:1234567890) whose content to retrieve. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `author` | `string` | No | — |
| `commentary` | `string` | No | — |
| `visibility` | `string` | No | — |
| `lifecycleState` | `string` | No | — |
| `createdAt` | `Record<string, any>` | No | — |
| `isReshareDisabledByAuthor` | `boolean` | No | — |
| `media` | `Record<string, any>` | No | — |
| `content` | `Record<string, any>` | No | — |

***

## Profile

### getMyInfo

`profile.getMyInfo`

Fetch the authenticated LinkedIn member's profile.

**Risk:** `read`

```ts theme={null}
await corsair.linkedin.api.profile.getMyInfo({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projection` | `string` | No | Optional projection of profile fields to return (e.g. "(sub,name,email)"). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `sub` | `string` | No | — |
| `id` | `string` | No | — |
| `name` | `string \| null` | No | — |
| `given_name` | `string \| null` | No | — |
| `family_name` | `string \| null` | No | — |
| `picture` | `string \| null` | No | — |
| `email` | `string \| null` | No | — |
| `locale` | `string \| null` | No | — |
| `vanityName` | `string` | No | — |
| `headline` | `string` | No | — |

***

### getPerson

`profile.getPerson`

Retrieve a LinkedIn member profile by person ID.

**Risk:** `read`

```ts theme={null}
await corsair.linkedin.api.profile.getPerson({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `person_id` | `string` | Yes | The LinkedIn member ID of the person whose profile to retrieve. |
| `projection` | `string` | No | Optional projection of fields. Defaults to the lite profile; add headline and vanityName for the basic profile (requires r\_basicprofile). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The member ID. |
| `localizedFirstName` | `string` | No | — |
| `localizedLastName` | `string` | No | — |
| `localizedHeadline` | `string` | No | — |
| `vanityName` | `string` | No | — |
| `firstName` | `Record<string, any>` | No | — |
| `lastName` | `Record<string, any>` | No | — |
| `headline` | `Record<string, any>` | No | — |
| `profilePicture` | `object` | No | — |

> [accordion] profilePicture full type
>
> ```ts theme={null}
> {
>   displayImage~?: string,
>   displayImage~:playableStreams?: Record<string, any>[]
> }
> ```

***

## Reactions

### list

`reactions.list`

List reactions on a LinkedIn entity.

**Risk:** `read`

```ts theme={null}
await corsair.linkedin.api.reactions.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `entity_urn` | `string` | Yes | URN of the entity (share, post, or comment) whose reactions to list. |
| `start` | `number` | No | Pagination start index. Defaults to 0. |
| `count` | `number` | No | Number of reactions to return per page. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `elements` | `object[]` | Yes | The reactions on the entity. |
| `paging` | `object` | No | — |

> [accordion] elements full type
>
> ```ts theme={null}
> {
>   actor?: string,
>   type?: string,
>   created?: Record<string, any>
> }[]
> ```

> [accordion] paging full type
>
> ```ts theme={null}
> {
>   start?: number,
>   count?: number,
>   total?: number,
>   links?: Record<string, any>[]
> }
> ```

***

## Videos

### list

`videos.list`

Retrieve LinkedIn video metadata.

**Risk:** `read`

```ts theme={null}
await corsair.linkedin.api.videos.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `video_urn` | `string` | No | A single video URN to retrieve. |
| `owner` | `string` | No | Owner URN. Returns videos owned by this account. |
| `urns` | `string[]` | No | Specific video URNs to fetch in a batch. |
| `start` | `number` | No | Pagination start index. |
| `count` | `number` | No | Number of videos per page. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `elements` | `object[]` | Yes | — |
| `paging` | `object` | No | — |

> [accordion] elements full type
>
> ```ts theme={null}
> {
>   id: string,
>   owner?: string,
>   status?: string,
>   downloadUrl?: string | null,
>   durationMilliseconds?: number,
>   original?: {
>     width?: number,
>     height?: number
>   }
> }[]
> ```

> [accordion] paging full type
>
> ```ts theme={null}
> {
>   start?: number,
>   count?: number,
>   total?: number,
>   links?: Record<string, any>[]
> }
> ```

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.