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

# LinkedIn Publishing API Documentation | Kavenio Docs

> Publish LinkedIn text, images, videos, documents, first comments, and reshares to connected personal profiles with Kavenio. Review media rules, scheduling, and errors.

Kavenio publishes LinkedIn posts through the authenticated member's personal
profile. Use `linkedin` as the platform value and put LinkedIn-specific fields
in `platformSpecificData`. Company Page publishing is not currently supported.

Kavenio can upload LinkedIn images, GIFs, videos, and documents from your media
URLs before creating the post. You can also provide advanced LinkedIn
`mediaUrns` when you have already uploaded assets yourself.

## Quick Reference

| Capability               | Support                                                                     |
| ------------------------ | --------------------------------------------------------------------------- |
| Platform key             | `linkedin`                                                                  |
| Text post                | Supported                                                                   |
| Image/GIF upload         | From Kavenio media URLs                                                     |
| Video upload             | One MP4 from Kavenio media URLs                                             |
| Document upload          | One PDF, PPT, PPTX, DOC, or DOCX from Kavenio media URLs                    |
| Existing provider media  | `platformSpecificData.mediaUrns`                                            |
| First comment            | Supported                                                                   |
| Link preview suppression | `disableLinkPreview: true`                                                  |
| Quote reshare            | `reshareUrl`, without media                                                 |
| Post analytics           | `GET /v1/analytics` for likes, comments, shares, impressions, reach, clicks |
| Native edit/unpublish    | Not supported                                                               |

LinkedIn member analytics are limited to posts the authenticated member can
access.

## Create An Image Post

```json theme={null}
{
  "content": "LinkedIn launch update",
  "mediaItems": [
    {
      "type": "image",
      "url": "https://cdn.example.com/linkedin-launch.png",
      "mimeType": "image/png",
      "altText": "Launch dashboard screenshot"
    }
  ],
  "platforms": [
    {
      "platform": "linkedin",
      "accountId": "acc_123",
      "platformSpecificData": {
        "firstComment": "Full notes: https://example.com/launch",
        "disableLinkPreview": true
      }
    }
  ],
  "publishNow": true
}
```

```bash theme={null}
kavenio posts create \
  --content "LinkedIn launch update" \
  --publish-now \
  --media-url https://cdn.example.com/linkedin-launch.png \
  --platform linkedin:acc_123 \
  --first-comment "Full notes: https://example.com/launch" \
  --disable-link-preview
```

Kavenio uploads each image or GIF to LinkedIn first, then creates the post using
the returned media URNs.

## Create A Video Post

```json theme={null}
{
  "content": "Product walkthrough",
  "mediaItems": [
    {
      "type": "video",
      "url": "https://cdn.example.com/walkthrough.mp4",
      "mimeType": "video/mp4",
      "title": "Product walkthrough"
    }
  ],
  "platforms": [
    {
      "platform": "linkedin",
      "accountId": "acc_123"
    }
  ],
  "publishNow": true
}
```

LinkedIn video posts support one MP4 video. Kavenio initializes a LinkedIn video
upload, uploads the bytes, finalizes the upload, and then creates the post.

## Create A Document Post

```json theme={null}
{
  "content": "Download the launch brief.",
  "mediaItems": [
    {
      "type": "document",
      "url": "https://cdn.example.com/launch-brief.pdf",
      "mimeType": "application/pdf",
      "title": "Launch brief"
    }
  ],
  "platforms": [
    {
      "platform": "linkedin",
      "accountId": "acc_123",
      "platformSpecificData": {
        "documentTitle": "Launch brief"
      }
    }
  ],
  "publishNow": true
}
```

Documents support PDF, PPT, PPTX, DOC, and DOCX files up to 100 MB. Kavenio
waits for LinkedIn document processing before creating the post.

## Use Existing LinkedIn Media URNs

Use `mediaUrns` only when you already have provider media URNs and want Kavenio
to skip media upload.

```json theme={null}
{
  "content": "Post using existing LinkedIn media",
  "mediaItems": [
    {
      "type": "image",
      "url": "https://cdn.example.com/reference-only.jpg"
    }
  ],
  "platforms": [
    {
      "platform": "linkedin",
      "accountId": "acc_123",
      "platformSpecificData": {
        "mediaUrns": ["urn:li:image:C4D..."]
      }
    }
  ],
  "publishNow": true
}
```

When `mediaUrns` is supplied with media items, the counts must match. Kavenio
uses media item metadata such as image alt text and document title when building
the final post body.

## Quote Reshares

Use `reshareUrl` for LinkedIn quote reshares.

```json theme={null}
{
  "content": "Our take on this update.",
  "platforms": [
    {
      "platform": "linkedin",
      "accountId": "acc_123",
      "platformSpecificData": {
        "reshareUrl": "https://www.linkedin.com/feed/update/urn:li:activity:123"
      }
    }
  ],
  "publishNow": true
}
```

Reshare posts cannot include media items or `mediaUrns`.

## Platform-Specific Fields

| Field                | Type      | Behavior                                                                                     |
| -------------------- | --------- | -------------------------------------------------------------------------------------------- |
| `documentTitle`      | string    | Title for document media. Recommended for document posts.                                    |
| `mediaUrns`          | string\[] | Existing LinkedIn media URNs. Skips Kavenio upload.                                          |
| `firstComment`       | string    | Creates a first comment after the post is created.                                           |
| `disableLinkPreview` | boolean   | Sends an empty content object to suppress generated link previews when no media is attached. |
| `reshareUrl`         | string    | LinkedIn post/activity URL or URN to reshare. Cannot be combined with media.                 |

## Media Rules

LinkedIn rejects mixed media types and unsupported counts.

| Media       | Limit                                                         |
| ----------- | ------------------------------------------------------------- |
| Images/GIFs | 1 image or GIF, or 2-20 image/GIF items for multi-image posts |
| Video       | One MP4, 75 KB to 500 MB                                      |
| Documents   | One PDF, PPT, PPTX, DOC, or DOCX, up to 100 MB                |

Do not mix video, document, and image media in the same LinkedIn post. Media
URLs must be public and fetchable when Kavenio publishes.

## Scheduling

Use Kavenio's normal `scheduledFor` field. Kavenio uploads media when the
scheduled job runs, so media URLs must remain valid until publish time.

## Unsupported Cases

Kavenio does not support these LinkedIn actions through post publishing:

* mixed media-type posts
* multiple videos
* multiple documents
* media on quote reshares
* company Page or organization publishing
* geo-targeted organization posts
* unsupported document formats
* native edit or unpublish after publication

## Common Errors

| Error                                                | Meaning                               | Fix                                          |
| ---------------------------------------------------- | ------------------------------------- | -------------------------------------------- |
| `LinkedIn posts can include at most one video.`      | More than one video was supplied.     | Send one video or split into separate posts. |
| `LinkedIn posts can include at most one document.`   | More than one document was supplied.  | Send one document.                           |
| `LinkedIn video media must use MP4.`                 | Video MIME metadata is unsupported.   | Host an MP4 file.                            |
| `LinkedIn document media must be 100 MB or smaller.` | The document is too large.            | Upload a smaller document.                   |
| `LinkedIn reshare posts cannot include media.`       | `reshareUrl` was combined with media. | Remove media items and `mediaUrns`.          |
