Media Upload
XenonFlare provides dedicated endpoints for uploading videos and images. Choosing the correct endpoint ensures optimized processing and validation for your media type.
Video Upload
POST /media/videos
Uploads a video file and schedules it for publication across your connected video platforms (YouTube, Instagram Reels, TikTok, LinkedIn, Pinterest).
If you are using Chunked Uploads, the POST /media/videos endpoint is used to finalize the upload by providing the fileId instead of the file itself.
Headers
| Name | Type | Description |
|---|---|---|
X-API-Key | string | Your API Key. |
Content-Type | string | Must be multipart/form-data. |
Request Body (Form Data)
| Field | Type | Required | Description |
|---|---|---|---|
file | File | Yes* | The video file. Supported: .mp4, .mov. |
fileId | string | Yes* | The unique ID from a chunked upload. Required if file is missing. |
title | string | No | Internal title for the media. |
description | string | No | Internal description or default caption. |
platforms | string | Yes | JSON array: ["youtube", "instagram", "tiktok", "linkedin", "pinterest"]. |
scheduledAt | string | No | ISO 8601 date string for scheduling. |
* Either file or fileId must be provided.
Configuration
Platform-specific settings must be provided as Nested JSON Objects. Use the platform name as the key (e.g., youtube, tiktok) and provide a JSON string containing the parameters for that platform.
How to Select Channels/Accounts
For each platform, you can specify which connected accounts to use by adding a channels or accounts array to the nested JSON object.
- YouTube: Use
channels(array of YouTube Channel IDs). - Instagram, TikTok, LinkedIn, Pinterest: Use
accounts(array of platform-specific account IDs). - Profiles: Use
profileId(string) to target a pre-defined group of accounts.
You can get these IDs from the Channels API or the Posting Profiles API.
YouTube Specific Fields
| Nested Key | Type | Description |
|---|---|---|
title | string | Title of the YouTube video |
description | string | Description of the YouTube video |
privacy | select | Privacy status Options: public, private, unlisted |
autoPublish | boolean | Whether to auto-publish the video |
channels | array | List of channel IDs |
Note: For nested config, send a JSON string in the field youtube.
Instagram Specific Fields
| Nested Key | Type | Description |
|---|---|---|
caption | string | Caption for the Instagram post |
autoPublish | boolean | Whether to auto-publish the post |
accounts | array | List of Instagram account IDs |
Note: For nested config, send a JSON string in the field instagram.
TikTok Specific Fields
| Nested Key | Type | Description |
|---|---|---|
caption | string | Caption for the TikTok |
privacy | select | Privacy status Options: PUBLIC_TO_EVERYONE, MUTUAL_FOLLOW_FRIENDS, SELF_ONLY |
autoPublish | boolean | Whether to auto-publish the TikTok |
accounts | array | List of TikTok account IDs |
disableComment | boolean | Disable comments |
disableDuet | boolean | Disable duet |
disableStitch | boolean | Disable stitch |
Note: For nested config, send a JSON string in the field tiktok.
LinkedIn Specific Fields
| Nested Key | Type | Description |
|---|---|---|
comment | string | Comment for the LinkedIn post |
autoPublish | boolean | Whether to auto-publish the post |
accounts | array | List of LinkedIn account IDs |
Note: For nested config, send a JSON string in the field linkedin.
Pinterest Specific Fields
| Nested Key | Type | Description |
|---|---|---|
title | string | Title for the Pinterest pin |
description | string | Description for the Pinterest pin |
autoPublish | boolean | Whether to auto-publish the pin |
accounts | array | List of Pinterest account IDs |
Note: For nested config, send a JSON string in the field pinterest.
See the Image Upload documentation for uploading images.
Supported Platforms
| Platform | Video |
|---|---|
| YouTube Shorts | ✅ |
| ✅ | |
| TikTok | ✅ |
| ✅ | |
| ✅ |
Example: Uploading a Video
curl -X POST https://api.xenonflare.com/media/videos \
-H "X-API-Key: your_api_key" \
-F "file=@gaming_highlight.mp4" \
-F "platforms=[\"youtube\", \"tiktok\"]" \
-F "youtube={\"title\": \"Epic Moment #shorts\", \"autoPublish\": true}" \
-F "tiktok={\"caption\": \"Incredible play!\", \"autoPublish\": true}"
Example: Uploading with Nested Config
curl -X POST https://api.xenonflare.com/media/videos \
-H "X-API-Key: your_api_key" \
-F "file=@gaming_highlight.mp4" \
-F "platforms=[\"tiktok\"]" \
-F "tiktok={\"caption\": \"Check this out!\", \"privacy\": \"PUBLIC_TO_EVERYONE\", \"autoPublish\": true}"
Response Body
{
"success": true,
"message": "Upload successful",
"data": [
{
"id": "67a2b...",
"title": "My Post",
"status": "scheduled",
"platforms": ["youtube", "tiktok"]
}
]
}
For large video files (up to 5GB), we recommend using our resumable chunked upload API. This ensures reliability even on unstable connections.