Launch offer: service fee 10% 4% until 31 Dec, just enough to cover card processing. See pricing

← REST API reference

Draft a campaign

Create a campaign draft with its brief. Nobody sees a draft until publish_campaign makes it live, so the person can review it first. Takes productId, or product to add a new one.

View as Markdown
POSThttps://yapfactory.com/api/v1/campaigns
Who can use itBrands
Tierwrite: Changes your own things only. Nobody else is told.
Scopecampaigns:write, or write
Idempotency-KeyOptional, and recommended
Rate limitWrites: 20 a minute
MCP toolcreate_campaign_draft

Parameters

productId
bodyoptional
uuid

From list_products.

product
bodyoptional
object

A new product, when productId isn't given.

product.name
bodyrequired
string

The product's name. 1 to 80 characters.

product.url
bodyoptional
url

App Store, Play Store or website link. Up to 500 characters.

product.platform
bodyrequired
"ios" | "android" | "web"

Where people use it.

product.description
bodyoptional
string

What it is and who it's for. Up to 2000 characters.

title
bodyrequired
string

The campaign's name, as creators see it. 3 to 100 characters.

template
bodyoptional
"one_video" | "test_openings" | "ad_bundle"

one_video: 1 video for your own channels. test_openings: 1 video with 3 openings. ad_bundle: 3 videos you can run as ads for 3 months. Default "one_video".

videos
bodyoptional
integer

Videos per creator (overrides the template). 1 to 20.

adRights
bodyoptional
"organic" | "paid_3m" | "paid_6m" | "paid_12m" | "paid_forever"

organic = your own channels, no ads. paid_*: how long you can run it as an ad.

targetCountries
bodyoptional
("GB" | "US" | "IE" | "CA" | "AU")[]

Where the creators' audiences should be. Left out: your own country. 1 to 5 items.

lengthSeconds
bodyoptional
15 | 30 | 60

How long each video runs. Default 30.

deadline
bodyoptional
date

yyyy-mm-dd, at least 5 days away. Default: the template's (2-3 weeks).

brief
bodyrequired
object
brief.keyMessage
bodyoptional
string

What the video must get across. Leave out to let the creator decide. Up to 600 characters.

brief.hooks
bodyoptional
string[]

Opening lines to try. Leave out to let the creator decide. Up to 5 items.

brief.cta
bodyoptional
string

Closing call to action. Leave out to let the creator decide. Up to 200 characters.

brief.dos
bodyoptional
string[]

Things the video should do. Up to 8 items.

brief.donts
bodyoptional
string[]

Things it must not do or say. Up to 8 items.

brief.exampleVideoUrl
bodyoptional
url

A video in the style you want. Up to 500 characters.

What a draft gets

  • Price. There's no price to set. Each creator sets their own rate per video, and you see it in GET /creators before you invite anyone. Ad rights are priced by each creator too.
  • Revisions. Every deal includes 3 rounds of changes.
  • Disclosure. Videos are marked #ad.
  • Set on the site, not here: exclusivity, a rush deadline, bonuses, raw footage and cut-downs. The draft's review link opens the page where the person can change them before publishing.

Example request

curl -X POST "https://yapfactory.com/api/v1/campaigns" \
  -H "Authorization: Bearer $YAP_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "productId": "8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f",
    "title": "Morning routine with Sleepwell",
    "template": "one_video",
    "lengthSeconds": 30,
    "brief": {
      "keyMessage": "Sleepwell helps you fall asleep in 10 minutes without your phone.",
      "hooks": [
        "I used to scroll until 2am."
      ],
      "cta": "Try it free tonight."
    }
  }'

Response

201 with the result in data: the same object the MCP tool returns.

{
  "data": {
    "campaignId": "8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f",
    "status": "draft",
    "review": "https://yapfactory.com/brand/campaigns/8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f/edit",
    "next": "Show the person the draft (get_campaign), then publish_campaign when they're happy."
  }
}

An example: fields that don't apply are null, and new fields can be added at any time, so ignore ones you don't know. Every response carries Request-Id and the RateLimit-* headers.

Errors

CodeStatusWhen
invalid_request400A field failed validation (see meta.issues), or an unknown query parameter.
unauthorized401No token, or it's wrong, expired, revoked or from the other environment.
insufficient_scope403The token doesn't have campaigns:write (or write).
forbidden403Only for brands, or the account can't do this yet (email not confirmed, paused).
conflict409Its current state doesn't allow this. message says why, in words you can show.
idempotency_conflict409The same Idempotency-Key came with a different body.
rate_limited429Over the limit. Wait for Retry-After seconds.
internal500Our fault. Retry later, and send us the requestId if it keeps happening.

Every error has the same shape. See Errors for what to do about each one.