How to Schedule LinkedIn Posts via API
Schedule LinkedIn posts programmatically with the SocialRails API. Covers character limits, formatting tips, media support, and code examples for automated LinkedIn posting.
Schedule LinkedIn posts programmatically using the SocialRails API. This guide covers character limits, text formatting, media support, code examples, and best practices for automated LinkedIn posting.
Character Limits
- Post text: 3,000 characters
- Article titles: 100 characters
- Comments: 1,250 characters
- Company page posts: 700 characters (recommended for feed visibility)
Supported Content Types
API Example
# Schedule a LinkedIn post
curl -X POST https://socialrails.com/api/v1/posts \
-H "Authorization: Bearer sr_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "3 things I learned building a public API this week:\n\n1. Rate limiting is harder than you think\n2. Good error messages save developer hours\n3. Documentation IS the product\n\nWhat would you add to this list?\n\n#API #DevExperience #BuildInPublic",
"platform": "linkedin",
"scheduled_for": "2026-03-04T08:30:00Z"
}'Formatting Tips
LinkedIn supports basic text formatting:
- Use line breaks (
\n) to create readable paragraphs - Bullet points with emoji or dashes improve readability
- Hashtags at the end of the post (3-5 max)
- Tag people with
@Name, though API posts can't create actual mention links - First 210 characters appear before the "see more" fold, make them count
First Comment
Automatically post a comment on your LinkedIn post right after it goes live. This is a popular LinkedIn strategy for boosting engagement — add a question, CTA, or extra context without cluttering the main post.
curl -X POST https://socialrails.com/api/v1/posts \
-H "Authorization: Bearer sr_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "3 things I learned building a public API this week:\n\n1. Rate limiting is harder than you think\n2. Good error messages save developer hours\n3. Documentation IS the product",
"platform": "linkedin",
"scheduled_for": "2026-03-04T08:30:00Z",
"first_comment": "What would you add to this list? Drop your thoughts below!"
}'The first comment is posted as a comment on the published post. Max 2,200 characters.
Best Practices
- Optimal posting times: Tuesday-Thursday, 7-8am or 12pm
- Post length: 1,300-2,000 characters for maximum engagement
- Hashtags: 3-5 relevant hashtags at the end of the post
- Images: Posts with images get 2x the engagement
- Video: Native video gets 5x the engagement of links
- Engage with comments within the first hour to improve algorithm visibility
Rate Limits
LinkedIn API limits:
- 150 API calls per day per member
- 100 posts per day per organization page
- Images: 10MB max file size
SocialRails manages these limits and queues posts automatically.