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

← REST API reference

Edit a campaign brief

Change the creative brief of a draft or paused campaign (title, message, openings, call to action, dos and don'ts). Only the fields sent change: a field sent replaces what was there, and fields left out keep their value. A live campaign has to be paused before its brief can change.

View as Markdown
PATCHhttps://yapfactory.com/api/v1/campaigns/{campaignId}/brief
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 toolupdate_campaign_brief

Parameters

campaignId
pathrequired
uuid

The campaign's id.

title
bodyoptional
string

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

keyMessage
bodyoptional
string

The one thing the video should get across. Up to 600 characters.

hooks
bodyoptional
string[]

Opening lines to use. Replaces the whole list. Up to 5 items.

cta
bodyoptional
string

What the viewer should do at the end. Up to 200 characters.

dos
bodyoptional
string[]

Things the video should do. Replaces the whole list. Up to 8 items.

donts
bodyoptional
string[]

Things it must not do or say. Replaces the whole list. Up to 8 items.

Example request

curl -X PATCH "https://yapfactory.com/api/v1/campaigns/8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f/brief" \
  -H "Authorization: Bearer $YAP_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "keyMessage": "Sleepwell helps you fall asleep without your phone.",
    "hooks": [
      "I used to scroll until 2am.",
      "My sleep score went from 52 to 81."
    ]
  }'

Response

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

{
  "data": {
    "campaignId": "8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f",
    "saved": true,
    "url": "https://yapfactory.com/brand/campaigns/8f14e45f-ceea-4e7a-9b1d-2c3b4a5d6e7f/edit"
  }
}

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).
not_found404No such campaign, or it isn't yours.
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.