Schedule and resume a 15-video campaign
Two destinations per video produce 30 schedules. Use two simulation accounts to rehearse.

Prepare the manifest
Get projectId from projects_list and two IDs from accounts_list. Place video-01.mp4 through video-15.mp4 in the campaign directory. Set the three variables below to the returned IDs. Run once to create campaign.json and retain the file. Times are future UTC instants with an explicit display zone. For a ready asset in the same project use {"mediaId":"ID"} in source.
export PROJECT_ID='PROJECT_ID' ACCOUNT_A='ACCOUNT_ID_A' ACCOUNT_B='ACCOUNT_ID_B'
node --input-type=module <<'JS'
import { writeFileSync } from 'node:fs'
import { randomUUID } from 'node:crypto'
const { PROJECT_ID: projectId, ACCOUNT_A, ACCOUNT_B } = process.env
const start = Date.now() + 3600000
const items = Array.from({length: 15}, (_, index) => {
const itemId = 'video-' + String(index + 1).padStart(2, '0')
const at = new Date(start + index * 60000).toISOString()
return { itemId, source: {file: itemId + '.mp4'}, caption: itemId,
targets: [ACCOUNT_A, ACCOUNT_B].map(accountId => ({account: {accountId}, at})) }
})
writeFileSync('campaign.json', JSON.stringify({version: 1, batchId: randomUUID(), projectId,
timezone: 'America/Sao_Paulo', items}, null, 2), {flag: 'wx'})
JS
For YouTube include target options with title, visibility and madeForKids. For TikTok inspect the diagnosis and allowed privacy options and send each confirmation to the owner. The installer includes FFprobe for local file inspection.
With the CLI
opensocial batch plan campaign.json --dry-run --json
opensocial batch apply campaign.json --jsonl
opensocial batch status BATCH_UUID --json
Check canApply and all 30 entries before applying. After an interruption, inspect status and repeat the same apply with the same file. Each destination row identifies media, account, publication and time. The summary reports scheduled and pendingApproval. CLI exit codes are 0 for success, 1 for execution failure, 2 for invalid input or plan, and 3 for partial or pending work.
With MCP and REST
- In local MCP,
batches_plan_filewith{"path":"campaign.json"}resolves local files and returnsmanifestandplan. In REST or HTTP MCP use a manifest with media IDs orsource.uploaddescriptors containing name, SHA-256 and video metadata. Local paths stay on the client. Send{"manifest": ...}tobatches_plan.
- If valid, send the same manifest to
batches_register. For each local file, callbatches_upload_filewithbatchId,itemIdandpath. Over HTTP callbatches_uploadwithbatchIdanditemIdand PUT the bytes when anuploadUrlis returned. Reuse media already markedready.
- For each video/account pair call
batches_applywithbatchId,itemIdandaccountId. Supply idempotency keys on writes. Readbatches_statuswithbatchId. Retain IDs across logins and resume pending entries only. Forawaiting_ownerreturn the review link. Forunknowncheck the remote result before resending.
Guided walkthrough



Video walkthrough
Transcript
- Validate all 15 videos and both campaign destinations.
- After interruption, look up the same batch and inspect its pending destinations.
- Reapply the manifest and verify all 30 distinct publication IDs.