BlogUpdated Sep 12, 2026

How to Schedule Social Media Posts with an API

Use the SocialRobot REST API to schedule posts across nine networks from your own 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, and Mastodon 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:

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, and /mastodon/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.

Mistakes worth avoiding

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.

Connect your accounts. Approve every post.

SocialRobot MCP is free on every plan. Add socialrobot.io/api/mcp to Claude, ChatGPT, or Cursor and schedule from chat. Nothing goes live until you approve it.

Read the MCP guide