Content publishing API
Content Publishing API for Social Media Apps
A content publishing API is the piece that lets your product post to social platforms without maintaining five integrations. Wahdx Connection handles account connections, media validation, scheduling, and status, and returns per-platform analytics, while your backend keeps the API key and your own product logic. This page covers the endpoints, a request to start from, and the behaviors worth planning around.
The problem this solves
Building social publishing from scratch means five OAuth implementations, five media rule sets, five status models, and five sets of analytics to normalize. The API collapses that into one credentials store, one content payload, one status model, and one analytics read. Your product keeps the editor, the approvals, and the user experience it already has, and calls the API for the social layer underneath.
The endpoints you build against
Five endpoints cover most integrations. Listing accounts discovers what is connected and returns the accountId to publish with. One content endpoint publishes video, photo carousel, and text across the platforms that accept them. A scheduled endpoint queues posts up to 30 days ahead. Status endpoints check one post or a batch. And analytics endpoints return audience metrics per platform plus publishing volume from the ledger.
- GET /api/content/accounts: connected accounts and their platform.
- POST /api/content/post: publish video, photo carousel, or text.
- POST /api/posts: schedule content up to 30 days ahead.
- GET /api/content/status/:accountId/:publishId and POST /api/content/status/batch.
- GET /api/analytics/publishing: publishing volume per platform.
A publishing request you can run
The backend detects the media type from the URLs in mediaItems, so video and photo carousel share the same endpoint. Use the accountId from the account listing and keep the API key in your server environment.
// Video and photo carousel use the SAME endpoint:
// POST /api/content/post
const videoPayload = {
"platform": "tiktok",
"accountId": "CONNECTED_ACCOUNT_ID",
"content": "Video caption",
"mediaItems": [
{
"url": "https://your-domain.com/video.mp4"
}
]
};
const photoCarouselPayload = {
"platform": "tiktok",
"accountId": "CONNECTED_ACCOUNT_ID",
"photoTitle": "Carousel title",
"content": "Carousel caption",
"mediaItems": [
{
"url": "https://your-domain.com/photo-1.jpg"
},
{
"url": "https://your-domain.com/photo-2.jpg"
}
]
};# Video and photo carousel use the SAME endpoint:
# POST /api/content/post
video_payload = {
'platform': 'tiktok',
'accountId': 'CONNECTED_ACCOUNT_ID',
'content': 'Video caption',
'mediaItems': [
{
'url': 'https://your-domain.com/video.mp4'
}
]
}
photo_carousel_payload = {
'platform': 'tiktok',
'accountId': 'CONNECTED_ACCOUNT_ID',
'photoTitle': 'Carousel title',
'content': 'Carousel caption',
'mediaItems': [
{
'url': 'https://your-domain.com/photo-1.jpg'
},
{
'url': 'https://your-domain.com/photo-2.jpg'
}
]
}# Video request: exactly one video URL in mediaItems
curl -X POST "https://api.wahdx.com/api/content/post" \
-H "X-API-Key: $WAHDX_API_KEY" \
-H "Content-Type: application/json" \
--data-raw '{
"platform": "tiktok",
"accountId": "CONNECTED_ACCOUNT_ID",
"content": "Video caption",
"mediaItems": [
{
"url": "https://your-domain.com/video.mp4"
}
]
}'
# Photo carousel request: multiple image URLs in mediaItems
curl -X POST "https://api.wahdx.com/api/content/post" \
-H "X-API-Key: $WAHDX_API_KEY" \
-H "Content-Type: application/json" \
--data-raw '{
"platform": "tiktok",
"accountId": "CONNECTED_ACCOUNT_ID",
"photoTitle": "Carousel title",
"content": "Carousel caption",
"mediaItems": [
{
"url": "https://your-domain.com/photo-1.jpg"
},
{
"url": "https://your-domain.com/photo-2.jpg"
}
]
}'Keep the API key server-side
Every request uses the X-API-Key header, and that key belongs in a backend, serverless function, or private integration layer. Client apps should call your backend, not the API directly. Rotate a key immediately if it is exposed, and route user actions through your own server so credentials never reach the browser or a mobile bundle.
Limits and behaviors to plan around
Publishing validates against the selected platform before sending, text-only posts are limited to Threads and Facebook, and a carousel cannot mix photos with video. The scheduling window is 7 days. Only successful publishes count toward the monthly upload quota. Analytics require an active connected account with the insights permission, and the publishing analytics endpoint needs the ledger mode enabled or it returns 404 without changing publishing behavior.
Status and reporting after submission
After a request, status endpoints report queued, processing, published, or failed per post, and batch checks sweep several at once. Analytics then return reach, engagement, followers, and top content per platform, so the same integration that publishes also reports. Failed posts stay visible, which keeps a background publishing job something you can monitor rather than something you hope works.
FAQ
Common questions about the content publishing API
Can I call the API from frontend JavaScript?
No. Keep API keys out of browser code and call the API from a trusted server-side environment.
Does one endpoint handle video and photo carousel?
Yes. POST /api/content/post detects the media type from the mediaItems URLs. One video URL is a video post; multiple image URLs are a carousel.
Does the API support multiple platforms?
Yes. It covers TikTok, Instagram, Threads, Facebook, and YouTube, with platform-specific settings where each platform needs them.
Is there documentation for developers?
Yes. The API docs cover authentication, account listing, publishing, media requirements, status tracking, and analytics endpoints.
Related reading
Go deeper on this workflow.
Related API docs
TikTok Content Publishing API: Video, Photos & Carousels
Publish video and photo carousels to TikTok through an official API. Media specs, posting limits, QR login, scheduling, and status tracking in one workflow.
Instagram Graph API Content Publishing for Business Accounts
Publish photos, reels, and carousels to Instagram with the Content Publishing API. Business account requirements, media limits, and metrics.
YouTube API: Upload Videos and Read Channel Analytics
Upload videos to YouTube with per-video settings, then read subscribers, views, and video metrics through one API workflow.
Threads API: Text Posts, Thread Sequences & Metrics
Publish text posts and thread sequences to Threads via API. Character limits, scopes, reply settings, rate limits, and metrics read-back.