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 /api/v1/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 /api/v1/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. |
isDraft | boolean | No | If true, saved as draft. |
* Either file or fileId must be provided.
Configuration
Platform-specific settings must be provided as Nested Objects. Use the platform name as the key (e.g., youtube, tiktok) and provide a JSON string containing the parameters.
YouTube Specific Fields
| Flat Key | Nested Key | Type | Description |
|---|---|---|---|
youtubeTitle | title | string | Title of the YouTube video |
youtubeDescription | description | string | Description of the YouTube video |
youtubePrivacy | privacy | select | Privacy status Options: public, private, unlisted |
youtubeAutoPublish | autoPublish | boolean | Whether to auto-publish the video |
selectedYoutubeChannels | channels | array | List of channel IDs |
Note: For nested config, send a JSON string in the field youtube.
Instagram Specific Fields
| Flat Key | Nested Key | Type | Description |
|---|---|---|---|
instagramCaption | caption | string | Caption for the Instagram post |
instagramAutoPublish | autoPublish | boolean | Whether to auto-publish the post |
selectedInstagramAccounts | accounts | array | List of Instagram account IDs |
Note: For nested config, send a JSON string in the field instagram.
TikTok Specific Fields
| Flat Key | Nested Key | Type | Description |
|---|---|---|---|
tiktokCaption | caption | string | Caption for the TikTok |
tiktokPrivacy | privacy | select | Privacy status Options: PUBLIC_TO_EVERYONE, MUTUAL_FOLLOW_FRIENDS, SELF_ONLY |
tiktokAutoPublish | autoPublish | boolean | Whether to auto-publish the TikTok |
selectedTiktokAccounts | accounts | array | List of TikTok account IDs |
tiktokDisableComment | disableComment | boolean | Disable comments |
tiktokDisableDuet | disableDuet | boolean | Disable duet |
tiktokDisableStitch | disableStitch | boolean | Disable stitch |
Note: For nested config, send a JSON string in the field tiktok.
LinkedIn Specific Fields
| Flat Key | Nested Key | Type | Description |
|---|---|---|---|
linkedinComment | comment | string | Comment for the LinkedIn post |
linkedinAutoPublish | autoPublish | boolean | Whether to auto-publish the post |
selectedLinkedinAccounts | accounts | array | List of LinkedIn account IDs |
Note: For nested config, send a JSON string in the field linkedin.
Pinterest Specific Fields
| Flat Key | Nested Key | Type | Description |
|---|---|---|---|
pinterestTitle | title | string | Title for the Pinterest pin |
pinterestDescription | description | string | Description for the Pinterest pin |
pinterestAutoPublish | autoPublish | boolean | Whether to auto-publish the pin |
selectedPinterestAccounts | accounts | array | List of Pinterest account IDs |
Note: For nested config, send a JSON string in the field pinterest.
Image Upload
POST /api/v1/media/images
Uploads an image file for platforms that support image posts (Instagram, TikTok, LinkedIn, Pinterest).
Request Body (Form Data)
| Field | Type | Required | Description |
|---|---|---|---|
file | File | Yes | The image file. Supported: .jpg, .png, .webp. |
title | string | No | Internal title. |
description | string | No | Internal description. |
platforms | string | No | JSON array: ["instagram", "tiktok", "linkedin", "pinterest"]. |
scheduledAt | string | No | ISO 8601 date string for scheduling. |
Configuration
Image uploads support the same Nested Object configuration as video uploads.
Instagram Specific Fields
| Flat Key | Nested Key | Type | Description |
|---|---|---|---|
instagramCaption | caption | string | Caption for the Instagram post |
instagramAutoPublish | autoPublish | boolean | Whether to auto-publish the post |
selectedInstagramAccounts | accounts | array | List of Instagram account IDs |
Note: For nested config, send a JSON string in the field instagram.
TikTok Specific Fields
| Flat Key | Nested Key | Type | Description |
|---|---|---|---|
tiktokCaption | caption | string | Caption for the TikTok |
tiktokPrivacy | privacy | select | Privacy status Options: PUBLIC_TO_EVERYONE, MUTUAL_FOLLOW_FRIENDS, SELF_ONLY |
tiktokAutoPublish | autoPublish | boolean | Whether to auto-publish the TikTok |
selectedTiktokAccounts | accounts | array | List of TikTok account IDs |
tiktokDisableComment | disableComment | boolean | Disable comments |
tiktokDisableDuet | disableDuet | boolean | Disable duet |
tiktokDisableStitch | disableStitch | boolean | Disable stitch |
Note: For nested config, send a JSON string in the field tiktok.
LinkedIn Specific Fields
| Flat Key | Nested Key | Type | Description |
|---|---|---|---|
linkedinComment | comment | string | Comment for the LinkedIn post |
linkedinAutoPublish | autoPublish | boolean | Whether to auto-publish the post |
selectedLinkedinAccounts | accounts | array | List of LinkedIn account IDs |
Note: For nested config, send a JSON string in the field linkedin.
Pinterest Specific Fields
| Flat Key | Nested Key | Type | Description |
|---|---|---|---|
pinterestTitle | title | string | Title for the Pinterest pin |
pinterestDescription | description | string | Description for the Pinterest pin |
pinterestAutoPublish | autoPublish | boolean | Whether to auto-publish the pin |
selectedPinterestAccounts | accounts | array | List of Pinterest account IDs |
Note: For nested config, send a JSON string in the field pinterest.
Supported Platforms
| Platform | Video | Image |
|---|---|---|
| YouTube Shorts | ✅ | ❌ |
| ✅ | ✅ | |
| TikTok | ✅ | ✅ |
| ✅ | ✅ | |
| ✅ | ✅ |
Example: Uploading a Video
curl -X POST https://xenonflare.com/api/v1/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://xenonflare.com/api/v1/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}"
Example: Uploading an Image
curl -X POST https://xenonflare.com/api/v1/media/images \
-H "X-API-Key: your_api_key" \
-F "file=@promo_image.png" \
-F "platforms=[\"instagram\", \"pinterest\"]" \
-F "instagram={\"caption\": \"New Product Launch!\", \"autoPublish\": true}" \
-F "pinterest={\"title\": \"New Collection\", \"autoPublish\": true}"
Response Body
{
"success": true,
"message": "Upload successful",
"data": [
{
"id": "67a2b...",
"title": "My Post",
"status": "scheduled",
"platforms": ["instagram", "pinterest"]
}
]
}