socialrobot

How to Schedule Social Media Posts with an API

Use the SocialRobot REST API to schedule posts on 10 networks from your code: create an API key, list your account IDs, then POST to /posts with a targets array.

To schedule social media posts with an API, authenticate with an API key, call GET /accounts to get the platform account IDs, then send one POST /posts request per post with the text, a scheduledAt timestamp, and a targets array naming each platform and account. SocialRobot exposes this at https://socialrobot.io/api, with an OpenAPI 3 spec at https://socialrobot.io/api/openapi.json, covering Instagram, LinkedIn, X, TikTok, Pinterest, Threads, Facebook, Bluesky, Mastodon, and Google Business Profile with the same request shape.

Scheduling by hand works until volume arrives. One week of posts across four networks is a dozen entries typed into a form, each with its own time, caption, and image. The moment a spreadsheet, a CMS, or another service already knows what needs to go out, retyping it into a calendar is the slowest possible way to publish.

A scheduling API inverts that. Your code owns the schedule, the API owns the platform connections, and the posts land on a calendar you can still review. This guide uses SocialRobot's REST API because the OAuth part is already solved: you link accounts once in the app and never register a Meta or LinkedIn developer app yourself.

What the API actually does

The API is the same engine the dashboard uses, exposed over HTTP. One request can target several networks, use the text you want per network, attach uploaded media, and then be listed, moved, or deleted later from the same endpoints.

Three things make it different from writing platform integrations by hand:

  • One auth for ten networks. A single API key replaces per-platform OAuth apps, token refreshes, and the review process some networks require.
  • Posts land on your calendar. API posts are scheduled items you can see, edit, or delete in the dashboard before they go out, not fire-and-forget calls. Create them as drafts if you want to check each one first.
  • The spec is public. OpenAPI 3 at https://socialrobot.io/api/openapi.json, so Postman, Insomnia, or a generated client can import it in seconds.

Before the first request

You need three things:

  1. Connected accounts. Link Instagram, LinkedIn, X, and the rest under Scheduler, then Accounts. The API publishes through those logins.
  2. An API key. In the dashboard, Scheduler settings, then API keys. Copy the key once, it is sent as x-api-key (Authorization: Bearer also works).
  3. Account IDs. Call GET /accounts to see what the key can publish to.
curl https://socialrobot.io/api/accounts \
  -H "x-api-key: $SOCIALROBOT_API_KEY"

The response lists every connected account with its platform and its ID. Those IDs are what you put in targets later, so it is worth caching them per environment.

Create a scheduled post

One endpoint handles the common case: POST /posts. Text, time, targets.

curl -X POST https://socialrobot.io/api/posts \
  -H "x-api-key: $SOCIALROBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "New oat flat coffee is live this week.",
    "scheduledAt": "2026-09-15T09:00:00Z",
    "targets": [
      { "platform": "instagram", "accountId": "acc_123" },
      { "platform": "linkedin",  "accountId": "acc_456" },
      { "platform": "x",         "accountId": "acc_789" }
    ]
  }'

targets is the part that saves the most work: one request, three networks, one schedule. If a network needs different wording, create separate posts or use the per-platform endpoints below.

Scheduling is the default, not an extra step

A future scheduledAt puts the post on the calendar where you can still edit or delete it. Publishing on request is the same call with the timestamp omitted.

Attach media

Two ways in, depending on who holds the file:

SituationEndpoint
Your script has the file bytesPOST /media/upload-url returns a presigned URL to PUT the file to
The image already lives at a public URLPOST /media/from-url ingests it server side

Both return a media reference you pass in the post body, so you can queue a post and its image in one flow.

Move, list, and delete

The post ID from the create response is enough to manage everything afterward:

TaskRequest
List what is queued or publishedGET /posts
Inspect one postGET /posts/{id}
Rewrite the text or targetsPUT /posts/{id}
Move it to a new timePOST /posts/{id}/schedule
Cancel itDELETE /posts/{id}

That covers the ugly part of automation. A campaign that slips a day is one request, not a support ticket.

When the generic endpoint is not enough

Some networks need a field the shared endpoint does not model. Those have their own routes: /instagram/create, /linkedin/create, /x/create, /tiktok/create, /pinterest/create, /threads/create, /facebook/create, /bluesky/create, /mastodon/create, and /googlebusiness/create.

Pinterest is the clearest example. A pin cannot exist without a board, so you list boards with GET /pinterest/boards/{accountId}, create one with POST /pinterest/create if needed, and then queue the pin. TikTok is similar: GET /tiktok/creator-info/{accountId} returns the posting options, including whether the video publishes directly or lands as an inbox draft.

API, MCP, or n8n?

All three drive the same publishing engine. Pick by who is holding the decision:

You are automatingUse
Your own code, cron job, or backendREST API with an API key
A conversation in Claude, ChatGPT, or CursorMCP server with OAuth
A spreadsheet, RSS feed, or form on a canvasn8n node

Quota is shared across the three, so mixing is normal: schedule from code during the week, adjust by chat when the plan changes. If nothing is being automated and you just want a calendar, how to schedule social media posts is the manual path.

Mistakes worth avoiding

  • Hardcoding account IDs. They change when someone reconnects an account. Read them from GET /accounts at startup.
  • Sending local times instead of UTC. scheduledAt is an ISO 8601 timestamp. Store UTC, convert for display only.
  • Ignoring the response body. The create call returns the post ID and per-target status, which is what you need to log, retry, or reconcile.
  • Publishing straight to the platform from a script. You lose the review step and the calendar. Keep the posts in SocialRobot and let the API do both.

Getting started

  1. Create a free SocialRobot account.
  2. Link the accounts you publish to.
  3. Create an API key in Scheduler settings.
  4. Run GET /accounts, then queue your first post with POST /posts.
  5. Keep the OpenAPI spec open for the exact fields, and read the MCP walkthrough if an AI assistant should be the one scheduling.

Questions

Frequently asked questions

How do I get an API key for social media scheduling?

Create one in the SocialRobot dashboard under Scheduler settings, then API keys. Send it as x-api-key, or as Authorization: Bearer. No Meta, LinkedIn, or TikTok developer app is required.

How do I find the account ID to publish to?

Call GET /accounts. It returns every connected account for the API key owner with its platform and ID. Use those IDs in the targets array when you create a post.

Can one request publish to several networks at once?

Yes. POST /posts takes a targets array, so a single call can queue the same post for Instagram, LinkedIn, and X together. Per-platform endpoints exist when a network needs a field the generic endpoint does not cover.

How is scheduling different from publishing right away?

Set scheduledAt to a future timestamp and the post waits on the SocialRobot calendar until then; you can edit or delete it in the dashboard before it goes out. Omit the field or pass a past time and the post goes out as soon as the request is processed.

What are the rate limits on the scheduling API?

2,000 requests per minute per account and 200,000 per day, shared between the REST API and the MCP server. The ceilings are the same on Free and paid plans.

Connect your accounts.

SocialRobot MCP is free on every plan. Add socialrobot.io/api/mcp to Claude, ChatGPT, or Cursor and schedule from chat.

Read the MCP guide

Start free

Your next post starts here.

Connect your accounts and try it with a real post. Two accounts and fifteen posts a month, free.

Start free

Free plan. No credit card required.