Docs

Post an image to several platforms

Import an image, check the post against every platform, schedule it and learn when it is live.

This recipe posts one image with a text to LinkedIn and Instagram, with a shorter text for X. It uses four calls: import the image, check the post, create it, then wait for the webhook.

You need an API key with posts:write and the id of a profile that has these accounts connected (GET /profiles, GET /accounts?profileId=…).

1. Import the image

curl -X POST https://feedhorizon.com/api/v1/media \
  -H "Authorization: Bearer $FEEDHORIZON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://example.com/launch.jpg" }'

The call answers once the file is stored. Files on your own machine go through a direct upload instead.

2. Check the post

POST /posts/validate runs every check without creating anything: text length per platform, media types and counts, connected accounts, the time.

post.json
{
  "profileId": "prof_…",
  "content": "Our new soup subscription starts today: five recipes a week, delivered as a shopping list every Sunday.",
  "mediaIds": ["med_…"],
  "targets": [
    { "accountId": "acc_LINKEDIN…" },
    { "accountId": "acc_INSTAGRAM…" },
    { "accountId": "acc_X…", "content": "Soup subscription is live: 5 recipes a week 🍲" }
  ],
  "scheduledFor": "2026-11-12T09:00:00+01:00"
}
curl -X POST https://feedhorizon.com/api/v1/posts/validate \
  -H "Authorization: Bearer $FEEDHORIZON_API_KEY" \
  -H "Content-Type: application/json" \
  -d @post.json

Fix what errors lists. warnings do not block the post; account_not_active means an account must be reconnected before the post goes out. This step is optional: POST /posts runs the same checks and answers 400 with every problem in error.details.

3. Create the post

Send the same body to POST /posts, with an Idempotency-Key so a retry after a timeout does not post twice.

curl -X POST https://feedhorizon.com/api/v1/posts \
  -H "Authorization: Bearer $FEEDHORIZON_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: soup-launch-2026-11-12" \
  -d @post.json

4. Learn when it is live

Subscribe a webhook to post.target.published and post.target.failed to hear about each account as soon as it is done, or to post.published, post.partial and post.failed for the whole post. targets[].platformUrl links to the live post.

Without a webhook, GET /posts/{id} shows the same: the post's status and each target's status, platformUrl and error.

Instagram and other platforms that need media

Instagram and Pinterest need at least one image or video, TikTok a video. A post with these accounts and no media fails the check with media_required. Platform support lists the rules of every platform.