API Quickstart
Get from zero to your first API request in 5 minutes. Create an API key, schedule a post, and verify it worked.
Get up and running with the SocialRails API in under 5 minutes.
Prerequisites
- A SocialRails account on the Creator plan or higher
- At least one connected social media account
- A terminal or HTTP client (curl, Postman, etc.)
Step 1: Create an API Key
- Go to Settings > API Keys in your SocialRails dashboard
- Click Create Key
- Give it a name (e.g., "My first integration")
- Select scopes: Read and Write
- Click Create Key and copy the key immediately, you won't see it again
Your key looks like: sr_live_abc123...
Step 2: Test Your Connection
Verify your key works by hitting the health endpoint (no auth required) and then your workspace:
# Health check (no auth needed)
curl https://socialrails.com/api/v1/health
# Verify your API key
curl https://socialrails.com/api/v1/workspace \
-H "Authorization: Bearer sr_live_YOUR_KEY_HERE"You should see your workspace name, plan, and limits in the response.
Step 3: Schedule Your First Post
curl -X POST https://socialrails.com/api/v1/posts \
-H "Authorization: Bearer sr_live_YOUR_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"content": "Hello from the SocialRails API!",
"platform": "twitter",
"scheduled_for": "2026-03-15T10:00:00Z"
}'Step 3b: Add a First Comment
You can automatically post a comment or reply right after your post goes live. This is great for adding context, a CTA, or hashtags without cluttering the main post.
curl -X POST https://socialrails.com/api/v1/posts \
-H "Authorization: Bearer sr_live_YOUR_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"content": "Hello from the SocialRails API!",
"platform": "linkedin",
"scheduled_for": "2026-03-15T10:00:00Z",
"first_comment": "What do you think? Let us know in the replies!"
}'First comment is supported on Twitter/X (posted as a reply), LinkedIn (comment on post), Facebook (comment on page post), and Bluesky (reply). Max 2,200 characters.
Step 4: Verify It Worked
curl https://socialrails.com/api/v1/posts?status=scheduled \
-H "Authorization: Bearer sr_live_YOUR_KEY_HERE"You should see your newly scheduled post in the response.
What's Next?
- API Endpoints Reference, Full reference for all endpoints
- Code Examples, Copy-paste examples in JavaScript and Python
- Batch Posting, Schedule to multiple platforms at once
- Rate Limits, Understand request limits for your plan
- Error Handling, Handle errors gracefully
- Platform Settings, Character limits, media specs, and per-platform settings