Skip to content
UGC API

Campaigns

A campaign takes N posts, M accounts and a cadence per account, and turns them into a schedule. Use it instead of computing times in a loop. 100 posts across 5 accounts at 1 per day runs for 20 days.

Updated

POST /v1/campaigns

FieldTypeDescription
accountsstring[]Account IDs to post to. Or use targets.
targetsobject{ "tags": ["skincare-creators"], "platforms": ["tiktok"], "accounts": [...] }: account groups, optionally narrowed to some platforms.
postsobject[], required1–1,000 items. Each has format, media, caption, and optional options, caption_variants, variant, clip_id and external_id, as in create a post. No accounts or scheduled_at.
defaultsobjectOptions for every post, per platform, plus fit: { "tiktok": { "privacy": "PUBLIC_TO_EVERYONE" }, "instagram": { "story": true }, "youtube": { "privacy": "public" } }. A post's own options win.
rulesobject[]Act on results: repost breakouts to more accounts. See repost rules.
spreadbooleanDefault true: each post goes to one account, taking turns. false: every post goes to all accounts.
cadenceobject{ "per_day": 1 } (1–6 posts per account per day) or { "every_days": 2 } (one post every N days). Default 1 per day.
timesstring[]Local posting times, HH:MM, used in order for per_day. Default ["10:00", "15:00", "20:00"].
timezonestringIANA timezone for times and start_date, like America/New_York. Default UTC.
start_datestringFirst day, YYYY-MM-DD. Default today. Times already past are skipped.
bash
curl https://ugcapi.dev/v1/campaigns \
  -H "Authorization: Bearer ugc_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "accounts": ["acc_tt_01", "acc_tt_02", "acc_tt_03", "acc_tt_04", "acc_tt_05"],
    "cadence": { "per_day": 1 },
    "times": ["10:00"],
    "timezone": "America/New_York",
    "start_date": "2026-11-01",
    "posts": [
      { "format": "video", "media": ["https://cdn.example.com/h/001.mp4"], "caption": "Hook 1" },
      { "format": "video", "media": ["https://cdn.example.com/h/002.mp4"], "caption": "Hook 2" }
    ]
  }'

How the schedule is built

  1. Round-robin. Posts are assigned in order: post 1 to account 1, post 2 to account 2, wrapping back to account 1 after the last account.
  2. Cadence per account. Each account posts on its own cadence at times. Days needed = posts / (accounts × per_day), rounded up: 100 posts × 5 accounts × 1 a day = 20 days.
  3. Staggered minutes. Each account's times are shifted 7 minutes from the previous account's (10:00, 10:07, 10:14…), so the roster doesn't post at the same minute.
  4. Normal posts. Each assignment becomes a regular post with its own ID, results and webhooks, all tagged with the campaign's campaign_id.

Response

json
{
  "id": "cmp_xyz",
  "posts": 100,
  "post_ids": ["post_1", "post_2", "..."],
  "first_at": "2026-11-01T14:00:00.000Z",
  "last_at": "2026-11-20T14:28:00.000Z"
}

Preview before you commit

Add "dry_run": true to the same request to get the schedule without creating anything or using credits. The response has posts, credits_needed, first_at, last_at and schedule: one entry per post with its scheduled_at and account_ids. Give a campaign a name to find it later.

json
{
  "dry_run": true,
  "posts": 3,
  "credits_needed": 3,
  "first_at": "2026-11-01T17:00:00.000Z",
  "last_at": "2026-11-02T17:00:00.000Z",
  "schedule": [
    { "index": 0, "scheduled_at": "2026-11-01T17:00:00.000Z", "account_ids": ["acc_tt_01"] },
    { "index": 1, "scheduled_at": "2026-11-01T17:07:00.000Z", "account_ids": ["acc_tt_02"] },
    { "index": 2, "scheduled_at": "2026-11-02T17:00:00.000Z", "account_ids": ["acc_tt_01"] }
  ]
}

The dry run (and the real response) also lists every result per post (schedule[].results, with the caption variant each account gets) and warnings: files converted for a platform, captions trimmed, placements skipped. See fit to platform.

Repost rules

A rule watches the campaign's results. When one breaks out (its views reach multiple× its account's median within within_hours), UGC API sends the same clip to up to max accounts in targets that don't have it yet, delay_minutes later. Each repost result costs a credit; a rule.reposted webhook tells you what it did. One repost per clip per campaign.

json
"rules": [
  { "when": "breakout", "multiple": 3, "within_hours": 48, "action": "repost",
    "targets": { "tags": ["backup-creators"], "platforms": ["tiktok", "instagram"] }, "max": 10, "delay_minutes": 60 }
]

See how a campaign did with the campaign report: by platform, account, clip or caption variant.

Changing a running campaign

  • GET /v1/campaigns lists your campaigns newest first with progress: posts, by_status, first_at, last_at, next_at and the settings you used. It returns up to limit (1–100, default 100) with a next_cursor; pass it back as cursor for the next page. GET /v1/campaigns/:id returns one.
  • DELETE /v1/campaigns/:id cancels every post that hasn't gone out yet and refunds its credits. Published posts stay.
  • List its posts with GET /v1/posts?campaign_id=cmp_xyz&sort=scheduled_at.
  • Cancel any single post with DELETE /v1/posts/:id; its credits come back.
  • If an account's login expires or is revoked, its posts wait (up to 7 days) and you get an account.disconnected webhook. Other accounts keep posting. When the creator reconnects, waiting posts go out. After 7 days of waiting they fail and are refunded.
  • If you disconnect an account yourself (DELETE /v1/accounts/:id), its scheduled posts are cancelled and refunded.
  • The scheduler never publishes the same post twice to one account.

Credits

A campaign uses one credit per result, the same as single posts; Story frames count individually. Credits for the whole campaign are reserved when you create it, so it fails with 402 insufficient_credits if you don't have enough. Failed or cancelled results are refunded. See pricing and credits.

Tips

  • Run one campaign per platform so each gets its own cadence.
  • Order posts so similar content is spread out; round-robin keeps neighbors on different accounts.
  • Start low. See UGC posting cadence and limits.

FAQ

Can I add accounts to a running campaign?

Not to an existing one. Create a new campaign for the extra accounts and remaining posts.

Can a campaign mix videos and slideshows?

Yes. Each item in posts has its own format and media.

What timezone are the times in?

The timezone you pass (an IANA name like Europe/London). Daylight saving is handled, so 10:00 stays 10:00 local all year.

Related