All endpoints

Publish a new post on the connected account's feed

POSThttps://myagentmail.com/linkedin/posts

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

Content-Type: application/json

sessionId
required
string
text
required
string

Post commentary. LinkedIn caps at 3000 characters.

visibility
"ANYONE" | "CONNECTIONS"

enum: "ANYONE" | "CONNECTIONS"

default: "ANYONE"

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`.

enum: "image/png" | "image/jpeg" | "image/gif" | "image/webp"

altText
string

Accessibility alt-text on the rendered post.

filename
string

Responses

200application/jsonPost created.
ok
boolean
shareUrn
string
shareId
string
postUrl
string

format: uri

mediaUrn
string

Set when an image was uploaded.

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

Authentication

Send your API key in the X-API-Key header (or Authorization: Bearer <key>). Any prefix accepted by this endpoint — tk_, wk_, ak_, or sa_ — is documented in the key prefix table.