Skip to main content
Back to API docs

Video publishing requirements

Video Requirements for Social Publishing API Workflows

Video publishing succeeds more consistently when media files match platform expectations before a request is sent. Wahdx Connection uses the same POST /api/content/post endpoint for video and photo carousel publishing; the backend determines the media type from the mediaItems file extensions and validates the payload for the selected platform.

Endpoint difference: video vs photo carousel

There is no separate video endpoint and no separate photo carousel endpoint for public publishing. Use POST /api/content/post for both. The difference is the request body: video uses exactly one video URL, while photo carousel uses multiple image URLs. The platform field must match the connected account platform. The example response below is a TikTok video publish; TikTok returns a status of PUBLISH_INITIATED and a publish_id you poll through the status endpoint.

// Video and photo carousel use the SAME endpoint:
// POST /api/content/post

const videoPayload = {
  "platform": "tiktok",
  "accountId": "TIKTOK_ACCOUNT_ID",
  "content": "Video caption",
  "mediaItems": [
    {
      "url": "https://your-domain.com/video.mp4"
    }
  ]
};

const photoCarouselPayload = {
  "platform": "tiktok",
  "accountId": "TIKTOK_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"
    }
  ]
};
Example response · 200
{
  "success": true,
  "requestId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
  "requestStatus": "succeeded",
  "accountId": "TIKTOK_ACCOUNT_ID",
  "platform": "tiktok",
  "status": "PUBLISH_INITIATED",
  "data": {
    "publish_id": "v_pub_url~v2.7300000000000000000",
    "upload_url": "https://open.tiktokapis.com/v2/video/part/upload/"
  },
  "mediaType": "video",
  "mediaUrls": [
    "https://media.example.com/00000000-0000-4000-8000-000000000000.mp4"
  ],
  "fileIds": [
    "00000000-0000-4000-8000-000000000000.mp4"
  ]
}

Recommended video specifications

Use production-ready vertical media whenever possible. These defaults work well for TikTok-style and multi-platform short-form publishing workflows.

  • Format: MP4 or MOV recommended.
  • Codec: H.264 recommended.
  • Aspect ratio: 9:16 vertical recommended.
  • Resolution: 1080x1920 recommended.
  • Duration: 3 seconds to 10 minutes.
  • Frame rate: 24 to 60 FPS.

Complete video samples for every platform

These examples use the same endpoint and show the required platform field for TikTok, Instagram, Facebook, Threads, YouTube, and Pinterest. Keep X-API-Key server-side and replace each accountId with the connected account ID returned by your account listing flow. YouTube requires a youtubeTitle (or the caption is used) plus privacyStatus and selfDeclaredMadeForKids in youtubeSettings. Pinterest requires pinterestSettings.board_id and needs cover_image_url for every video Pin. The example response below is the TikTok video publish; every platform returns the same normalized envelope with its own status and data.

const API_BASE_URL = 'https://api.wahdx.com';
const API_KEY = process.env.WAHDX_API_KEY;

const headers = {
  'X-API-Key': API_KEY,
  'Content-Type': 'application/json'
};

// TikTok video
await fetch(API_BASE_URL + '/api/content/post', {
  method: 'POST',
  headers,
  body: JSON.stringify(
    {
      "platform": "tiktok",
      "accountId": "TIKTOK_ACCOUNT_ID",
      "content": "TikTok video caption #launch",
      "mediaItems": [
        {
          "url": "https://your-domain.com/video-tiktok.mp4"
        }
      ],
      "tiktokSettings": {
        "privacy_level": "PUBLIC_TO_EVERYONE",
        "allow_comment": true,
        "allow_duet": true,
        "allow_stitch": true,
        "video_cover_timestamp_ms": 3000,
        "video_made_with_ai": false,
        "draft": false
      }
    }
  )
});

// Instagram video / Reel
await fetch(API_BASE_URL + '/api/content/post', {
  method: 'POST',
  headers,
  body: JSON.stringify(
    {
      "platform": "instagram",
      "accountId": "INSTAGRAM_ACCOUNT_ID",
      "content": "Instagram Reel caption #campaign",
      "mediaItems": [
        {
          "url": "https://your-domain.com/video-instagram.mp4"
        }
      ],
      "instagramSettings": {
        "share_to_feed": true
      }
    }
  )
});

// Facebook Page video
await fetch(API_BASE_URL + '/api/content/post', {
  method: 'POST',
  headers,
  body: JSON.stringify(
    {
      "platform": "facebook",
      "accountId": "FACEBOOK_PAGE_ACCOUNT_ID",
      "content": "Facebook Page video description",
      "mediaItems": [
        {
          "url": "https://your-domain.com/video-facebook.mp4"
        }
      ],
      "facebookSettings": {}
    }
  )
});

// Threads video
await fetch(API_BASE_URL + '/api/content/post', {
  method: 'POST',
  headers,
  body: JSON.stringify(
    {
      "platform": "threads",
      "accountId": "THREADS_ACCOUNT_ID",
      "content": "Threads video post text",
      "mediaItems": [
        {
          "url": "https://your-domain.com/video-threads.mp4"
        }
      ],
      "threadsSettings": {
        "who_can_reply": "everyone"
      }
    }
  )
});

// YouTube Short
await fetch(API_BASE_URL + '/api/content/post', {
  method: 'POST',
  headers,
  body: JSON.stringify(
    {
      "platform": "youtube",
      "accountId": "YOUTUBE_CHANNEL_ACCOUNT_ID",
      "content": "YouTube Shorts description",
      "mediaItems": [
        {
          "url": "https://your-domain.com/video-youtube.mp4"
        }
      ],
      "youtubeTitle": "YouTube Short title",
      "youtubeSettings": {
        "privacyStatus": "public",
        "selfDeclaredMadeForKids": false
      }
    }
  )
});

// Pinterest video Pin
await fetch(API_BASE_URL + '/api/content/post', {
  method: 'POST',
  headers,
  body: JSON.stringify(
    {
      "platform": "pinterest",
      "accountId": "PINTEREST_ACCOUNT_ID",
      "content": "Pinterest video Pin description",
      "mediaItems": [
        {
          "url": "https://your-domain.com/video-pinterest.mp4"
        }
      ],
      "pinterestSettings": {
        "board_id": "PINTEREST_BOARD_ID",
        "title": "Pinterest video Pin title",
        "link": "https://your-domain.com/landing-page",
        "alt_text": "Describe the video cover for accessibility",
        "cover_image_url": "https://your-domain.com/pinterest-video-cover.jpg"
      }
    }
  )
});
Example response · 200
{
  "success": true,
  "requestId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
  "requestStatus": "succeeded",
  "accountId": "TIKTOK_ACCOUNT_ID",
  "platform": "tiktok",
  "status": "PUBLISH_INITIATED",
  "data": {
    "publish_id": "v_pub_url~v2.7300000000000000000",
    "upload_url": "https://open.tiktokapis.com/v2/video/part/upload/"
  },
  "mediaType": "video",
  "mediaUrls": [
    "https://media.example.com/00000000-0000-4000-8000-000000000000.mp4"
  ],
  "fileIds": [
    "00000000-0000-4000-8000-000000000000.mp4"
  ]
}

Preflight checks

Run basic media checks before calling the API to reduce failed publishing attempts.

  • Confirm the media URL is accessible by the backend.
  • Confirm file size and duration are within platform limits.
  • Avoid mixing photos and videos in the same post payload.
  • Use platform-specific settings only when they apply to the selected platform.

Retry safely with an optional Idempotency-Key

POST /api/content/post accepts an optional Idempotency-Key header on every platform, Instagram included. Send a stable key per publish so a network retry or a double submit replays the existing result instead of posting again. The response includes a requestId you can poll through GET /api/content/requests/{requestId} to recover the per-item result after a timeout. Slow media, such as an Instagram video container still processing, is the case most likely to hit a client timeout, so a key is recommended there.

FAQ

Common questions about this API topic.

What video format should I use?

MP4 with H.264 is the safest recommended format for most short-form publishing workflows.

Does video use a different endpoint from photo carousel?

No. Both use POST /api/content/post. Video uses one video URL in mediaItems, while photo carousel uses multiple image URLs.

Can I set a custom video cover frame?

Yes. Use video_cover_timestamp_ms inside tiktokSettings when the platform workflow supports it.

Does Idempotency-Key work for Instagram?

Yes. POST /api/content/post accepts Idempotency-Key on every platform, and the response returns a requestId you can poll through GET /api/content/requests/{requestId}. It is optional; use it for retry-safe publishing, especially with slow media.

Can one post mix photos and videos?

No. Keep each post payload either video-based or photo-based to avoid media-type conflicts.