logo
Schedulin Developers

Post to several accounts at once

POST /v0/post-groups creates one post per entry in posts, all in a single request — for example the same caption and image sent to Instagram, Threads and Facebook. Each entry takes exactly the same fields as POST /v0/posts and is validated the same way, so you can still tailor the caption or platformConfiguration per channel.

  • All or nothing. If any post is invalid (an unknown account, a caption over a platform's limit, a missing scheduledAt), the whole request is rejected and nothing is created.
  • Shared media is imported once. A public image or video URL used by several posts is downloaded into your media library a single time.
  • Queueing. Posts with action: "queue" on the same account take consecutive queue slots.
  • Up to 50 posts per request.

The response has the group id and the created posts, in the order you sent them.

curl -X POST https://api.schedulin.app/v0/post-groups \
  -H "x-api-key: $SCHEDULIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "posts": [
      {
        "socialAccountId": "acc_instagram",
        "caption": "Weekend sale starts now ☀️",
        "media": [{ "url": "https://www.schedulin.app/schedulin-post-preview-light.png" }],
        "platformConfiguration": { "placement": "feed" },
        "action": "now"
      },
      {
        "socialAccountId": "acc_threads",
        "caption": "Weekend sale starts now ☀️",
        "media": [{ "url": "https://www.schedulin.app/schedulin-post-preview-light.png" }],
        "action": "now"
      }
    ]
  }'
import { SchedulinClient } from "@schedulin/sdk";

const client = new SchedulinClient({ apiKey: process.env.SCHEDULIN_API_KEY! });
const image = { url: "https://www.schedulin.app/schedulin-post-preview-light.png" };

const group = await client.postGroups.create({
  posts: [
    {
      socialAccountId: "acc_instagram",
      caption: "Weekend sale starts now ☀️",
      media: [image],
      platformConfiguration: { placement: "feed" },
      action: "now",
    },
    {
      socialAccountId: "acc_threads",
      caption: "Weekend sale starts now ☀️",
      media: [image],
      action: "now",
    },
  ],
});
console.log(group.id, group.posts.map((post) => post.id));
import os

from schedulin import Schedulin

client = Schedulin(api_key=os.environ["SCHEDULIN_API_KEY"])
image = {"url": "https://www.schedulin.app/schedulin-post-preview-light.png"}

group = client.post_groups.create(
    posts=[
        {
            "social_account_id": "acc_instagram",
            "caption": "Weekend sale starts now ☀️",
            "media": [image],
            "platform_configuration": {"placement": "feed"},
            "action": "now",
        },
        {
            "social_account_id": "acc_threads",
            "caption": "Weekend sale starts now ☀️",
            "media": [image],
            "action": "now",
        },
    ],
)
NOTE
ships in the SDKs' next release; until then, call the endpoint with or as above.