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:
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:
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:
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:
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
| Platform | Available Types | Default |
|---|---|---|
instagram | feed, story, reels | feed |
facebook | feed, story, reels | feed |
tiktok | video | video |
youtube | video, shorts | video |
twitter | tweet | tweet |
threads | post | post |
Complete Example
Here's a comprehensive example combining all publishing features:
{
"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.