v3
latestOpenAPI 3.1.02026-08-07478772.4 KBReplace a campaign's configuration
Replace a campaign's configuration through the one validated write path.
Authorize, validate, then write via the apply_campaign_config RPC, which stamps the write so the version trigger records who made it. Returns the id of the version the write minted, the stored configuration, and the base_updated_at token to send back on the next conditional write.
Supplying base_updated_at makes the write conditional: if the configuration moved since that token was issued, the write is refused with 409 instead of overwriting the other edit. Omit it to write unconditionally.
What this endpoint does NOT do:
- No partial merge. The body's configuration REPLACES the stored one outright, matching how the product saves today.
- No experiments consent flow. Consent arguments are always sent empty, so a write that would disturb a running experiment is refused by the engine and returned as 409 with the engine's message; that caller has to go through the consent-aware path instead.
- No field stripping. Keys CampaignConfig does not declare are stored verbatim and logged, never dropped.
request is the published contract and the first validation gate; http_request supplies what actually gets written. Parsing the body into CampaignConfig would silently drop every undeclared key (the model is extra="ignore", and its nested models are too, so no amount of extra="allow" at the top level would make the parsed object faithful), so the raw JSON object is what reaches storage.
Decoded from the cached BYTES, not from http_request.json(): Starlette caches the decoded object and hands the SAME one to FastAPI's parse, and several config validators rewrite what they are given in place (TTSConfig._resolve_params_by_provider replaces params with a model instance and can inject a default model). Reading .json() would therefore return a body the parse had already corrupted. Re-decoding the bytes costs one json parse and is the only form that is guaranteed pristine.
Path parameters
Request body
Response
Configuration written; a new version was minted