---
title: "Publish a new post on the connected account's feed"
method: POST
path: "/linkedin/posts"
tags: ["LinkedIn — Posts"]
---

# Publish a new post on the connected account's feed

`POST /linkedin/posts`

## Request

- Base URL: `https://anjal.app`
- URL: `https://anjal.app/linkedin/posts`
- Auth: API key in header `X-API-Key`

Creates a feed post on the connected LinkedIn account. Text is
required; an inline image is optional. The endpoint handles the
underlying three-step LinkedIn upload flow (register upload → PUT bytes →
create share) so the customer just sends one JSON request.

**Visibility:**
- `ANYONE` (default) — public on the feed.
- `CONNECTIONS` — visible to 1st-degree connections only.

**Image:**
Pass an `image.dataUrl` (full data URL with embedded mime + base64) for
the simplest agent shape, OR a separate `image.base64` + `image.contentType`.
Accepts `image/png`, `image/jpeg`, `image/gif`, `image/webp` up to ~10 MB.

Quota: 1 `connection_request` slot per call (shared outbound-write
bucket).

## Request body

- object
  - `sessionId` string, required
  - `text` string, required: Post commentary. LinkedIn caps at 3000 characters.
  - `visibility` 'ANYONE' | 'CONNECTIONS'
  - `image` object: Optional inline image. Pass either `dataUrl` (preferred — embeds mime + base64 in one field) or `base64` + `contentType`.
    - `dataUrl` string: Full data URL, e.g. "data:image/png;base64,iVBORw0KG..."
    - `base64` string: Bare base64-encoded bytes (no `data:` prefix).
    - `contentType` 'image/png' | 'image/jpeg' | 'image/gif' | 'image/webp': Required when using `base64`. Ignored when using `dataUrl`.
    - `altText` string: Accessibility alt-text on the rendered post.
    - `filename` string

## Response `200`

Post created.

- object
  - `ok` boolean
  - `shareUrn` string
  - `shareId` string
  - `postUrl` string, uri
  - `mediaUrn` string, nullable: Set when an image was uploaded.

## Other responses

- `400`: Validation error or LinkedIn rejected the post. Real LinkedIn errors are surfaced verbatim in `error` (e.g. commentary too long, invalid visibility enum).
- `404`: Session not found.
- `429`: Daily quota exceeded for this session.

---

[API](https://skmtc.dev/anjal/apis/anjal-api.md) · [All operations](https://skmtc.dev/anjal/apis/anjal-api/llms.txt) · [OpenAPI document](https://skmtc.dev/anjal/apis/anjal-api/revisions/a4044778e294?raw)
