Create a thread
Pass a parts array (1–25 items) to publish a thread. Each part has a caption and an
optional media array (up to 4 items). Threads are supported on X and Mastodon;
other platforms ignore parts.
The two platforms treat the top-level caption differently:
- X — when
partsis present, the whole thread is built fromparts:parts[0]is the first tweet and each later part replies to the previous one. Setcaptionto the same text asparts[0](it's still required). - Mastodon —
caption(andmedia) is the first toot, and each part is posted as a reply under it.
curl -X POST https://api.schedulin.app/v0/posts \ -H "x-api-key: $SCHEDULIN_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "socialAccountId": "acc_456", "caption": "We rebuilt our scheduler from scratch. Here is what we learned 🧵", "parts": [ { "caption": "We rebuilt our scheduler from scratch. Here is what we learned 🧵" }, { "caption": "1. Queues beat cron for anything user-facing." }, { "caption": "2. Measure before you optimize. This chart surprised us:", "media": [{ "url": "https://example.com/latency-chart.png" }] } ], "action": "schedule", "scheduledAt": "2026-06-04T16:00:00Z" }'
const intro = "We rebuilt our scheduler from scratch. Here is what we learned 🧵"; await client.posts.create({ socialAccountId: "acc_456", caption: intro, parts: [ { caption: intro }, { caption: "1. Queues beat cron for anything user-facing." }, { caption: "2. Measure before you optimize. This chart surprised us:", media: [{ url: "https://example.com/latency-chart.png" }], }, ], action: "schedule", scheduledAt: "2026-06-04T16:00:00Z", });
from datetime import datetime, timezone intro = "We rebuilt our scheduler from scratch. Here is what we learned 🧵" client.posts.create( social_account_id="acc_456", caption=intro, parts=[ {"caption": intro}, {"caption": "1. Queues beat cron for anything user-facing."}, { "caption": "2. Measure before you optimize. This chart surprised us:", "media": [{"url": "https://example.com/latency-chart.png"}], }, ], action="schedule", scheduled_at=datetime(2026, 6, 4, 16, 0, tzinfo=timezone.utc), )
TIP
For Mastodon, drop the duplicated first part: put the opening text in and only the replies in .