Publishing guide

Use this guide when your integration is ready to create posts through the UniPost API. It covers the shared publish path for hosted URLs, local media uploads, async publishing results, and the handoff to platform-specific options.

Choose input mode

UniPost accepts the same two media input patterns across supported platforms. Use media_urls when your asset is already hosted, or use media_ids when your app starts from local file bytes. Platform pages still define which media counts, formats, surfaces, and options are valid for each destination.

Hosted media URL

Use this when your image or video already has a public URL. Pass hosted assets in platform_posts[].media_urls.

Local file flow

The diagram and table show the same path: reserve media, upload to storage, confirm the media is ready, publish, then read or receive the asynchronous result.

Local file publishing sequencePOST /v1/mediamedia_id + upload_url, status=pendingPUT bytes to upload_urlGET /v1/media/{media_id}status=uploadedPOST /v1/posts or /v1/posts/validate202 accepted, post/result/job idscreate media containerwait for container readypublish to platformfetch permalinkGET /v1/posts/{post_id}ClientUniPost APIStorageWorkerPlatformClientUniPost APIStorageWorkerPlatform
StepAPI callPurpose
1POST/v1/oauth/connectConnect the platform account, then list accounts to keep its account_id.
2POST/v1/mediaReserve a media row and receive a presigned upload_url.
3PUT upload_urlUpload the raw image or video bytes directly to storage.
4GET/v1/media/:media_idPoll until status is uploaded or attached.
5POST/v1/posts/validateOptional preflight check for platform media rules, required metadata, and account state.
6POST/v1/postsCreate the post with platform_posts[].media_ids and any required platform_options.
7GET/v1/posts/:post_idGet the async publishing status and result. You can also receive final status through webhooks; see Publishing Result.

End-to-end local file example

These examples use Instagram feed publishing as the concrete surface. Change platform, account_id, and platform_options to match the platform-specific guide you are implementing.

Publishing result

POST/v1/posts accepts immediate publish requests asynchronously and returns once UniPost has queued the work.

Poll

GET/v1/posts/:post_id when your UI needs to show a live status.

Push

Subscribe to developer webhooks when your backend should receive final outcomes without polling.

The aggregate post status tells you whether the whole request is still pending, succeeded, partially succeeded, or failed. Inspect per-destination results when a cross-post includes multiple platform accounts.

Platform-specific payloads

The publish flow is shared, but payload details are still platform-specific. For example, Instagram uses platform_options.mediaType to select feed, reels, stories, or carousel publishing; YouTube uses upload metadata and privacy options; TikTok has video and photo-post constraints.