Skip to main content
Goal: turn a segment and an objective into a draft you can review and approve.

In the app

The draft appears with a title, message and call to action, in state draft.

From the API

Approving it

A campaign moves through states, and only legal moves are accepted:
ready can go back to draft for another pass. Anything else — draft → sent, sent → anything — is refused with 409 conflict, so a campaign cannot skip review.

Notes

Generation needs the segment to exist. An unknown segmentId is 404; the segment name is resolved server-side, so a client cannot label a campaign with a name its audience does not have. See the generative pipeline.
The tone and channel reach the prompt. They are instructions to the model, not a formatting pass applied afterwards.
Without any provider key (OPENCODE_API_KEY, GEMINI_API_KEY or ANTHROPIC_API_KEY) the API still works, using a deterministic local generator. The shape of the response is identical, which keeps development and tests offline — but the prose is templated, not written. See run without a model key.
llm_unavailable (503) means the provider could not be reached; the request is safe to retry. llm_error (502) means it answered with something unusable. See the error model.
Last modified on October 6, 2026