Skip to main content
POST
/
v1
/
posts
/
video
curl -X POST https://api.infinipost.co/v1/posts/video \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "accountIds": ["acc_123", "acc_456"],
    "contentUrl": "https://example.com/video.mp4",
    "caption": "Check out this amazing content! #viral",
    "soundId": "sound_abc123",
    "scheduledTime": "2024-04-22T14:00",
    "timezone": "America/New_York"
  }'
{
  "posts": [
    {
      "postId": "post_abc123",
      "accountId": "acc_123",
      "platform": "tiktok",
      "status": "scheduled",
      "scheduledTime": "2024-04-22T14:00",
    "timezone": "America/New_York",
      "createdAt": "2024-04-21T20:15:00Z"
    },
    {
      "postId": "post_def456",
      "accountId": "acc_456",
      "platform": "instagram",
      "status": "scheduled",
      "scheduledTime": "2024-04-22T14:00",
    "timezone": "America/New_York",
      "createdAt": "2024-04-21T20:15:00Z"
    }
  ]
}

Request Body

accountIds
array
required
Array of account IDs to post to (e.g., ["acc_123", "acc_456"]).
contentUrl
string
required
URL of the video file to post.
caption
string
Post caption/description.
soundId
string
ID of a TikTok sound to attach to the post.Platform Support:
  • TikTok: Supported
  • Instagram: Not supported
Usage:
  1. Import the audio using the Upload Sound endpoint with a TikTok video URL
  2. The endpoint returns a soundId
  3. Use that soundId in this field
Example workflow:
// Step 1: Import audio from a TikTok video
const soundResponse = await fetch('https://api.infinipost.co/v1/media/sounds', {
  method: 'POST',
  headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
  body: JSON.stringify({
    soundUrl: 'https://www.tiktok.com/@username/video/7123456789'
  })
});
const { soundId } = await soundResponse.json();

// Step 2: Use the returned soundId in your post
const postResponse = await fetch('https://api.infinipost.co/v1/posts/video', {
  method: 'POST',
  headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
  body: JSON.stringify({
    accountIds: ['acc_123456'],
    contentUrl: 'https://example.com/video.mp4',
    soundId: soundId
  })
});
scheduledTime
string
Local time to post, in YYYY-MM-DDTHH:MM format (e.g. "2024-04-22T14:00"). If not provided, posts immediately.Interpreted in the timezone specified by the timezone parameter.
timezone
string
default:"America/New_York"
IANA timezone for interpreting scheduledTime. Supported values:
ValueLabel
America/New_YorkEastern (ET)
America/ChicagoCentral (CT)
America/DenverMountain (MT)
America/Los_AngelesPacific (PT)
America/AnchorageAlaska (AKT)
Pacific/HonoluluHawaii (HST)
Europe/LondonLondon (GMT)
Europe/ParisParis (CET)
Asia/TokyoTokyo (JST)
Asia/SingaporeSingapore (SGT)
Australia/SydneySydney (AEDT)

Response

posts
array
Array of created post objects (one per account).
curl -X POST https://api.infinipost.co/v1/posts/video \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "accountIds": ["acc_123", "acc_456"],
    "contentUrl": "https://example.com/video.mp4",
    "caption": "Check out this amazing content! #viral",
    "soundId": "sound_abc123",
    "scheduledTime": "2024-04-22T14:00",
    "timezone": "America/New_York"
  }'
{
  "posts": [
    {
      "postId": "post_abc123",
      "accountId": "acc_123",
      "platform": "tiktok",
      "status": "scheduled",
      "scheduledTime": "2024-04-22T14:00",
    "timezone": "America/New_York",
      "createdAt": "2024-04-21T20:15:00Z"
    },
    {
      "postId": "post_def456",
      "accountId": "acc_456",
      "platform": "instagram",
      "status": "scheduled",
      "scheduledTime": "2024-04-22T14:00",
    "timezone": "America/New_York",
      "createdAt": "2024-04-21T20:15:00Z"
    }
  ]
}

Error Responses

Unauthorized
{
  "error": {
    "code": "unauthenticated",
    "message": "Invalid or missing API key"
  }
}
Missing Required Fields
{
  "error": {
    "code": "invalid_parameter",
    "message": "accountIds is required and must be a non-empty array"
  }
}
Account Not Found
{
  "error": {
    "code": "not_found",
    "message": "Account(s) not found: acc_1a2b3c4d5e"
  }
}
Invalid Scheduled Time
{
  "error": {
    "code": "invalid_parameter",
    "message": "scheduledTime must be a valid ISO 8601 timestamp"
  }
}
Server Error
{
  "error": {
    "code": "internal",
    "message": "An unexpected error occurred"
  }
}