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",
"markAI": false,
"scheduledTime": "2024-04-22T14:00",
"timezone": "America/New_York"
}'
const response = await fetch('https://api.infinipost.co/v1/posts/video', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
accountIds: ['acc_123', 'acc_456'],
contentUrl: 'https://example.com/video.mp4',
caption: 'Check out this amazing content! #viral',
soundId: 'sound_abc123',
markAI: false,
scheduledTime: '2024-04-22T14:00',
timezone: 'America/New_York'
})
});
const data = await response.json();
import requests
response = requests.post(
'https://api.infinipost.co/v1/posts/video',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
'accountIds': ['acc_123', 'acc_456'],
'contentUrl': 'https://example.com/video.mp4',
'caption': 'Check out this amazing content! #viral',
'soundId': 'sound_abc123',
'markAI': False,
'scheduledTime': '2024-04-22T14:00',
'timezone': 'America/New_York'
}
)
print(response.json())
{
"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"
}
]
}
Posts
Create Video Post
Create and schedule a video post to one or more accounts
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",
"markAI": false,
"scheduledTime": "2024-04-22T14:00",
"timezone": "America/New_York"
}'
const response = await fetch('https://api.infinipost.co/v1/posts/video', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
accountIds: ['acc_123', 'acc_456'],
contentUrl: 'https://example.com/video.mp4',
caption: 'Check out this amazing content! #viral',
soundId: 'sound_abc123',
markAI: false,
scheduledTime: '2024-04-22T14:00',
timezone: 'America/New_York'
})
});
const data = await response.json();
import requests
response = requests.post(
'https://api.infinipost.co/v1/posts/video',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
'accountIds': ['acc_123', 'acc_456'],
'contentUrl': 'https://example.com/video.mp4',
'caption': 'Check out this amazing content! #viral',
'soundId': 'sound_abc123',
'markAI': False,
'scheduledTime': '2024-04-22T14:00',
'timezone': 'America/New_York'
}
)
print(response.json())
{
"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
array
required
Array of account IDs to post to (e.g.,
["acc_123", "acc_456"]).string
required
URL of the video file to post.
string
Post caption/description.
string
ID of a TikTok sound to attach to the post.Platform Support:
- TikTok: Supported
- Instagram: Not supported
- Import the audio using the Upload Sound endpoint with a TikTok video URL
- The endpoint returns a
soundId - Use that
soundIdin this field
// 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
})
});
boolean
default:"false"
When
true, adds an AI-generated content label to the post.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.string
default:"America/New_York"
IANA timezone for interpreting
scheduledTime. Supported values:| Value | Label |
|---|---|
America/New_York | Eastern (ET) |
America/Chicago | Central (CT) |
America/Denver | Mountain (MT) |
America/Los_Angeles | Pacific (PT) |
America/Anchorage | Alaska (AKT) |
Pacific/Honolulu | Hawaii (HST) |
Europe/London | London (GMT) |
Europe/Paris | Paris (CET) |
Asia/Tokyo | Tokyo (JST) |
Asia/Singapore | Singapore (SGT) |
Australia/Sydney | Sydney (AEDT) |
Response
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",
"markAI": false,
"scheduledTime": "2024-04-22T14:00",
"timezone": "America/New_York"
}'
const response = await fetch('https://api.infinipost.co/v1/posts/video', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
accountIds: ['acc_123', 'acc_456'],
contentUrl: 'https://example.com/video.mp4',
caption: 'Check out this amazing content! #viral',
soundId: 'sound_abc123',
markAI: false,
scheduledTime: '2024-04-22T14:00',
timezone: 'America/New_York'
})
});
const data = await response.json();
import requests
response = requests.post(
'https://api.infinipost.co/v1/posts/video',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
'accountIds': ['acc_123', 'acc_456'],
'contentUrl': 'https://example.com/video.mp4',
'caption': 'Check out this amazing content! #viral',
'soundId': 'sound_abc123',
'markAI': False,
'scheduledTime': '2024-04-22T14:00',
'timezone': 'America/New_York'
}
)
print(response.json())
{
"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"
}
}
⌘I