Publishing Content

Learn how to publish content to one or multiple social media platforms simultaneously, with support for platform-specific customization.

Single Platform Publishing

Publishing to a single platform is straightforward - just specify the platform in theplatforms array:

Publish to Instagram Onlybash
curl -X POST https://your-domain.com/api/agents/v1/content/publish \
  -H "X-API-Key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "caption": "Check out this amazing view! 🌅",
    "platforms": ["instagram"],
    "media_urls": ["https://example.com/image.jpg"],
    "publish_now": true
  }'

Multi-Platform Publishing

Publish to multiple platforms simultaneously by including multiple platform identifiers:

Publish to Multiple Platformsbash
curl -X POST https://your-domain.com/api/agents/v1/content/publish \
  -H "X-API-Key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "caption": "New product launch! Available now 🚀",
    "platforms": ["instagram", "facebook", "twitter", "threads"],
    "media_urls": ["https://example.com/product.jpg"],
    "publish_now": true
  }'

Platform-Specific Captions

Customize the caption for each platform using the platform_captions object:

Different Captions per Platformbash
curl -X POST https://your-domain.com/api/agents/v1/content/publish \
  -H "X-API-Key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "caption": "Default caption for all platforms",
    "platforms": ["instagram", "twitter"],
    "platform_captions": {
      "instagram": "Check out this post! 📸 #photography",
      "twitter": "New post alert! 🚀"
    },
    "publish_now": true
  }'

Caption Hierarchy

If platform_captions contains a caption for a platform, it will be used. Otherwise, the default caption will be used for all platforms without a specific caption.

Multiple Content Types per Platform

Some platforms support multiple content types (e.g., Instagram supports feed, story, and reels). Specify the types using the platform_types object:

Publish to Multiple Typesbash
curl -X POST https://your-domain.com/api/agents/v1/content/publish \
  -H "X-API-Key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "caption": "Behind the scenes! 🎬",
    "platforms": ["instagram"],
    "platform_types": {
      "instagram": ["feed", "story"]
    },
    "media_urls": ["https://example.com/video.mp4"],
    "publish_now": true
  }'

Supported Platform Types

PlatformAvailable TypesDefault
instagramfeed, story, reelsfeed
facebookfeed, story, reelsfeed
tiktokvideovideo
youtubevideo, shortsvideo
twittertweettweet
threadspostpost

Complete Example

Here's a comprehensive example combining all publishing features:

Advanced Multi-Platform Publishingjson
{
  "caption": "Default caption if no platform-specific caption is set",
  "platforms": ["instagram", "facebook", "twitter"],
  "platform_captions": {
    "instagram": "Instagram-specific caption with #hashtags 📸",
    "twitter": "Twitter-specific caption with @mentions"
  },
  "platform_types": {
    "instagram": ["feed", "story"],
    "facebook": ["feed"]
  },
  "media_urls": [
    "https://example.com/image1.jpg",
    "https://example.com/image2.jpg"
  ],
  "publish_now": true
}

Next: Scheduling

Learn how to schedule posts with flexible timing strategies in theScheduling section.