How to schedule social media posts with an API
To schedule social media posts with an API, send a future timestamp and channel-specific content to POST /public/v1/posts. On PostSider, the next step matters just as much: save the request and its idempotency key, capture the returned post ID, and read the post back before treating the job as scheduled.
Developer runbook: one text post, one channel, recoverable retries.
In short
- Use
https://api.postsider.com/public/v1with an organization API key in the rawAuthorizationheader.- Save the complete scheduling payload and a unique
Idempotency-Keybefore the first write.- Read the returned post ID back. A create response is not evidence that a social network published it.
This walkthrough uses an already-connected X account because a text-only post keeps the first test small. It is a first-job runbook, not an API comparison or a tour of every publishing mode. For that broader decision, see five practical criteria for choosing a social media scheduling API. The examples below were checked offline against the request DTOs and controller behavior, not executed against a live account.
Which interface should make the scheduling request?
The API contract remains the same, but the right starting guide depends on the caller. For direct backend integration, follow the request and retry example below. If your automation is already running in n8n, use the importable manual-only workflow to prove one draft and readback without publishing. For Make.com HTTP scenarios, map the same organization key, channel ID and stable idempotency key into HTTP modules. If a reasoning agent chooses the actions, use the MCP social publishing setup and permission guide instead of giving it a general backend token.
These are different integration entry points, not different social network guarantees. A draft created successfully is still not a published post. Standard includes REST/MCP/SDK access; enforced team review requires a Team, Pro or Ultimate organization.
The three steps, then the details
Every working integration does the same three things: pick a real channel id, send one create request with a stable idempotency key, then read the post back and confirm what happened. The sections below expand each step with the exact fields.
If you would rather buy the publishing layer than build it, the social media scheduling API page covers the org key, the plan that includes API access from $20 and what the API deliberately does not do.
Start with an account you can identify, not a guessed channel ID
List integrations and explicitly choose the account that should receive the post. The API’s integration.id is a PostSider channel ID, not an X handle or a platform user ID.
Create a PostSider account, connect the intended social media account in the dashboard, and create a named organization key in Settings > API with channels:read, posts:read and posts:write for this example. The write grant permits publishing as well as drafts; never treat it as draft-only authorization. Keep the key in your backend environment. Do not put it in a browser bundle or commit it with the script.
The following commands require Bash, curl, jq, and Node.js. Replace the key placeholder locally:
export POSTSIDER_API_BASE='https://api.postsider.com/public/v1'
export POSTSIDER_API_KEY='REPLACE_WITH_YOUR_ORGANIZATION_API_KEY'
curl --fail-with-body --silent --show-error \
-H "Authorization: ${POSTSIDER_API_KEY}" \
"${POSTSIDER_API_BASE}/integrations" \
| jq '.[] | {id, name, identifier, disabled, profile}'
The endpoint returns an array. Find your intended account by name and profile, check that disabled is false, and confirm identifier is x. Do not automatically select the first result: an organization can contain several accounts on the same network.
For this credential type, the header is Authorization: YOUR_KEY, without Bearer. The API overview documents the public URL and organization-key authentication. A working channel-list request establishes that you reached the right API with a valid credential; it does not establish that every later publishing permission is available.
A complete payload prevents avoidable validation failures
Send the scheduling envelope and X’s required reply setting explicitly. The DTO requires shortLink, tags, and each content entry’s image array, even though some abbreviated documentation examples omit them.
Use shortLink: false, tags: [], and image: [] for this text-only job. The posts array holds channel entries; each entry’s value array holds its content. Start with one of each, not a thread or a multi-network launch.
X’s settings include who_can_reply_post. This example sets it to everyone. Other platforms have different settings and media requirements, so changing only the channel ID is not a valid way to reuse this X request everywhere. Read GET /integration-settings/:id for the target channel’s rules and settings schema before adapting it.
Set these placeholders, choosing a future time with an explicit UTC offset:
export POSTSIDER_CHANNEL_ID='REPLACE_WITH_YOUR_X_CHANNEL_ID'
export POSTSIDER_LOCAL_TIME='REPLACE_WITH_FUTURE_ISO_TIME_AND_OFFSET'
# Format example: 2026-11-16T09:00:00-05:00
node <<'NODE'
const fs = require('node:fs');
const { randomUUID } = require('node:crypto');
const channel = process.env.POSTSIDER_CHANNEL_ID;
const local = process.env.POSTSIDER_LOCAL_TIME || '';
if (!channel || channel.startsWith('REPLACE_')) {
throw new Error('Set the chosen X channel ID');
}
if (!/(Z|[+-]\d{2}:\d{2})$/.test(local)) {
throw new Error('Include Z or an explicit UTC offset');
}
const date = new Date(local);
if (!Number.isFinite(date.getTime()) || date.getTime() <= Date.now()) {
throw new Error('Choose a valid future time');
}
const payload = {
type: 'schedule',
date: date.toISOString(),
shortLink: false,
tags: [],
posts: [{
integration: { id: channel },
value: [{ content: 'A text-only scheduling test from our API.', image: [] }],
settings: { __type: 'x', who_can_reply_post: 'everyone' }
}]
};
fs.writeFileSync('schedule-request.json', JSON.stringify(payload), { flag: 'wx' });
fs.writeFileSync('schedule-key.txt', randomUUID(), { flag: 'wx' });
console.log('Scheduled UTC time:', payload.date);
NODE
Run this preparation once in a dedicated job directory. Exclusive file creation stops an accidental rerun from replacing an existing payload. If preparation fails halfway through, inspect the files before sending anything.
The offset is essential. A bare local date leaves timezone interpretation to the machine running the script. Converting to toISOString() produces UTC with Z. Review that printed time against the intended local appointment, including daylight saving rules. Do not recalculate it on a retry.
The posts reference describes the scheduling endpoint. Here, the example includes the stricter fields found in the application DTO rather than depending on omitted-field defaults.
Publish to multiple social networks with one API, but test drafts first
The same endpoint can save separate drafts for selected channels in a single request. Do not assume one generic publishing payload is safe across all networks: each network may require different settings or media when you later schedule or publish.
For a controlled two-network test, use real channel IDs returned by GET /public/v1/integrations:
{
"type": "draft",
"date": "REPLACE_WITH_FUTURE_UTC_ISO_TIMESTAMP",
"shortLink": false,
"tags": [],
"posts": [
{
"integration": { "id": "CHANNEL_ID_FROM_LIST_1" },
"value": [{ "content": "A reviewed demo draft, not for publication.", "image": [] }],
"settings": {}
},
{
"integration": { "id": "CHANNEL_ID_FROM_LIST_2" },
"value": [{ "content": "Same idea, adapted for this account.", "image": [] }],
"settings": {}
}
]
}
Only create these after reviewing the channel IDs and captions. Save the body byte-for-byte, pick one stable Idempotency-Key for that logical operation, then send POST /public/v1/posts. The response is an array of {postId, integration} receipts. Read each returned post with GET /public/v1/posts/:id; inspect channel, content and state DRAFT. This is a batch of drafts, not proof of eventual multi-network publication.
An executable, safe-by-default reference implementation lives in the PostSider agent-publishing examples. Running it without --create-draft makes no network request; the isolated tests exercise request/response validation without posting. It refuses to operate on more than three explicit channel IDs. Before running the real API path, store its request date, approved text and idempotency key so retries remain identical.
If you prefer a visual automation builder, the n8n verified-draft guide links to a manual-only downloadable workflow.
Save the response, then verify the exact post
Submit the saved JSON with the saved key, then query the returned post ID. This separates request acceptance from what the scheduling system actually stored.
KEY="$(<schedule-key.txt)"
curl --silent --show-error --max-time 30 \
-D schedule-response.headers \
-o schedule-response.json \
-w 'HTTP %{http_code}\n' \
-X POST "${POSTSIDER_API_BASE}/posts" \
-H "Authorization: ${POSTSIDER_API_KEY}" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: ${KEY}" \
--data-binary @schedule-request.json
Check both curl’s exit status and the printed HTTP status. Without --fail, curl can exit successfully for an HTTP error; that is why this command preserves the body for inspection. A successful create response is an array with postId and integration in each entry, not a full post object.
Only after a successful HTTP response, extract the ID and read it:
POST_ID="$(jq -er '.[0].postId' schedule-response.json)" || exit 1
curl --fail-with-body --silent --show-error \
-H "Authorization: ${POSTSIDER_API_KEY}" \
"${POSTSIDER_API_BASE}/posts/${POST_ID}" \
| jq '{group, integration, settings,
posts: [.posts[] | {id, state, publishDate, content, releaseURL}]}'
The detail response wraps records in posts, alongside group, integration, and settings. Compare the returned integration with your chosen channel and publishDate with the saved request date. Confirm the content, settings, and QUEUE state. Keep the post ID with your job record.
Scheduling starts asynchronously. A later scheduling failure can mark the record ERROR, so even an immediate successful readback is not a permanent delivery guarantee. Check again after the scheduled time; investigate errors rather than creating a replacement automatically. When a publication URL is available, inspect it on the destination network.
Safe retries preserve the original job, not just its text
After a timeout, replay the same payload with the same key. Never generate a fresh UUID merely because the response was lost.
For a completed matching request, PostSider can return the saved result. Its implementation hashes JSON.stringify of the parsed request body, so preserve property order too: equivalent content reconstructed in a different order can produce a different hash. Sending the saved file avoids that mistake.
Before rerunning the create command, archive any response files you want to retain; that command overwrites them. Use a bounded retry policy:
| Result | Next action |
|---|---|
| Timeout, connection failure, or 5xx | Wait, then retry the saved request and key; stop after a bounded number of attempts. |
| 429 | Wait for the Retry-After interval before retrying. |
| 400 | Inspect the validation message. Fix the request deliberately; do not loop. |
| 401 or 402 | Resolve authentication or account access before another write. |
| 409 | Read the message: invalid key, changed request, and still-processing request need different responses. |
An in-progress key returns a conflict rather than a completed replay. Wait before checking again. A changed-payload conflict means this is no longer the original operation; reconcile any existing post before deciding whether to create a separate job.
Idempotency reduces duplicate creation on retries. It does not guarantee exactly-once publication on every social network, and this runbook should not treat it as that promise.
Finish the first job before expanding the automation
A useful first milestone is a saved request linked to a verified post, followed by a publication check. Only then add more channels or media.
If your pipeline loses the response and cannot recover an ID, GET /posts accepts startDate and endDate and returns {posts: [...]}. Search a narrow UTC range around the saved date, then compare channel and content. Do not identify a job by text alone or create another post just because one list query came back empty.
For queue-based scheduling, GET /find-slot/:id returns {date}. Resolve that slot once and persist it before creating the job; asking for a new slot during retry changes the payload. For local appointments and daylight saving transitions, use the timezone and DST scheduling guide.
Drafts, approval, and immediate publishing use the same envelope
Use type: 'draft' when content still needs review, or type: 'now' when an authorized operator explicitly wants immediate publishing. Both use the create-post envelope; a draft still requires a date and the structural fields shown above. Saving a draft does not prove that its provider settings and media will pass publication checks.
To prepare a draft, copy the saved payload into a separate job, set type to draft, and assign a new key before its first submission. Keep the date, channel, and content explicit. Do not change the original saved request and replay it under the original scheduling key.
After creation, POST /public/v1/posts/:id/request-approval submits that existing draft for review; GET /public/v1/posts/:id/approval reads the review outcome. A draft is not automatically an approval requirement. Your caller must respect the review result rather than treating an agent conversation as authorization.
The status endpoint changes an existing record without creating another:
# POST_ID must identify the reviewed post, not an arbitrary recent record.
curl --fail-with-body --silent --show-error \
-X PUT "${POSTSIDER_API_BASE}/posts/${POST_ID}/status" \
-H "Authorization: ${POSTSIDER_API_KEY}" \
-H 'Content-Type: application/json' \
--data '{"status":"schedule"}'
The accepted status values are lowercase schedule and draft. Before promotion, read the stored date and required provider settings; an old draft may carry an appointment that has already passed. Moving a queued post back to draft stops its scheduling workflow, but it is not a way to undo content already published on the social network. Verify the resulting state.
For immediate publishing, prepare a separate reviewed request with type: 'now', a current date, and the target channel’s full required settings. Capture its returned ID and check the asynchronous result just as you would for a scheduled job. “Now” is not a promise that provider processing takes zero time.
Confirm publication without confusing inbound events with success
Read the same post after its appointment and inspect the destination URL when available. A signed publication-success webhook can complement status reads, but an inbound subscription to another source is not evidence that this scheduled post went live.
Use the publication webhook guide for the separate receiver contract and the API error runbook for unresolved jobs. Do not wait indefinitely for a publication-failure event or create a replacement merely because a webhook has not arrived. For agent callers, the MCP scheduling walkthrough reaches the publishing workflow through named tools rather than a different confirmation standard.
Keep the same post visible in the dashboard so a human can inspect a failure or correct the schedule. Start with one connected account, save one request, and prove its readback before putting the workflow on a timer.
Lukasz Blania is the founder of PostSider, a social media scheduling product with a dashboard and API access for developer workflows.
Where this fits in a product
The tutorial above is the integration path. The social media scheduling API page is the commercial shape of the same thing: an organization key, idempotent writes, per-platform status, signed webhooks and a plan that starts at $20 for five channels. If the caller is an autonomous agent instead of your own code, the MCP guide is the matching path.
For a volume-based roll-out, the Post Bridge account pricing is the comparison to read first.
Frequently asked questions
Do I put Bearer before my PostSider API key?
No. For an organization API key, send the raw key in the Authorization header. This tutorial uses that credential type, not an OAuth access token.
Which date format should I send for a scheduled post?
Send an ISO 8601 timestamp. Convert an explicit local offset to UTC and send the resulting timestamp ending in Z. Choose a future time and keep that date unchanged during retries.
Can I retry a create request after a timeout?
Retry with the original Idempotency-Key and unchanged JSON payload. A completed matching request can return its saved result. A 409 can mean an invalid key, a changed payload, or an original request still processing; inspect the message before acting.
Does a successful create response mean the post is published?
No. The response provides post IDs. Read each post back to check its scheduled time and state, then check again after the publishing time. QUEUE is scheduled work, not proof of publication.