LinkedIn API
A LinkedIn posting API that checks before it sends
postpeg publishes to LinkedIn through its official API from the same request that posts to X, Instagram and the rest. Write the post once; postpeg checks LinkedIn’s 3,000-character limit and media rules, publishes, and gives you the live URL.
- Publish
- Schedule
- Analytics
- Comments
- LinkedIn166/3000image
We rebuilt our scheduler this quarter. Three things we learned about retries, idempotency and telling users what actually happened: https://example.com/blog/scheduler
Ready
The example below, checked against LinkedIn’s rules
On top of publishing you get post analytics and comments, so a product can show how an announcement landed and let its user answer replies in place.
What you can do on LinkedIn
- Publish. Publish to LinkedIn now with
POST /v1/posts, alone or in the same request as any of the other networks. More on the Posting API. - Schedule. Schedule up to a year ahead with
scheduled_at, and cancel withDELETE /v1/posts/{id}any time before it goes out. More on the Scheduling API. - Analytics. Read impressions, likes, shares and more per post with
GET /v1/posts/{id}/analytics, and follower growth withGET /v1/accounts/{id}/analytics. More on the Analytics API. - Comments. List comments on your posts and reply to them with
/v1/posts/{id}/comments. More on the Comments API.
Not available on LinkedIn: direct messages. The coverage table shows what each network supports.
LinkedIn’s rules, checked before sending
A LinkedIn post can have up to 3,000 characters, counted as people see them (an emoji is one). Media is optional: up to 20 images or 1 video. postpeg runs these checks on every request, so a post that won’t fit LinkedIn is refused with a 400 before anything is published, on any network.
| Max text | 3,000 characters |
|---|---|
| Media | Optional |
| Images | 20 |
| Videos | 1 |
| Images and video together | None |
| Required options | None |
| Connects with | Hosted OAuth |
Connecting LinkedIn accounts
Call POST /v1/accounts/connect with a profile and "platform": "linkedin", and send the account’s owner to the URL you get back. It’s valid for 15 minutes. They approve access on LinkedIn’s own screen and land on your redirect_url with status=success and the new account_id.
The account owner connects LinkedIn through the hosted OAuth screen. If LinkedIn later expires that login, the account turns reconnect_required and publishing to it stops until they connect again.
If LinkedIn ever expires a login, the account turns reconnect_required so you can ask its owner to connect again. More in Profiles and accounts.
Example: a scheduled LinkedIn post
One request, with an Idempotency-Key so a retry on your side never posts twice. To post to LinkedIn and other networks together, add more ids to account_ids.
curl https://api.postpeg.com/v1/posts \
-H "Authorization: Bearer $POSTPEG_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: linkedin-example-2026-10-01" \
-d '{
"account_ids": [
"acc_mfz1y4r9h2c6t0wqk8e3m7ld5f"
],
"content": "We rebuilt our scheduler this quarter. Three things we learned about retries, idempotency and telling users what actually happened: https://example.com/blog/scheduler",
"media": [
{
"url": "https://example.com/scheduler.png",
"type": "image",
"alt_text": "Scheduler diagram"
}
],
"scheduled_at": "2026-10-01T09:00:00Z",
"platform_options": {}
}'{
"id": "post_mfz2k3v8q1w5e9r4t7y0u2i6o3",
"content": "We rebuilt our scheduler this quarter. Three things we learned about retries, idempotency and telling users what actually happened: https://example.com/blog/scheduler",
"media": [
{
"url": "https://example.com/scheduler.png",
"type": "image",
"alt_text": "Scheduler diagram"
}
],
"platform_options": {},
"status": "scheduled",
"scheduled_at": "2026-10-01T09:00:00.000Z",
"targets": [
{
"account_id": "acc_mfz1y4r9h2c6t0wqk8e3m7ld5f",
"platform": "linkedin",
"status": "pending",
"platform_post_id": null,
"url": null,
"error": null,
"attempts": 0,
"published_at": null
}
],
"created_at": "2026-09-24T14:02:11.418Z"
}From 09:00 the target moves through queued and publishing to published with the live url, or to failed with the reason in error. Temporary failures are retried, up to 5 attempts with growing waits. See Publishing for every status.
Questions
- How do I schedule a LinkedIn post?
- Add
scheduled_at(ISO 8601, up to a year ahead) toPOST /v1/posts. The post waits asscheduledand goes out within a minute of that time.DELETE /v1/posts/{id}cancels it any time before. - What happens if a post breaks LinkedIn’s rules?
- postpeg checks the text (up to 3,000 characters), the media before anything is sent. A post that doesn’t fit comes back as a
400with every problem listed inissues, and nothing is published on any network. - Which LinkedIn features does postpeg support?
- Publishing, scheduling, analytics, comments. Direct messages is not available on LinkedIn; asking for it returns a
400naming the feature. - Can I hide comments on LinkedIn?
- No. You can list LinkedIn comments and reply to them, but LinkedIn doesn’t support hiding. Hiding works on Instagram, Facebook and Threads.
- How many images can a LinkedIn post have?
- Up to 20 images, or 1 video. Images and video can’t be mixed in one LinkedIn post.
Also on the line
The same request publishes to all ten networks. Often paired with LinkedIn:
Or see all 10: X, Instagram, Facebook, TikTok, YouTube, Threads, Pinterest, Bluesky and Google Business, in the platform reference.
Send your first post in a few minutes
The 7-day trial has every feature and 3 connected accounts, with no card. The quickstart takes you from a key to a published post.