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 Markdownhttps://yapfactory.com/api/v1/campaigns/{campaignId}/brief| Who can use it | Brands |
| Tier | write: Changes your own things only. Nobody else is told. |
| Scope | campaigns:write, or write |
| Idempotency-Key | Optional, and recommended |
| Rate limit | Writes: 20 a minute |
| MCP tool | update_campaign_brief |
Parameters
campaignIdThe campaign's id.
titleThe campaign's name, as creators see it. 3 to 100 characters.
keyMessageThe one thing the video should get across. Up to 600 characters.
hooksOpening lines to use. Replaces the whole list. Up to 5 items.
ctaWhat the viewer should do at the end. Up to 200 characters.
dosThings the video should do. Replaces the whole list. Up to 8 items.
dontsThings 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
| Code | Status | When |
|---|---|---|
invalid_request | 400 | A field failed validation (see meta.issues), or an unknown query parameter. |
unauthorized | 401 | No token, or it's wrong, expired, revoked or from the other environment. |
insufficient_scope | 403 | The token doesn't have campaigns:write (or write). |
forbidden | 403 | Only for brands, or the account can't do this yet (email not confirmed, paused). |
not_found | 404 | No such campaign, or it isn't yours. |
conflict | 409 | Its current state doesn't allow this. message says why, in words you can show. |
idempotency_conflict | 409 | The same Idempotency-Key came with a different body. |
rate_limited | 429 | Over the limit. Wait for Retry-After seconds. |
internal | 500 | Our 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.