# Post to LinkedIn from Codex

Turn CHANGELOG.md into a LinkedIn release post. Review the copy and destination in Codex, then use PubNio to publish and check the permalink.

Canonical page: https://pubnio.com/codex/linkedin

## Connect Codex

### Add PubNio to .codex/config.toml

codex mcp add writes this entry to ~/.codex/config.toml for your user. To share the server with the repository, put the same entry in the project's .codex/config.toml.

```toml
[mcp_servers.pubnio]
url = "https://pubnio.com/mcp"
```

Or from a terminal:

```sh
codex mcp add pubnio --url https://pubnio.com/mcp
codex mcp login pubnio
```

### Sign in

1. Run codex mcp login pubnio in a terminal.
2. Your browser opens PubNio sign-in; approve the workspace.
3. Start Codex in the repository and ask it to list your PubNio workspaces.

### Install the skill (optional)

```sh
npx skills add pubnio/agent-skills
```

Installs the pnio skill from skills.sh.

### Connect your LinkedIn account

[Open PubNio](https://pubnio.com/app), choose your workspace, and go to Accounts. Use the same workspace when you sign in from Codex.

- Connect the LinkedIn member profile you want to post from in PubNio.
- Grant publishing access and check that the selected account is ready.
- Open the repository with the changelog in Codex.
- Confirm you have permission to publish to the selected profile in your workspace.

### Check the destination

```
List the LinkedIn accounts in my PubNio workspace. Show which member profiles are ready to publish. Do not create, schedule, or publish a post.
```

## Worked job: Turn your changelog into a LinkedIn release post

Contract example: sample IDs and URLs. The request and both responses decode against PubNio's API schemas; no provider confirmed this post.

### Prompt

```
Read the newest entry in CHANGELOG.md and write a short LinkedIn announcement explaining what changed and who benefits. Find my ready LinkedIn member account in PubNio. If there is more than one, ask me which to use. Show me the draft and destination before posting. After I approve, publish a text post once and check the delivery status. Return the LinkedIn permalink when it is confirmed, or the PubNio post ID if delivery is still pending.
```

### What Codex runs: the Code Mode flow

```text
search   -> find the create-post and read-post operations
execute  -> create post { text: "…", publishNow: true, targets: [ { accountId: "…", provider: "linkedin", placement: "feed" } ] }
            Idempotency-Key: codex-linkedin-release-2026-12-04
         => 202 { postId, targets: [linkedin/feed: queued] }
execute  -> read post, sleep 1s between checks, within the 30s budget
         => { status: "published", url: "https://www.linkedin.com/feed/update/urn:li:share:123" }
```

### Settled result (200 OK)

```json
{
  "postId": "00000000-0000-4000-8000-000000000002",
  "isDraft": false,
  "revision": 1,
  "scheduledAt": null,
  "text": "This release makes scheduled posts easier to track. You can now check delivery for each connected account.",
  "media": [],
  "targets": [
    {
      "accountId": "00000000-0000-4000-8000-000000000001",
      "provider": "linkedin",
      "placement": "feed"
    }
  ],
  "deliveries": [
    {
      "targetId": "00000000-0000-4000-8000-000000000003",
      "attemptId": "00000000-0000-4000-8000-000000000004",
      "accountId": "00000000-0000-4000-8000-000000000001",
      "provider": "linkedin",
      "placement": "feed",
      "canRetry": false,
      "canReconcile": false,
      "revision": 1,
      "status": "published",
      "providerRef": {
        "id": "urn:li:share:123",
        "kind": "post"
      },
      "url": "https://www.linkedin.com/feed/update/urn:li:share:123"
    }
  ],
  "status": "published",
  "createdAt": "2026-12-04T07:20:00.000Z",
  "updatedAt": "2026-12-04T07:20:18.000Z"
}
```

### From approval to delivery

Illustrative conversation and result with sample data.

**Codex:** I found the LinkedIn member profile for Alex. Here’s the proposed text post:

This release makes scheduled posts easier to track. You can now check delivery for each connected account.

**You:** Approved. Publish it to Alex’s LinkedIn feed.

**Codex:** PubNio accepted the post. I checked that same post again, and its LinkedIn delivery now says published. Here’s the permalink from the confirmed delivery.

#### Example delivery result

- Status: `published`

- Destination: Alex’s LinkedIn feed

- Sample URL: `https://www.linkedin.com/feed/update/urn:li:share:123`

## Check delivery and get the link

- Save the PubNio post ID when the submission is accepted.
- Read the same post while its LinkedIn delivery is queued, submitting, or confirming.
- Once the delivery is published, return the LinkedIn URL from that delivery.
- If delivery is still pending, check the existing post again before resubmitting.

## LinkedIn rules Codex runs into

Account kinds: social account, social page. Connection scopes: `w_member_social`.

| Placement | Default | Media types | Max per target | Caption limit |
| --- | --- | --- | --- | --- |
| `feed` | Yes | image, video, document | 20 | 3,000 |

- A text release post can use the feed placement without a media attachment.
- The feed placement takes up to 20 images, videos, or documents.
- For a document post, combine slides into one application/pdf file.
- Keep PDF attachments within the 100 MB document limit.
- Commentary runs up to 3,000 characters.
- Stage any attachment and wait until it is ready before including it in a post.

## Failures and recovery

### LinkedIn issue codes

| Code | Cause | Fix | Retry |
| --- | --- | --- | --- |
| `account_not_ready` | The connected account's OAuth token is expired, revoked, or disconnected. | Reconnect the account in the PubNio workspace, then re-validate. | After reconnect |
| `caption_too_long` | Text exceeds the destination placement's character limit (`caption.limit`). | Shorten the caption or add a shorter target-specific text override. | No |
| `media_count` | Attached media count is below minimum or above the placement's maximum. | Adjust the `media` array (for example, 1 video for Reels/YouTube, 2–20 for carousels). | No |
| `media_mime_type` | File MIME type is rejected by the provider (for example, unsupported codec or container). | Convert to a supported MIME type (such as `image/jpeg`, `image/png`, `video/mp4`, or `application/pdf`). | No |
| `media_too_large` | Asset exceeds the provider's byte-size ceiling (such as 100 MB for LinkedIn PDFs). | Compress or trim the asset below the platform ceiling and re-import. | No |

### Codex setup problems

- Calls start failing with 401. Run codex mcp login pubnio again to renew the PubNio sign-in.
- Codex does not show the pubnio tools. Run codex mcp add pubnio --url https://pubnio.com/mcp again, or check that [mcp_servers.pubnio] is in config.toml.
- Writes fail with 403 read_only_mode. PubNio returns 403 read_only_mode when the server URL ends in ?readOnly=1. Point the entry at https://pubnio.com/mcp to allow writes.

### Codex quirks

- Sign-in runs from the terminal with codex mcp login pubnio, outside a Codex session.
- The TOML entry needs only url; the table name [mcp_servers.pubnio] is the server name.

## What it won't do

- Attach more than one PDF to a document post.
- Read post analytics for a member profile. Analytics need a LinkedIn organization page.
- Connect accounts, create API keys, or manage webhooks from an MCP session that uses an API key. Those operations need a person signed in, so connect the MCP server with browser OAuth or use the PubNio web app.
- Stream binary uploads through execute. Import media from an HTTPS URL, or send a file of up to 8 MiB inline as base64.
- Run one execute call past 30 seconds or past its request limit. The script returns the post ID so the next call can check it.

## Frequently asked questions

### Can Codex post a text update to LinkedIn?

Yes. Connect the LinkedIn member profile in PubNio, then ask Codex to draft and publish to its feed.

### Can I attach a PDF release deck?

Yes. Use one ready PDF of up to 100 MB in the LinkedIn feed target.

### Does Codex need a separate API key?

Codex uses browser OAuth for PubNio MCP. The bearer token in the REST example is for direct API clients.

### How do I know the release post went live?

Ask Codex to read the existing post and return the permalink from the confirmed LinkedIn delivery.

### Where does Codex keep the PubNio server?

In config.toml under [mcp_servers.pubnio] with url = "https://pubnio.com/mcp". codex mcp add writes it to ~/.codex/config.toml; a project can keep the same entry in .codex/config.toml.

### How do I sign Codex in again?

Run codex mcp login pubnio. Each client keeps its own PubNio sign-in.

## Also works with

- [Post to LinkedIn from Claude Code](https://pubnio.com/claude/linkedin)
- [Post to LinkedIn from Cursor](https://pubnio.com/cursor/linkedin)
- [Post to LinkedIn from OpenCode](https://pubnio.com/opencode/linkedin)
- [Post to Instagram from Codex](https://pubnio.com/codex/instagram)
- [Upload YouTube Shorts from Codex](https://pubnio.com/codex/youtube)
- [Post to a Facebook Page from Codex](https://pubnio.com/codex/facebook)
- [Create a Pinterest Pin from Codex](https://pubnio.com/codex/pinterest)
- [Post a TikTok video from Codex](https://pubnio.com/codex/tiktok)
- [Publish an X thread from Codex](https://pubnio.com/codex/x)
- [Codex setup](https://pubnio.com/codex)
- [LinkedIn publishing API](https://pubnio.com/platforms/linkedin)
- [LinkedIn MCP](https://pubnio.com/linkedin-mcp)
- [LinkedIn network reference](https://pubnio.com/docs/networks/linkedin/)
- [LinkedIn error codes](https://pubnio.com/docs/errors/linkedin/)
- [Pricing](https://pubnio.com/pricing)

## Get started with PubNio

Connect unlimited accounts at $0 per account. Pay as you go includes 50 free confirmed publishes a month on your first workspace, then $20 per 1,000. X API fees are separate.

## REST API reference

Contract example: sample IDs and URLs. The request and both responses decode against PubNio's API schemas; no provider confirmed this post.

```http
POST /api/v1/posts?workspaceId=00000000-0000-4000-8000-000000000006
Authorization: Bearer pn_live_***
Idempotency-Key: codex-linkedin-release-2026-12-04
Content-Type: application/json

{
  "text": "This release makes scheduled posts easier to track. You can now check delivery for each connected account.",
  "publishNow": true,
  "targets": [
    {
      "accountId": "00000000-0000-4000-8000-000000000001",
      "provider": "linkedin",
      "placement": "feed"
    }
  ]
}
```

### 202 Accepted

```json
{
  "postId": "00000000-0000-4000-8000-000000000002",
  "idempotencyKey": "codex-linkedin-release-2026-12-04",
  "targets": [
    {
      "targetId": "00000000-0000-4000-8000-000000000003",
      "attemptId": "00000000-0000-4000-8000-000000000004",
      "accountId": "00000000-0000-4000-8000-000000000001",
      "provider": "linkedin",
      "placement": "feed",
      "canRetry": false,
      "canReconcile": false,
      "status": "queued",
      "scheduledAt": null,
      "url": null,
      "issue": null
    }
  ],
  "warnings": []
}
```

