Social Publishing
Social Publishing
- Social Publishing lets you push media you generate on MuAPI straight to your social accounts. Connect an account once via OAuth, then call a publish endpoint with the media URL and the connected account's id.
Availability: YouTube is live. TikTok and Instagram are wired up but currently marked coming soon — the endpoints exist and accept requests, but publishing is gated until the platform review is complete.
How it works
Publishing happens in three steps:
- Connect an account (one-time) — authorize MuAPI to post on your behalf from the Integrations page.
- Find the account id — list your connected accounts to get the numeric
account_id. - Publish — submit an async publish job with the
account_idand a publicmedia_url.
Like every other MuAPI job, publishing follows the submit-then-poll pattern: the publish call returns a request_id, and you poll (or receive a webhook) for the final result.
1. Connect an account
Go to Dashboard → Integrations and click Connect on the platform you want. You can give each connection an optional label (e.g. "Brand channel") before being redirected to the platform's OAuth consent screen. After you approve, you're returned to MuAPI and the account appears in your connected list.
- Multiple accounts per platform are supported — connect as many YouTube/TikTok/Instagram accounts as you like; each gets its own
account_id. - You can rename or disconnect any account from the same page.
2. Find your account id
List your connected accounts to get the account_id you'll publish to:
curl --location 'https://muapi.ai/api/social/accounts' \
--header 'x-api-key: YOUR_API_KEY'
Response:
[
{
"id": 42,
"platform": 1,
"platform_name": "youtube",
"account_name": "Brand channel",
"platform_user_id": "...",
"connected_at": "2026-05-29T05:50:00Z"
}
]
Use the id field (42 here) as the account_id in your publish request. platform is 1=YouTube, 2=TikTok, 3=Instagram.
3. Publish a video (YouTube)
curl --location --request POST 'https://api.muapi.ai/api/v1/youtube-publish' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"account_id": 42,
"media_url": "https://cdn.muapi.ai/your-video.mp4",
"title": "My generated video",
"description": "Made with MuAPI",
"tags": ["ai", "muapi"],
"privacy": "public"
}'
Response:
{
"request_id": "abc123xyz",
"status": "processing"
}
YouTube parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
account_id | integer | ✅ | Connected YouTube account id (from GET /api/social/accounts). |
media_url | string (URL) | ✅ | Public URL of the video to upload. |
title | string | ✅ | Video title (max 100 chars). |
description | string | Video description. Default "". | |
tags | string[] | Keyword tags. | |
privacy | enum | public, private, or unlisted. Default public. | |
category_id | enum | YouTube category id (string). Omit to default to "22" (People & Blogs). See the category map below. | |
made_for_kids | boolean | COPPA made-for-kids flag. Default false. |
YouTube category IDs — pass the id as a string in category_id:
| Category | id |
|---|---|
| Film & Animation | "1" |
| Autos & Vehicles | "2" |
| Music | "10" |
| Pets & Animals | "15" |
| Sports | "17" |
| Travel & Events | "19" |
| Gaming | "20" |
| People & Blogs (default) | "22" |
| Comedy | "23" |
| Entertainment | "24" |
| News & Politics | "25" |
| Howto & Style | "26" |
| Education | "27" |
| Science & Technology | "28" |
| Nonprofits & Activism | "29" |
4. Get the result
Poll for the result (or pass a webhook query param to be notified on completion — see Webhooks):
curl --location 'https://api.muapi.ai/api/v1/predictions/abc123xyz/result' \
--header 'x-api-key: YOUR_API_KEY'
Completed response:
{
"id": "abc123xyz",
"status": "completed",
"output": {
"platform": "youtube",
"url": "https://youtube.com/watch?v=..."
}
}
Coming soon
The following endpoints exist but are gated behind platform review.
TikTok — POST /api/v1/tiktok-publish
| Parameter | Type | Required | Description |
|---|---|---|---|
account_id | integer | ✅ | Connected TikTok account id. |
media_url | string (URL) | ✅ | Public URL of the video. |
title | string | Caption (max 150 chars). | |
privacy_level | enum | PUBLIC_TO_EVERYONE, MUTUAL_FOLLOW_FRIENDS, FOLLOWER_OF_CREATOR, SELF_ONLY. | |
disable_comment / disable_duet / disable_stitch | boolean | Interaction toggles. Default false. |
Output: { "platform": "tiktok", "publish_id": "..." }
Instagram — POST /api/v1/instagram-publish
| Parameter | Type | Required | Description |
|---|---|---|---|
account_id | integer | ✅ | Connected Instagram (Business) account id. |
media_url | string (URL) | ✅ | Public URL of the video or image. |
caption | string | Post caption (supports hashtags). | |
media_type | enum | VIDEO or IMAGE. Default VIDEO. |
Output: { "platform": "instagram", "media_id": "..." }
Pricing
Each successful publish costs $0.01. See Pricing and Credits for details.