# 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.

```http
PATCH https://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`](https://yapfactory.com/developers/tools.md#update_campaign_brief) |

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `campaignId` | path | `uuid` | yes | The campaign's id. |
| `title` | body | `string` | no | The campaign's name, as creators see it. 3 to 100 characters. |
| `keyMessage` | body | `string` | no | The one thing the video should get across. Up to 600 characters. |
| `hooks` | body | `string[]` | no | Opening lines to use. Replaces the whole list. Up to 5 items. |
| `cta` | body | `string` | no | What the viewer should do at the end. Up to 200 characters. |
| `dos` | body | `string[]` | no | Things the video should do. Replaces the whole list. Up to 8 items. |
| `donts` | body | `string[]` | no | Things it must not do or say. Replaces the whole list. Up to 8 items. |

## Example request

```bash
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.

```json
{
  "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](https://yapfactory.com/developers/errors.md) for what to do about each one.

---

HTML version: https://yapfactory.com/developers/api/update_campaign_brief
