Rename, archive or re-rule a segment
Updates a segment in place, keeping its id. An omitted field keeps its stored value, which is why this is a PATCH: sending the whole resource would let an omitted status silently re-activate an audience the merchant had archived and put it back in the refresh rotation. A rule you send REPLACES the whole tree rather than merging into it, because half a boolean expression is a different expression. A rule sent to a static segment is 400 not_dynamic. status archived is the REVERSIBLE way to retire an audience: it leaves the rule and the history intact and only takes the segment out of the refresh rotation. It is what the delete’s second grant exists to be compared against.
Authorizations
A secret API key. Publishable keys cannot reach this API. A key may carry an expiry, and an expired key is refused exactly like an unknown one, with a 401 that names no reason; check the key's expires_at in the dashboard rather than inferring it from a response. When a merchant rolls a key's secret they choose a grace window of up to 3 days, and for its duration BOTH the new secret and the one it replaced authenticate, so an integration moves over on its own deploy schedule instead of at the instant the button is pressed. Move before the window closes: after it, the old secret is refused. Nothing else about this contract moves with a roll. The key keeps its id and its scopes, so the only thing an integration updates is the credential itself.
Headers
A unique key per logical write. Replaying a request with the same key returns the first response byte for byte instead of applying the write twice.
Path Parameters
Body
Every field is optional and an omitted one keeps its stored value. None may be sent as null: no field on a segment has a "clear it" meaning, and a null rule on a dynamic segment is not "no rule", it is a segment that cannot exist.
Still unique per store; a clash is 409 name_taken.
archived takes the segment out of the refresh rotation without destroying its definition, and is reversible. It is the safe alternative to deleting.
active, archived REPLACES the whole tree rather than merging into it. Same shape and same closed vocabulary as the create. Sending one to a static segment is 400 not_dynamic: a static segment's membership is a list and it can never gain a rule.
Response
Success
