Brands
List brands (keyset-paginated)
Returns one page of the account's non-deleted brands in the uniform list envelope `{ data, pagination }`, in name order. Keep paginating while `pagination.nextCursor` is non-null, passing it back verbatim as `?cursor=`.
Create a brand from a store link
Creates a brand and starts reading the store link: its products land in the catalog and its tone is read, and, when the account has the Brand Brain, the Brain is read too. The `201` carries `siteRead` (`started` with its `readId`, which `GET /brands/{brandId}/site-read` reports on) and `brainRead` (`started` with its `readId`, or `not-started` with a reason); the brand exists either way. An account may start 50 site reads a UTC day: past that the brand is still created and `siteRead` is `{ status: 'refused', reason: 'daily-limit' }`. With no `storeUrl` the brand starts empty, for a brand with no website: nothing is read and both reads are `{ status: 'not-started', reason: 'no-store-link' }`. The account must be under its plan's brand limit. `Idempotency-Key` is required: a retry with the same key and body returns the same brand, never a second one.
Get a brand's latest site read
The report of the read of the brand's site that `POST /brands` started: while `state` is `running`, poll again; when `done`, `products` says how many products were added, were already there, were left out (and why) and which pages could not be read. `kit` is `pending` until the brand kit is read too.
Read a brand's strategy
The brand's strategy as its brand page shows it: its buyers (`personas`), `voice`, hooks (`angles`) and `facts`, and its Business (`job`, `pillars`, `cards`). Every line is listed with its `section`, its `lineId` and its `state`: `on` lines are what Mocart uses, `suggested` ones wait to be kept, `off` ones are muted. `revisions` holds the revision of each section, which a change sends as `ifRevision`.
Add a line to a brand's strategy
Adds a line to one section, as a person adds it on the brand page: it is `on` at once. The body names the `section`, the section's fields and `ifRevision`. Answers the new line's `lineId`, the section's new `revision` and its lines.
Change a line of a brand's strategy (its words, Keep or Mute)
Changes one line, as on the brand page: `state: 'on'` keeps it (Keep), `state: 'off'` mutes it (Not this), or the fields sent rewrite its words (a `null` takes an optional field away). Never both. Answers the section's new `revision` and its lines.
Remove a line from a brand's strategy
Removes one line, as on the brand page. A buyer or fact any hook points at cannot be removed (mute it, or change or remove the hook first). Answers the section's new `revision` and its lines. The query takes `section` and `ifRevision` and nothing else: a missing, malformed or unknown parameter is a 422 before anything is read.